1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2d3cb2de2SBard Liao /* 3d3cb2de2SBard Liao * rt5659.h -- RT5659/RT5658 ALSA SoC audio driver 4d3cb2de2SBard Liao * 5d3cb2de2SBard Liao * Copyright 2015 Realtek Microelectronics 6d3cb2de2SBard Liao * Author: Bard Liao <bardliao@realtek.com> 7d3cb2de2SBard Liao */ 8d3cb2de2SBard Liao 9d3cb2de2SBard Liao #ifndef __RT5659_H__ 10d3cb2de2SBard Liao #define __RT5659_H__ 11d3cb2de2SBard Liao 12d3cb2de2SBard Liao #include <sound/rt5659.h> 13d3cb2de2SBard Liao 14d3cb2de2SBard Liao #define DEVICE_ID 0x6311 15d3cb2de2SBard Liao 16d3cb2de2SBard Liao /* Info */ 17d3cb2de2SBard Liao #define RT5659_RESET 0x0000 18d3cb2de2SBard Liao #define RT5659_VENDOR_ID 0x00fd 19d3cb2de2SBard Liao #define RT5659_VENDOR_ID_1 0x00fe 20d3cb2de2SBard Liao #define RT5659_DEVICE_ID 0x00ff 21d3cb2de2SBard Liao /* I/O - Output */ 22d3cb2de2SBard Liao #define RT5659_SPO_VOL 0x0001 23d3cb2de2SBard Liao #define RT5659_HP_VOL 0x0002 24d3cb2de2SBard Liao #define RT5659_LOUT 0x0003 25d3cb2de2SBard Liao #define RT5659_MONO_OUT 0x0004 26d3cb2de2SBard Liao #define RT5659_HPL_GAIN 0x0005 27d3cb2de2SBard Liao #define RT5659_HPR_GAIN 0x0006 28d3cb2de2SBard Liao #define RT5659_MONO_GAIN 0x0007 29d3cb2de2SBard Liao #define RT5659_SPDIF_CTRL_1 0x0008 30d3cb2de2SBard Liao #define RT5659_SPDIF_CTRL_2 0x0009 31d3cb2de2SBard Liao /* I/O - Input */ 32d3cb2de2SBard Liao #define RT5659_CAL_BST_CTRL 0x000a 33d3cb2de2SBard Liao #define RT5659_IN1_IN2 0x000c 34d3cb2de2SBard Liao #define RT5659_IN3_IN4 0x000d 35d3cb2de2SBard Liao #define RT5659_INL1_INR1_VOL 0x000f 36d3cb2de2SBard Liao /* I/O - Speaker */ 37d3cb2de2SBard Liao #define RT5659_EJD_CTRL_1 0x0010 38d3cb2de2SBard Liao #define RT5659_EJD_CTRL_2 0x0011 39d3cb2de2SBard Liao #define RT5659_EJD_CTRL_3 0x0012 40d3cb2de2SBard Liao #define RT5659_SILENCE_CTRL 0x0015 41d3cb2de2SBard Liao #define RT5659_PSV_CTRL 0x0016 42d3cb2de2SBard Liao /* I/O - Sidetone */ 43d3cb2de2SBard Liao #define RT5659_SIDETONE_CTRL 0x0018 44d3cb2de2SBard Liao /* I/O - ADC/DAC/DMIC */ 45d3cb2de2SBard Liao #define RT5659_DAC1_DIG_VOL 0x0019 46d3cb2de2SBard Liao #define RT5659_DAC2_DIG_VOL 0x001a 47d3cb2de2SBard Liao #define RT5659_DAC_CTRL 0x001b 48d3cb2de2SBard Liao #define RT5659_STO1_ADC_DIG_VOL 0x001c 49d3cb2de2SBard Liao #define RT5659_MONO_ADC_DIG_VOL 0x001d 50d3cb2de2SBard Liao #define RT5659_STO2_ADC_DIG_VOL 0x001e 51d3cb2de2SBard Liao #define RT5659_STO1_BOOST 0x001f 52d3cb2de2SBard Liao #define RT5659_MONO_BOOST 0x0020 53d3cb2de2SBard Liao #define RT5659_STO2_BOOST 0x0021 54d3cb2de2SBard Liao #define RT5659_HP_IMP_GAIN_1 0x0022 55d3cb2de2SBard Liao #define RT5659_HP_IMP_GAIN_2 0x0023 56d3cb2de2SBard Liao /* Mixer - D-D */ 57d3cb2de2SBard Liao #define RT5659_STO1_ADC_MIXER 0x0026 58d3cb2de2SBard Liao #define RT5659_MONO_ADC_MIXER 0x0027 59d3cb2de2SBard Liao #define RT5659_AD_DA_MIXER 0x0029 60d3cb2de2SBard Liao #define RT5659_STO_DAC_MIXER 0x002a 61d3cb2de2SBard Liao #define RT5659_MONO_DAC_MIXER 0x002b 62d3cb2de2SBard Liao #define RT5659_DIG_MIXER 0x002c 63d3cb2de2SBard Liao #define RT5659_A_DAC_MUX 0x002d 64d3cb2de2SBard Liao #define RT5659_DIG_INF23_DATA 0x002f 65d3cb2de2SBard Liao /* Mixer - PDM */ 66d3cb2de2SBard Liao #define RT5659_PDM_OUT_CTRL 0x0031 67d3cb2de2SBard Liao #define RT5659_PDM_DATA_CTRL_1 0x0032 68d3cb2de2SBard Liao #define RT5659_PDM_DATA_CTRL_2 0x0033 69d3cb2de2SBard Liao #define RT5659_PDM_DATA_CTRL_3 0x0034 70d3cb2de2SBard Liao #define RT5659_PDM_DATA_CTRL_4 0x0035 71d3cb2de2SBard Liao #define RT5659_SPDIF_CTRL 0x0036 72d3cb2de2SBard Liao 73d3cb2de2SBard Liao /* Mixer - ADC */ 74d3cb2de2SBard Liao #define RT5659_REC1_GAIN 0x003a 75d3cb2de2SBard Liao #define RT5659_REC1_L1_MIXER 0x003b 76d3cb2de2SBard Liao #define RT5659_REC1_L2_MIXER 0x003c 77d3cb2de2SBard Liao #define RT5659_REC1_R1_MIXER 0x003d 78d3cb2de2SBard Liao #define RT5659_REC1_R2_MIXER 0x003e 79d3cb2de2SBard Liao #define RT5659_CAL_REC 0x0040 80d3cb2de2SBard Liao #define RT5659_REC2_L1_MIXER 0x009b 81d3cb2de2SBard Liao #define RT5659_REC2_L2_MIXER 0x009c 82d3cb2de2SBard Liao #define RT5659_REC2_R1_MIXER 0x009d 83d3cb2de2SBard Liao #define RT5659_REC2_R2_MIXER 0x009e 84d3cb2de2SBard Liao #define RT5659_RC_CLK_CTRL 0x009f 85d3cb2de2SBard Liao /* Mixer - DAC */ 86d3cb2de2SBard Liao #define RT5659_SPK_L_MIXER 0x0046 87d3cb2de2SBard Liao #define RT5659_SPK_R_MIXER 0x0047 88d3cb2de2SBard Liao #define RT5659_SPO_AMP_GAIN 0x0048 89d3cb2de2SBard Liao #define RT5659_ALC_BACK_GAIN 0x0049 90d3cb2de2SBard Liao #define RT5659_MONOMIX_GAIN 0x004a 91d3cb2de2SBard Liao #define RT5659_MONOMIX_IN_GAIN 0x004b 92d3cb2de2SBard Liao #define RT5659_OUT_L_GAIN 0x004d 93d3cb2de2SBard Liao #define RT5659_OUT_L_MIXER 0x004e 94d3cb2de2SBard Liao #define RT5659_OUT_R_GAIN 0x004f 95d3cb2de2SBard Liao #define RT5659_OUT_R_MIXER 0x0050 96d3cb2de2SBard Liao #define RT5659_LOUT_MIXER 0x0052 97d3cb2de2SBard Liao 98d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_1 0x0053 99d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_2 0x0054 100d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_3 0x0055 101d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_4 0x0056 102d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_5 0x0057 103d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_6 0x0058 104d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_7 0x0059 105d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_8 0x005a 106d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_9 0x005b 107d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_10 0x005c 108d3cb2de2SBard Liao #define RT5659_HAPTIC_GEN_CTRL_11 0x005d 109d3cb2de2SBard Liao #define RT5659_HAPTIC_LPF_CTRL_1 0x005e 110d3cb2de2SBard Liao #define RT5659_HAPTIC_LPF_CTRL_2 0x005f 111d3cb2de2SBard Liao #define RT5659_HAPTIC_LPF_CTRL_3 0x0060 112d3cb2de2SBard Liao /* Power */ 113d3cb2de2SBard Liao #define RT5659_PWR_DIG_1 0x0061 114d3cb2de2SBard Liao #define RT5659_PWR_DIG_2 0x0062 115d3cb2de2SBard Liao #define RT5659_PWR_ANLG_1 0x0063 116d3cb2de2SBard Liao #define RT5659_PWR_ANLG_2 0x0064 117d3cb2de2SBard Liao #define RT5659_PWR_ANLG_3 0x0065 118d3cb2de2SBard Liao #define RT5659_PWR_MIXER 0x0066 119d3cb2de2SBard Liao #define RT5659_PWR_VOL 0x0067 120d3cb2de2SBard Liao /* Private Register Control */ 121d3cb2de2SBard Liao #define RT5659_PRIV_INDEX 0x006a 122d3cb2de2SBard Liao #define RT5659_CLK_DET 0x006b 123d3cb2de2SBard Liao #define RT5659_PRIV_DATA 0x006c 124d3cb2de2SBard Liao /* System Clock Pre Divider Gating Control */ 125d3cb2de2SBard Liao #define RT5659_PRE_DIV_1 0x006e 126d3cb2de2SBard Liao #define RT5659_PRE_DIV_2 0x006f 127d3cb2de2SBard Liao /* Format - ADC/DAC */ 128d3cb2de2SBard Liao #define RT5659_I2S1_SDP 0x0070 129d3cb2de2SBard Liao #define RT5659_I2S2_SDP 0x0071 130d3cb2de2SBard Liao #define RT5659_I2S3_SDP 0x0072 131d3cb2de2SBard Liao #define RT5659_ADDA_CLK_1 0x0073 132d3cb2de2SBard Liao #define RT5659_ADDA_CLK_2 0x0074 133d3cb2de2SBard Liao #define RT5659_DMIC_CTRL_1 0x0075 134d3cb2de2SBard Liao #define RT5659_DMIC_CTRL_2 0x0076 135d3cb2de2SBard Liao /* Format - TDM Control */ 136d3cb2de2SBard Liao #define RT5659_TDM_CTRL_1 0x0077 137d3cb2de2SBard Liao #define RT5659_TDM_CTRL_2 0x0078 138d3cb2de2SBard Liao #define RT5659_TDM_CTRL_3 0x0079 139d3cb2de2SBard Liao #define RT5659_TDM_CTRL_4 0x007a 140d3cb2de2SBard Liao #define RT5659_TDM_CTRL_5 0x007b 141d3cb2de2SBard Liao 142d3cb2de2SBard Liao /* Function - Analog */ 143d3cb2de2SBard Liao #define RT5659_GLB_CLK 0x0080 144d3cb2de2SBard Liao #define RT5659_PLL_CTRL_1 0x0081 145d3cb2de2SBard Liao #define RT5659_PLL_CTRL_2 0x0082 146d3cb2de2SBard Liao #define RT5659_ASRC_1 0x0083 147d3cb2de2SBard Liao #define RT5659_ASRC_2 0x0084 148d3cb2de2SBard Liao #define RT5659_ASRC_3 0x0085 149d3cb2de2SBard Liao #define RT5659_ASRC_4 0x0086 150d3cb2de2SBard Liao #define RT5659_ASRC_5 0x0087 151d3cb2de2SBard Liao #define RT5659_ASRC_6 0x0088 152d3cb2de2SBard Liao #define RT5659_ASRC_7 0x0089 153d3cb2de2SBard Liao #define RT5659_ASRC_8 0x008a 154d3cb2de2SBard Liao #define RT5659_ASRC_9 0x008b 155d3cb2de2SBard Liao #define RT5659_ASRC_10 0x008c 156d3cb2de2SBard Liao #define RT5659_DEPOP_1 0x008e 157d3cb2de2SBard Liao #define RT5659_DEPOP_2 0x008f 158d3cb2de2SBard Liao #define RT5659_DEPOP_3 0x0090 159d3cb2de2SBard Liao #define RT5659_HP_CHARGE_PUMP_1 0x0091 160d3cb2de2SBard Liao #define RT5659_HP_CHARGE_PUMP_2 0x0092 161d3cb2de2SBard Liao #define RT5659_MICBIAS_1 0x0093 162d3cb2de2SBard Liao #define RT5659_MICBIAS_2 0x0094 163d3cb2de2SBard Liao #define RT5659_ASRC_11 0x0097 164d3cb2de2SBard Liao #define RT5659_ASRC_12 0x0098 165d3cb2de2SBard Liao #define RT5659_ASRC_13 0x0099 166d3cb2de2SBard Liao #define RT5659_REC_M1_M2_GAIN_CTRL 0x009a 167d3cb2de2SBard Liao #define RT5659_CLASSD_CTRL_1 0x00a0 168d3cb2de2SBard Liao #define RT5659_CLASSD_CTRL_2 0x00a1 169d3cb2de2SBard Liao 170d3cb2de2SBard Liao /* Function - Digital */ 171d3cb2de2SBard Liao #define RT5659_ADC_EQ_CTRL_1 0x00ae 172d3cb2de2SBard Liao #define RT5659_ADC_EQ_CTRL_2 0x00af 173d3cb2de2SBard Liao #define RT5659_DAC_EQ_CTRL_1 0x00b0 174d3cb2de2SBard Liao #define RT5659_DAC_EQ_CTRL_2 0x00b1 175d3cb2de2SBard Liao #define RT5659_DAC_EQ_CTRL_3 0x00b2 176d3cb2de2SBard Liao 177d3cb2de2SBard Liao #define RT5659_IRQ_CTRL_1 0x00b6 178d3cb2de2SBard Liao #define RT5659_IRQ_CTRL_2 0x00b7 179d3cb2de2SBard Liao #define RT5659_IRQ_CTRL_3 0x00b8 1808cc12367SNicolin Chen #define RT5659_IRQ_CTRL_4 0x00ba 1818cc12367SNicolin Chen #define RT5659_IRQ_CTRL_5 0x00bb 1828cc12367SNicolin Chen #define RT5659_IRQ_CTRL_6 0x00bc 183d3cb2de2SBard Liao #define RT5659_INT_ST_1 0x00be 184d3cb2de2SBard Liao #define RT5659_INT_ST_2 0x00bf 185d3cb2de2SBard Liao #define RT5659_GPIO_CTRL_1 0x00c0 186d3cb2de2SBard Liao #define RT5659_GPIO_CTRL_2 0x00c1 187d3cb2de2SBard Liao #define RT5659_GPIO_CTRL_3 0x00c2 188d3cb2de2SBard Liao #define RT5659_GPIO_CTRL_4 0x00c3 189d3cb2de2SBard Liao #define RT5659_GPIO_CTRL_5 0x00c4 190d3cb2de2SBard Liao #define RT5659_GPIO_STA 0x00c5 191d3cb2de2SBard Liao #define RT5659_SINE_GEN_CTRL_1 0x00cb 192d3cb2de2SBard Liao #define RT5659_SINE_GEN_CTRL_2 0x00cc 193d3cb2de2SBard Liao #define RT5659_SINE_GEN_CTRL_3 0x00cd 194d3cb2de2SBard Liao #define RT5659_HP_AMP_DET_CTRL_1 0x00d6 195d3cb2de2SBard Liao #define RT5659_HP_AMP_DET_CTRL_2 0x00d7 196d3cb2de2SBard Liao #define RT5659_SV_ZCD_1 0x00d9 197d3cb2de2SBard Liao #define RT5659_SV_ZCD_2 0x00da 198d3cb2de2SBard Liao #define RT5659_IL_CMD_1 0x00db 199d3cb2de2SBard Liao #define RT5659_IL_CMD_2 0x00dc 200d3cb2de2SBard Liao #define RT5659_IL_CMD_3 0x00dd 201d3cb2de2SBard Liao #define RT5659_IL_CMD_4 0x00de 202d3cb2de2SBard Liao #define RT5659_4BTN_IL_CMD_1 0x00df 203d3cb2de2SBard Liao #define RT5659_4BTN_IL_CMD_2 0x00e0 204d3cb2de2SBard Liao #define RT5659_4BTN_IL_CMD_3 0x00e1 205d3cb2de2SBard Liao #define RT5659_PSV_IL_CMD_1 0x00e4 206d3cb2de2SBard Liao #define RT5659_PSV_IL_CMD_2 0x00e5 207d3cb2de2SBard Liao 208d3cb2de2SBard Liao #define RT5659_ADC_STO1_HP_CTRL_1 0x00ea 209d3cb2de2SBard Liao #define RT5659_ADC_STO1_HP_CTRL_2 0x00eb 210d3cb2de2SBard Liao #define RT5659_ADC_MONO_HP_CTRL_1 0x00ec 211d3cb2de2SBard Liao #define RT5659_ADC_MONO_HP_CTRL_2 0x00ed 212d3cb2de2SBard Liao #define RT5659_AJD1_CTRL 0x00f0 213d3cb2de2SBard Liao #define RT5659_AJD2_AJD3_CTRL 0x00f1 214d3cb2de2SBard Liao #define RT5659_JD1_THD 0x00f2 215d3cb2de2SBard Liao #define RT5659_JD2_THD 0x00f3 216d3cb2de2SBard Liao #define RT5659_JD3_THD 0x00f4 217d3cb2de2SBard Liao #define RT5659_JD_CTRL_1 0x00f6 218d3cb2de2SBard Liao #define RT5659_JD_CTRL_2 0x00f7 219d3cb2de2SBard Liao #define RT5659_JD_CTRL_3 0x00f8 220d3cb2de2SBard Liao #define RT5659_JD_CTRL_4 0x00f9 221d3cb2de2SBard Liao /* General Control */ 222d3cb2de2SBard Liao #define RT5659_DIG_MISC 0x00fa 223d3cb2de2SBard Liao #define RT5659_DUMMY_2 0x00fb 224d3cb2de2SBard Liao #define RT5659_DUMMY_3 0x00fc 225d3cb2de2SBard Liao 226d3cb2de2SBard Liao #define RT5659_DAC_ADC_DIG_VOL 0x0100 227d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_1 0x010a 228d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_2 0x010b 229d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_3 0x010c 230d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_4 0x010d 231d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_5 0x010e 232d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_6 0x010f 233d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_7 0x0110 234d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_8 0x0111 235d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_9 0x0112 236d3cb2de2SBard Liao #define RT5659_BIAS_CUR_CTRL_10 0x0113 237d3cb2de2SBard Liao #define RT5659_MEMORY_TEST 0x0116 238d3cb2de2SBard Liao #define RT5659_VREF_REC_OP_FB_CAP_CTRL 0x0117 239d3cb2de2SBard Liao #define RT5659_CLASSD_0 0x011a 240d3cb2de2SBard Liao #define RT5659_CLASSD_1 0x011b 241d3cb2de2SBard Liao #define RT5659_CLASSD_2 0x011c 242d3cb2de2SBard Liao #define RT5659_CLASSD_3 0x011d 243d3cb2de2SBard Liao #define RT5659_CLASSD_4 0x011e 244d3cb2de2SBard Liao #define RT5659_CLASSD_5 0x011f 245d3cb2de2SBard Liao #define RT5659_CLASSD_6 0x0120 246d3cb2de2SBard Liao #define RT5659_CLASSD_7 0x0121 247d3cb2de2SBard Liao #define RT5659_CLASSD_8 0x0122 248d3cb2de2SBard Liao #define RT5659_CLASSD_9 0x0123 249d3cb2de2SBard Liao #define RT5659_CLASSD_10 0x0124 250d3cb2de2SBard Liao #define RT5659_CHARGE_PUMP_1 0x0125 251d3cb2de2SBard Liao #define RT5659_CHARGE_PUMP_2 0x0126 252d3cb2de2SBard Liao #define RT5659_DIG_IN_CTRL_1 0x0132 253d3cb2de2SBard Liao #define RT5659_DIG_IN_CTRL_2 0x0133 254d3cb2de2SBard Liao #define RT5659_PAD_DRIVING_CTRL 0x0137 255d3cb2de2SBard Liao #define RT5659_SOFT_RAMP_DEPOP 0x0138 256d3cb2de2SBard Liao #define RT5659_PLL 0x0139 257d3cb2de2SBard Liao #define RT5659_CHOP_DAC 0x013a 258d3cb2de2SBard Liao #define RT5659_CHOP_ADC 0x013b 259d3cb2de2SBard Liao #define RT5659_CALIB_ADC_CTRL 0x013c 260d3cb2de2SBard Liao #define RT5659_SOFT_RAMP_DEPOP_DAC_CLK_CTRL 0x013e 261d3cb2de2SBard Liao #define RT5659_VOL_TEST 0x013f 262d3cb2de2SBard Liao #define RT5659_TEST_MODE_CTRL_1 0x0145 263d3cb2de2SBard Liao #define RT5659_TEST_MODE_CTRL_2 0x0146 264d3cb2de2SBard Liao #define RT5659_TEST_MODE_CTRL_3 0x0147 265d3cb2de2SBard Liao #define RT5659_TEST_MODE_CTRL_4 0x0148 266d3cb2de2SBard Liao #define RT5659_BASSBACK_CTRL 0x0150 267d3cb2de2SBard Liao #define RT5659_MP3_PLUS_CTRL_1 0x0151 268d3cb2de2SBard Liao #define RT5659_MP3_PLUS_CTRL_2 0x0152 269d3cb2de2SBard Liao #define RT5659_MP3_HPF_A1 0x0153 270d3cb2de2SBard Liao #define RT5659_MP3_HPF_A2 0x0154 271d3cb2de2SBard Liao #define RT5659_MP3_HPF_H0 0x0155 272d3cb2de2SBard Liao #define RT5659_MP3_LPF_H0 0x0156 273d3cb2de2SBard Liao #define RT5659_3D_SPK_CTRL 0x0157 274d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_1 0x0158 275d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_2 0x0159 276d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_3 0x015a 277d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_4 0x015b 278d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_5 0x015c 279d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_6 0x015d 280d3cb2de2SBard Liao #define RT5659_3D_SPK_COEF_7 0x015e 281d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_1 0x0160 282d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_2 0x0161 283d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_3 0x0162 284d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_4 0x0163 285d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_5 0x0164 286d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_6 0x0165 287d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_7 0x0166 288d3cb2de2SBard Liao #define RT5659_STO_NG2_CTRL_8 0x0167 289d3cb2de2SBard Liao #define RT5659_MONO_NG2_CTRL_1 0x0170 290d3cb2de2SBard Liao #define RT5659_MONO_NG2_CTRL_2 0x0171 291d3cb2de2SBard Liao #define RT5659_MONO_NG2_CTRL_3 0x0172 292d3cb2de2SBard Liao #define RT5659_MONO_NG2_CTRL_4 0x0173 293d3cb2de2SBard Liao #define RT5659_MONO_NG2_CTRL_5 0x0174 294d3cb2de2SBard Liao #define RT5659_MONO_NG2_CTRL_6 0x0175 295d3cb2de2SBard Liao #define RT5659_MID_HP_AMP_DET 0x0190 296d3cb2de2SBard Liao #define RT5659_LOW_HP_AMP_DET 0x0191 297d3cb2de2SBard Liao #define RT5659_LDO_CTRL 0x0192 298d3cb2de2SBard Liao #define RT5659_HP_DECROSS_CTRL_1 0x01b0 299d3cb2de2SBard Liao #define RT5659_HP_DECROSS_CTRL_2 0x01b1 300d3cb2de2SBard Liao #define RT5659_HP_DECROSS_CTRL_3 0x01b2 301d3cb2de2SBard Liao #define RT5659_HP_DECROSS_CTRL_4 0x01b3 302d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_CTRL_1 0x01c0 303d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_CTRL_2 0x01c1 304d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_CTRL_3 0x01c2 305d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_CTRL_4 0x01c3 306d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_1 0x01c7 307d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_2 0x01c8 308d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_3 0x01c9 309d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_4 0x01ca 310d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_5 0x01cb 311d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_6 0x01cc 312d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_7 0x01cd 313d3cb2de2SBard Liao #define RT5659_HP_IMP_SENS_MAP_8 0x01ce 314d3cb2de2SBard Liao #define RT5659_HP_LOGIC_CTRL_1 0x01da 315d3cb2de2SBard Liao #define RT5659_HP_LOGIC_CTRL_2 0x01db 316d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_1 0x01de 317d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_2 0x01df 318d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_3 0x01e0 319d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_4 0x01e1 320d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_5 0x01e2 321d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_6 0x01e3 322d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_7 0x01e4 323d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_9 0x01e6 324d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_10 0x01e7 325d3cb2de2SBard Liao #define RT5659_HP_CALIB_CTRL_11 0x01e8 326d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_1 0x01ea 327d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_2 0x01eb 328d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_3 0x01ec 329d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_4 0x01ed 330d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_5 0x01ee 331d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_6 0x01ef 332d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_7 0x01f0 333d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_8 0x01f1 334d3cb2de2SBard Liao #define RT5659_HP_CALIB_STA_9 0x01f2 335d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_CTRL_1 0x01f6 336d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_CTRL_2 0x01f7 337d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_CTRL_3 0x01f8 338d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_CTRL_4 0x01f9 339d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_CTRL_5 0x01fa 340d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_STA_1 0x01fb 341d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_STA_2 0x01fc 342d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_STA_3 0x01fd 343d3cb2de2SBard Liao #define RT5659_MONO_AMP_CALIB_STA_4 0x01fe 344d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_CTRL_1 0x0200 345d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_CTRL_2 0x0201 346d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_CTRL_3 0x0202 347d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_STA_1 0x0203 348d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_STA_2 0x0204 349d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_STA_3 0x0205 350d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_STA_4 0x0206 351d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_STA_5 0x0207 352d3cb2de2SBard Liao #define RT5659_SPK_PWR_LMT_STA_6 0x0208 353d3cb2de2SBard Liao #define RT5659_FLEX_SPK_BST_CTRL_1 0x0256 354d3cb2de2SBard Liao #define RT5659_FLEX_SPK_BST_CTRL_2 0x0257 355d3cb2de2SBard Liao #define RT5659_FLEX_SPK_BST_CTRL_3 0x0258 356d3cb2de2SBard Liao #define RT5659_FLEX_SPK_BST_CTRL_4 0x0259 357d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_1 0x025a 358d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_2 0x025b 359d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_3 0x025c 360d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_4 0x025d 361d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_5 0x025e 362d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_6 0x025f 363d3cb2de2SBard Liao #define RT5659_SPK_EX_LMT_CTRL_7 0x0260 364d3cb2de2SBard Liao #define RT5659_ADJ_HPF_CTRL_1 0x0261 365d3cb2de2SBard Liao #define RT5659_ADJ_HPF_CTRL_2 0x0262 366d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_CTRL_1 0x0265 367d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_CTRL_2 0x0266 368d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_CTRL_3 0x0267 369d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_CTRL_4 0x0268 370d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_CTRL_5 0x0269 371d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_1 0x026a 372d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_2 0x026b 373d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_3 0x026c 374d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_4 0x026d 375d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_5 0x026e 376d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_6 0x026f 377d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_7 0x0270 378d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_8 0x0271 379d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_9 0x0272 380d3cb2de2SBard Liao #define RT5659_SPK_DC_CAILB_STA_10 0x0273 381d3cb2de2SBard Liao #define RT5659_SPK_VDD_STA_1 0x0280 382d3cb2de2SBard Liao #define RT5659_SPK_VDD_STA_2 0x0281 383d3cb2de2SBard Liao #define RT5659_SPK_DC_DET_CTRL_1 0x0282 384d3cb2de2SBard Liao #define RT5659_SPK_DC_DET_CTRL_2 0x0283 385d3cb2de2SBard Liao #define RT5659_SPK_DC_DET_CTRL_3 0x0284 386d3cb2de2SBard Liao #define RT5659_PURE_DC_DET_CTRL_1 0x0290 387d3cb2de2SBard Liao #define RT5659_PURE_DC_DET_CTRL_2 0x0291 388d3cb2de2SBard Liao #define RT5659_DUMMY_4 0x02fa 389d3cb2de2SBard Liao #define RT5659_DUMMY_5 0x02fb 390d3cb2de2SBard Liao #define RT5659_DUMMY_6 0x02fc 391d3cb2de2SBard Liao #define RT5659_DRC1_CTRL_1 0x0300 392d3cb2de2SBard Liao #define RT5659_DRC1_CTRL_2 0x0301 393d3cb2de2SBard Liao #define RT5659_DRC1_CTRL_3 0x0302 394d3cb2de2SBard Liao #define RT5659_DRC1_CTRL_4 0x0303 395d3cb2de2SBard Liao #define RT5659_DRC1_CTRL_5 0x0304 396d3cb2de2SBard Liao #define RT5659_DRC1_CTRL_6 0x0305 397d3cb2de2SBard Liao #define RT5659_DRC1_HARD_LMT_CTRL_1 0x0306 398d3cb2de2SBard Liao #define RT5659_DRC1_HARD_LMT_CTRL_2 0x0307 399d3cb2de2SBard Liao #define RT5659_DRC2_CTRL_1 0x0308 400d3cb2de2SBard Liao #define RT5659_DRC2_CTRL_2 0x0309 401d3cb2de2SBard Liao #define RT5659_DRC2_CTRL_3 0x030a 402d3cb2de2SBard Liao #define RT5659_DRC2_CTRL_4 0x030b 403d3cb2de2SBard Liao #define RT5659_DRC2_CTRL_5 0x030c 404d3cb2de2SBard Liao #define RT5659_DRC2_CTRL_6 0x030d 405d3cb2de2SBard Liao #define RT5659_DRC2_HARD_LMT_CTRL_1 0x030e 406d3cb2de2SBard Liao #define RT5659_DRC2_HARD_LMT_CTRL_2 0x030f 407d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_1 0x0310 408d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_2 0x0311 409d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_3 0x0312 410d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_4 0x0313 411d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_5 0x0314 412d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_6 0x0315 413d3cb2de2SBard Liao #define RT5659_DRC1_PRIV_7 0x0316 414d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_1 0x0317 415d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_2 0x0318 416d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_3 0x0319 417d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_4 0x031a 418d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_5 0x031b 419d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_6 0x031c 420d3cb2de2SBard Liao #define RT5659_DRC2_PRIV_7 0x031d 421d3cb2de2SBard Liao #define RT5659_MULTI_DRC_CTRL 0x0320 422d3cb2de2SBard Liao #define RT5659_CROSS_OVER_1 0x0321 423d3cb2de2SBard Liao #define RT5659_CROSS_OVER_2 0x0322 424d3cb2de2SBard Liao #define RT5659_CROSS_OVER_3 0x0323 425d3cb2de2SBard Liao #define RT5659_CROSS_OVER_4 0x0324 426d3cb2de2SBard Liao #define RT5659_CROSS_OVER_5 0x0325 427d3cb2de2SBard Liao #define RT5659_CROSS_OVER_6 0x0326 428d3cb2de2SBard Liao #define RT5659_CROSS_OVER_7 0x0327 429d3cb2de2SBard Liao #define RT5659_CROSS_OVER_8 0x0328 430d3cb2de2SBard Liao #define RT5659_CROSS_OVER_9 0x0329 431d3cb2de2SBard Liao #define RT5659_CROSS_OVER_10 0x032a 432d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_1 0x0330 433d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_2 0x0331 434d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_3 0x0332 435d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_4 0x0333 436d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_5 0x0334 437d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_6 0x0335 438d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_7 0x0336 439d3cb2de2SBard Liao #define RT5659_ALC_PGA_CTRL_8 0x0337 440d3cb2de2SBard Liao #define RT5659_ALC_PGA_STA_1 0x0338 441d3cb2de2SBard Liao #define RT5659_ALC_PGA_STA_2 0x0339 442d3cb2de2SBard Liao #define RT5659_ALC_PGA_STA_3 0x033a 443d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_PRE_VOL 0x0340 444d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_PRE_VOL 0x0341 445d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_POST_VOL 0x0342 446d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_POST_VOL 0x0343 447d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_LPF1_A1 0x0344 448d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_LPF1_H0 0x0345 449d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_LPF1_A1 0x0346 450d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_LPF1_H0 0x0347 451d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF2_A1 0x0348 452d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF2_A2 0x0349 453d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF2_H0 0x034a 454d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF2_A1 0x034b 455d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF2_A2 0x034c 456d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF2_H0 0x034d 457d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF3_A1 0x034e 458d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF3_A2 0x034f 459d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF3_H0 0x0350 460d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF3_A1 0x0351 461d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF3_A2 0x0352 462d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF3_H0 0x0353 463d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF4_A1 0x0354 464d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF4_A2 0x0355 465d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_BPF4_H0 0x0356 466d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF4_A1 0x0357 467d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF4_A2 0x0358 468d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_BPF4_H0 0x0359 469d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_HPF1_A1 0x035a 470d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_HPF1_H0 0x035b 471d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_HPF1_A1 0x035c 472d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_HPF1_H0 0x035d 473d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_HPF2_A1 0x035e 474d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_HPF2_A2 0x035f 475d3cb2de2SBard Liao #define RT5659_DAC_L_EQ_HPF2_H0 0x0360 476d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_HPF2_A1 0x0361 477d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_HPF2_A2 0x0362 478d3cb2de2SBard Liao #define RT5659_DAC_R_EQ_HPF2_H0 0x0363 479d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_H0_1 0x0364 480d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_H0_2 0x0365 481d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_B1_1 0x0366 482d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_B1_2 0x0367 483d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_B2_1 0x0368 484d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_B2_2 0x0369 485d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_A1_1 0x036a 486d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_A1_2 0x036b 487d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_A2_1 0x036c 488d3cb2de2SBard Liao #define RT5659_DAC_L_BI_EQ_BPF1_A2_2 0x036d 489d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_H0_1 0x036e 490d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_H0_2 0x036f 491d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_B1_1 0x0370 492d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_B1_2 0x0371 493d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_B2_1 0x0372 494d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_B2_2 0x0373 495d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_A1_1 0x0374 496d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_A1_2 0x0375 497d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_A2_1 0x0376 498d3cb2de2SBard Liao #define RT5659_DAC_R_BI_EQ_BPF1_A2_2 0x0377 499d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_LPF1_A1 0x03d0 500d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_LPF1_A1 0x03d1 501d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_LPF1_H0 0x03d2 502d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_LPF1_H0 0x03d3 503d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF1_A1 0x03d4 504d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF1_A1 0x03d5 505d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF1_A2 0x03d6 506d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF1_A2 0x03d7 507d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF1_H0 0x03d8 508d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF1_H0 0x03d9 509d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF2_A1 0x03da 510d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF2_A1 0x03db 511d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF2_A2 0x03dc 512d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF2_A2 0x03dd 513d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF2_H0 0x03de 514d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF2_H0 0x03df 515d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF3_A1 0x03e0 516d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF3_A1 0x03e1 517d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF3_A2 0x03e2 518d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF3_A2 0x03e3 519d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF3_H0 0x03e4 520d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF3_H0 0x03e5 521d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF4_A1 0x03e6 522d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF4_A1 0x03e7 523d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF4_A2 0x03e8 524d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF4_A2 0x03e9 525d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_BPF4_H0 0x03ea 526d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_BPF4_H0 0x03eb 527d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_HPF1_A1 0x03ec 528d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_HPF1_A1 0x03ed 529d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_HPF1_H0 0x03ee 530d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_HPF1_H0 0x03ef 531d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_PRE_VOL 0x03f0 532d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_PRE_VOL 0x03f1 533d3cb2de2SBard Liao #define RT5659_ADC_L_EQ_POST_VOL 0x03f2 534d3cb2de2SBard Liao #define RT5659_ADC_R_EQ_POST_VOL 0x03f3 535d3cb2de2SBard Liao 536d3cb2de2SBard Liao 537d3cb2de2SBard Liao 538d3cb2de2SBard Liao /* global definition */ 539d3cb2de2SBard Liao #define RT5659_L_MUTE (0x1 << 15) 540d3cb2de2SBard Liao #define RT5659_L_MUTE_SFT 15 541d3cb2de2SBard Liao #define RT5659_VOL_L_MUTE (0x1 << 14) 542d3cb2de2SBard Liao #define RT5659_VOL_L_SFT 14 543d3cb2de2SBard Liao #define RT5659_R_MUTE (0x1 << 7) 544d3cb2de2SBard Liao #define RT5659_R_MUTE_SFT 7 545d3cb2de2SBard Liao #define RT5659_VOL_R_MUTE (0x1 << 6) 546d3cb2de2SBard Liao #define RT5659_VOL_R_SFT 6 547d3cb2de2SBard Liao #define RT5659_L_VOL_MASK (0x3f << 8) 548d3cb2de2SBard Liao #define RT5659_L_VOL_SFT 8 549d3cb2de2SBard Liao #define RT5659_R_VOL_MASK (0x3f) 550d3cb2de2SBard Liao #define RT5659_R_VOL_SFT 0 551d3cb2de2SBard Liao 552d3cb2de2SBard Liao /*Headphone Amp L/R Analog Gain and Digital NG2 Gain Control (0x0005 0x0006)*/ 553d3cb2de2SBard Liao #define RT5659_G_HP (0x1f << 8) 554d3cb2de2SBard Liao #define RT5659_G_HP_SFT 8 555d3cb2de2SBard Liao #define RT5659_G_STO_DA_DMIX (0x1f) 556d3cb2de2SBard Liao #define RT5659_G_STO_DA_SFT 0 557d3cb2de2SBard Liao 558d3cb2de2SBard Liao /* IN1/IN2 Control (0x000c) */ 559d3cb2de2SBard Liao #define RT5659_IN1_DF_MASK (0x1 << 15) 560d3cb2de2SBard Liao #define RT5659_IN1_DF 15 561d3cb2de2SBard Liao #define RT5659_BST1_MASK (0x7f << 8) 562d3cb2de2SBard Liao #define RT5659_BST1_SFT 8 563d3cb2de2SBard Liao #define RT5659_BST2_MASK (0x7f) 564d3cb2de2SBard Liao #define RT5659_BST2_SFT 0 565d3cb2de2SBard Liao 566d3cb2de2SBard Liao /* IN3/IN4 Control (0x000d) */ 567d3cb2de2SBard Liao #define RT5659_IN3_DF_MASK (0x1 << 15) 568d3cb2de2SBard Liao #define RT5659_IN3_DF 15 569d3cb2de2SBard Liao #define RT5659_BST3_MASK (0x7f << 8) 570d3cb2de2SBard Liao #define RT5659_BST3_SFT 8 571d3cb2de2SBard Liao #define RT5659_IN4_DF_MASK (0x1 << 7) 572d3cb2de2SBard Liao #define RT5659_IN4_DF 7 573d3cb2de2SBard Liao #define RT5659_BST4_MASK (0x7f) 574d3cb2de2SBard Liao #define RT5659_BST4_SFT 0 575d3cb2de2SBard Liao 576d3cb2de2SBard Liao /* INL and INR Volume Control (0x000f) */ 577d3cb2de2SBard Liao #define RT5659_INL_VOL_MASK (0x1f << 8) 578d3cb2de2SBard Liao #define RT5659_INL_VOL_SFT 8 579d3cb2de2SBard Liao #define RT5659_INR_VOL_MASK (0x1f) 580d3cb2de2SBard Liao #define RT5659_INR_VOL_SFT 0 581d3cb2de2SBard Liao 582d3cb2de2SBard Liao /* Embeeded Jack and Type Detection Control 1 (0x0010) */ 583d3cb2de2SBard Liao #define RT5659_EMB_JD_EN (0x1 << 15) 584d3cb2de2SBard Liao #define RT5659_EMB_JD_EN_SFT 15 585d3cb2de2SBard Liao #define RT5659_JD_MODE (0x1 << 13) 586d3cb2de2SBard Liao #define RT5659_JD_MODE_SFT 13 587d3cb2de2SBard Liao #define RT5659_EXT_JD_EN (0x1 << 11) 588d3cb2de2SBard Liao #define RT5659_EXT_JD_EN_SFT 11 589d3cb2de2SBard Liao #define RT5659_EXT_JD_DIG (0x1 << 9) 590d3cb2de2SBard Liao 591d3cb2de2SBard Liao /* Embeeded Jack and Type Detection Control 2 (0x0011) */ 592d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC (0x7 << 4) 593d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_SFT 4 594d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_GPIO_JD1 (0x0 << 4) 595d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_GPIO_JD2 (0x1 << 4) 596d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_JD1_1 (0x2 << 4) 597d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_JD1_2 (0x3 << 4) 598d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_JD2 (0x4 << 4) 599d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_JD3 (0x5 << 4) 600d3cb2de2SBard Liao #define RT5659_EXT_JD_SRC_MANUAL (0x6 << 4) 601d3cb2de2SBard Liao 602d3cb2de2SBard Liao /* Slience Detection Control (0x0015) */ 603d3cb2de2SBard Liao #define RT5659_SIL_DET_MASK (0x1 << 15) 604d3cb2de2SBard Liao #define RT5659_SIL_DET_DIS (0x0 << 15) 605d3cb2de2SBard Liao #define RT5659_SIL_DET_EN (0x1 << 15) 606d3cb2de2SBard Liao 607d3cb2de2SBard Liao /* Sidetone Control (0x0018) */ 608d3cb2de2SBard Liao #define RT5659_ST_SEL_MASK (0x7 << 9) 609d3cb2de2SBard Liao #define RT5659_ST_SEL_SFT 9 610d3cb2de2SBard Liao #define RT5659_ST_EN (0x1 << 6) 611d3cb2de2SBard Liao #define RT5659_ST_EN_SFT 6 612d3cb2de2SBard Liao 613d3cb2de2SBard Liao /* DAC1 Digital Volume (0x0019) */ 614d3cb2de2SBard Liao #define RT5659_DAC_L1_VOL_MASK (0xff << 8) 615d3cb2de2SBard Liao #define RT5659_DAC_L1_VOL_SFT 8 616d3cb2de2SBard Liao #define RT5659_DAC_R1_VOL_MASK (0xff) 617d3cb2de2SBard Liao #define RT5659_DAC_R1_VOL_SFT 0 618d3cb2de2SBard Liao 619d3cb2de2SBard Liao /* DAC2 Digital Volume (0x001a) */ 620d3cb2de2SBard Liao #define RT5659_DAC_L2_VOL_MASK (0xff << 8) 621d3cb2de2SBard Liao #define RT5659_DAC_L2_VOL_SFT 8 622d3cb2de2SBard Liao #define RT5659_DAC_R2_VOL_MASK (0xff) 623d3cb2de2SBard Liao #define RT5659_DAC_R2_VOL_SFT 0 624d3cb2de2SBard Liao 625d3cb2de2SBard Liao /* DAC2 Control (0x001b) */ 626d3cb2de2SBard Liao #define RT5659_M_DAC2_L_VOL (0x1 << 13) 627d3cb2de2SBard Liao #define RT5659_M_DAC2_L_VOL_SFT 13 628d3cb2de2SBard Liao #define RT5659_M_DAC2_R_VOL (0x1 << 12) 629d3cb2de2SBard Liao #define RT5659_M_DAC2_R_VOL_SFT 12 630d3cb2de2SBard Liao #define RT5659_DAC_L2_SEL_MASK (0x7 << 4) 631d3cb2de2SBard Liao #define RT5659_DAC_L2_SEL_SFT 4 632d3cb2de2SBard Liao #define RT5659_DAC_R2_SEL_MASK (0x7 << 0) 633d3cb2de2SBard Liao #define RT5659_DAC_R2_SEL_SFT 0 634d3cb2de2SBard Liao 635d3cb2de2SBard Liao /* ADC Digital Volume Control (0x001c) */ 636d3cb2de2SBard Liao #define RT5659_ADC_L_VOL_MASK (0x7f << 8) 637d3cb2de2SBard Liao #define RT5659_ADC_L_VOL_SFT 8 638d3cb2de2SBard Liao #define RT5659_ADC_R_VOL_MASK (0x7f) 639d3cb2de2SBard Liao #define RT5659_ADC_R_VOL_SFT 0 640d3cb2de2SBard Liao 641d3cb2de2SBard Liao /* Mono ADC Digital Volume Control (0x001d) */ 642d3cb2de2SBard Liao #define RT5659_MONO_ADC_L_VOL_MASK (0x7f << 8) 643d3cb2de2SBard Liao #define RT5659_MONO_ADC_L_VOL_SFT 8 644d3cb2de2SBard Liao #define RT5659_MONO_ADC_R_VOL_MASK (0x7f) 645d3cb2de2SBard Liao #define RT5659_MONO_ADC_R_VOL_SFT 0 646d3cb2de2SBard Liao 647d3cb2de2SBard Liao /* Stereo1 ADC Boost Gain Control (0x001f) */ 648d3cb2de2SBard Liao #define RT5659_STO1_ADC_L_BST_MASK (0x3 << 14) 649d3cb2de2SBard Liao #define RT5659_STO1_ADC_L_BST_SFT 14 650d3cb2de2SBard Liao #define RT5659_STO1_ADC_R_BST_MASK (0x3 << 12) 651d3cb2de2SBard Liao #define RT5659_STO1_ADC_R_BST_SFT 12 652d3cb2de2SBard Liao 653d3cb2de2SBard Liao /* Mono ADC Boost Gain Control (0x0020) */ 654d3cb2de2SBard Liao #define RT5659_MONO_ADC_L_BST_MASK (0x3 << 14) 655d3cb2de2SBard Liao #define RT5659_MONO_ADC_L_BST_SFT 14 656d3cb2de2SBard Liao #define RT5659_MONO_ADC_R_BST_MASK (0x3 << 12) 657d3cb2de2SBard Liao #define RT5659_MONO_ADC_R_BST_SFT 12 658d3cb2de2SBard Liao 659d3cb2de2SBard Liao /* Stereo1 ADC Boost Gain Control (0x001f) */ 660d3cb2de2SBard Liao #define RT5659_STO2_ADC_L_BST_MASK (0x3 << 14) 661d3cb2de2SBard Liao #define RT5659_STO2_ADC_L_BST_SFT 14 662d3cb2de2SBard Liao #define RT5659_STO2_ADC_R_BST_MASK (0x3 << 12) 663d3cb2de2SBard Liao #define RT5659_STO2_ADC_R_BST_SFT 12 664d3cb2de2SBard Liao 665d3cb2de2SBard Liao /* Stereo ADC Mixer Control (0x0026) */ 666d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_L1 (0x1 << 15) 667d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_L1_SFT 15 668d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_L2 (0x1 << 14) 669d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_L2_SFT 14 670d3cb2de2SBard Liao #define RT5659_STO1_ADC1_SRC_MASK (0x1 << 13) 671d3cb2de2SBard Liao #define RT5659_STO1_ADC1_SRC_SFT 13 672d3cb2de2SBard Liao #define RT5659_STO1_ADC1_SRC_ADC (0x1 << 13) 673d3cb2de2SBard Liao #define RT5659_STO1_ADC1_SRC_DACMIX (0x0 << 13) 674d3cb2de2SBard Liao #define RT5659_STO1_ADC_SRC_MASK (0x1 << 12) 675d3cb2de2SBard Liao #define RT5659_STO1_ADC_SRC_SFT 12 676d3cb2de2SBard Liao #define RT5659_STO1_ADC_SRC_ADC1 (0x1 << 12) 677d3cb2de2SBard Liao #define RT5659_STO1_ADC_SRC_ADC2 (0x0 << 12) 678d3cb2de2SBard Liao #define RT5659_STO1_ADC2_SRC_MASK (0x1 << 11) 679d3cb2de2SBard Liao #define RT5659_STO1_ADC2_SRC_SFT 11 680d3cb2de2SBard Liao #define RT5659_STO1_DMIC_SRC_MASK (0x1 << 8) 681d3cb2de2SBard Liao #define RT5659_STO1_DMIC_SRC_SFT 8 682d3cb2de2SBard Liao #define RT5659_STO1_DMIC_SRC_DMIC2 (0x1 << 8) 683d3cb2de2SBard Liao #define RT5659_STO1_DMIC_SRC_DMIC1 (0x0 << 8) 684d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_R1 (0x1 << 6) 685d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_R1_SFT 6 686d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_R2 (0x1 << 5) 687d3cb2de2SBard Liao #define RT5659_M_STO1_ADC_R2_SFT 5 688d3cb2de2SBard Liao 689d3cb2de2SBard Liao /* Mono1 ADC Mixer control (0x0027) */ 690d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_L1 (0x1 << 15) 691d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_L1_SFT 15 692d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_L2 (0x1 << 14) 693d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_L2_SFT 14 694d3cb2de2SBard Liao #define RT5659_MONO_ADC_L2_SRC_MASK (0x1 << 12) 695d3cb2de2SBard Liao #define RT5659_MONO_ADC_L2_SRC_SFT 12 696d3cb2de2SBard Liao #define RT5659_MONO_ADC_L1_SRC_MASK (0x1 << 11) 697d3cb2de2SBard Liao #define RT5659_MONO_ADC_L1_SRC_SFT 11 698d3cb2de2SBard Liao #define RT5659_MONO_ADC_L_SRC_MASK (0x3 << 9) 699d3cb2de2SBard Liao #define RT5659_MONO_ADC_L_SRC_SFT 9 700d3cb2de2SBard Liao #define RT5659_MONO_DMIC_L_SRC_MASK (0x1 << 8) 701d3cb2de2SBard Liao #define RT5659_MONO_DMIC_L_SRC_SFT 8 702d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_R1 (0x1 << 7) 703d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_R1_SFT 7 704d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_R2 (0x1 << 6) 705d3cb2de2SBard Liao #define RT5659_M_MONO_ADC_R2_SFT 6 706d3cb2de2SBard Liao #define RT5659_STO2_ADC_SRC_MASK (0x1 << 5) 707d3cb2de2SBard Liao #define RT5659_STO2_ADC_SRC_SFT 5 708d3cb2de2SBard Liao #define RT5659_MONO_ADC_R2_SRC_MASK (0x1 << 4) 709d3cb2de2SBard Liao #define RT5659_MONO_ADC_R2_SRC_SFT 4 710d3cb2de2SBard Liao #define RT5659_MONO_ADC_R1_SRC_MASK (0x1 << 3) 711d3cb2de2SBard Liao #define RT5659_MONO_ADC_R1_SRC_SFT 3 712d3cb2de2SBard Liao #define RT5659_MONO_ADC_R_SRC_MASK (0x3 << 1) 713d3cb2de2SBard Liao #define RT5659_MONO_ADC_R_SRC_SFT 1 714d3cb2de2SBard Liao #define RT5659_MONO_DMIC_R_SRC_MASK 0x1 715d3cb2de2SBard Liao #define RT5659_MONO_DMIC_R_SRC_SFT 0 716d3cb2de2SBard Liao 717d3cb2de2SBard Liao /* ADC Mixer to DAC Mixer Control (0x0029) */ 718d3cb2de2SBard Liao #define RT5659_M_ADCMIX_L (0x1 << 15) 719d3cb2de2SBard Liao #define RT5659_M_ADCMIX_L_SFT 15 720d3cb2de2SBard Liao #define RT5659_M_DAC1_L (0x1 << 14) 721d3cb2de2SBard Liao #define RT5659_M_DAC1_L_SFT 14 722d3cb2de2SBard Liao #define RT5659_DAC1_R_SEL_MASK (0x3 << 10) 723d3cb2de2SBard Liao #define RT5659_DAC1_R_SEL_SFT 10 724d3cb2de2SBard Liao #define RT5659_DAC1_R_SEL_IF1 (0x0 << 10) 725d3cb2de2SBard Liao #define RT5659_DAC1_R_SEL_IF2 (0x1 << 10) 726d3cb2de2SBard Liao #define RT5659_DAC1_R_SEL_IF3 (0x2 << 10) 727d3cb2de2SBard Liao #define RT5659_DAC1_L_SEL_MASK (0x3 << 8) 728d3cb2de2SBard Liao #define RT5659_DAC1_L_SEL_SFT 8 729d3cb2de2SBard Liao #define RT5659_DAC1_L_SEL_IF1 (0x0 << 8) 730d3cb2de2SBard Liao #define RT5659_DAC1_L_SEL_IF2 (0x1 << 8) 731d3cb2de2SBard Liao #define RT5659_DAC1_L_SEL_IF3 (0x2 << 8) 732d3cb2de2SBard Liao #define RT5659_M_ADCMIX_R (0x1 << 7) 733d3cb2de2SBard Liao #define RT5659_M_ADCMIX_R_SFT 7 734d3cb2de2SBard Liao #define RT5659_M_DAC1_R (0x1 << 6) 735d3cb2de2SBard Liao #define RT5659_M_DAC1_R_SFT 6 736d3cb2de2SBard Liao 737d3cb2de2SBard Liao /* Stereo DAC Mixer Control (0x002a) */ 738d3cb2de2SBard Liao #define RT5659_M_DAC_L1_STO_L (0x1 << 15) 739d3cb2de2SBard Liao #define RT5659_M_DAC_L1_STO_L_SFT 15 740d3cb2de2SBard Liao #define RT5659_G_DAC_L1_STO_L_MASK (0x1 << 14) 741d3cb2de2SBard Liao #define RT5659_G_DAC_L1_STO_L_SFT 14 742d3cb2de2SBard Liao #define RT5659_M_DAC_R1_STO_L (0x1 << 13) 743d3cb2de2SBard Liao #define RT5659_M_DAC_R1_STO_L_SFT 13 744d3cb2de2SBard Liao #define RT5659_G_DAC_R1_STO_L_MASK (0x1 << 12) 745d3cb2de2SBard Liao #define RT5659_G_DAC_R1_STO_L_SFT 12 746d3cb2de2SBard Liao #define RT5659_M_DAC_L2_STO_L (0x1 << 11) 747d3cb2de2SBard Liao #define RT5659_M_DAC_L2_STO_L_SFT 11 748d3cb2de2SBard Liao #define RT5659_G_DAC_L2_STO_L_MASK (0x1 << 10) 749d3cb2de2SBard Liao #define RT5659_G_DAC_L2_STO_L_SFT 10 750d3cb2de2SBard Liao #define RT5659_M_DAC_R2_STO_L (0x1 << 9) 751d3cb2de2SBard Liao #define RT5659_M_DAC_R2_STO_L_SFT 9 752d3cb2de2SBard Liao #define RT5659_G_DAC_R2_STO_L_MASK (0x1 << 8) 753d3cb2de2SBard Liao #define RT5659_G_DAC_R2_STO_L_SFT 8 754d3cb2de2SBard Liao #define RT5659_M_DAC_L1_STO_R (0x1 << 7) 755d3cb2de2SBard Liao #define RT5659_M_DAC_L1_STO_R_SFT 7 756d3cb2de2SBard Liao #define RT5659_G_DAC_L1_STO_R_MASK (0x1 << 6) 757d3cb2de2SBard Liao #define RT5659_G_DAC_L1_STO_R_SFT 6 758d3cb2de2SBard Liao #define RT5659_M_DAC_R1_STO_R (0x1 << 5) 759d3cb2de2SBard Liao #define RT5659_M_DAC_R1_STO_R_SFT 5 760d3cb2de2SBard Liao #define RT5659_G_DAC_R1_STO_R_MASK (0x1 << 4) 761d3cb2de2SBard Liao #define RT5659_G_DAC_R1_STO_R_SFT 4 762d3cb2de2SBard Liao #define RT5659_M_DAC_L2_STO_R (0x1 << 3) 763d3cb2de2SBard Liao #define RT5659_M_DAC_L2_STO_R_SFT 3 764d3cb2de2SBard Liao #define RT5659_G_DAC_L2_STO_R_MASK (0x1 << 2) 765d3cb2de2SBard Liao #define RT5659_G_DAC_L2_STO_R_SFT 2 766d3cb2de2SBard Liao #define RT5659_M_DAC_R2_STO_R (0x1 << 1) 767d3cb2de2SBard Liao #define RT5659_M_DAC_R2_STO_R_SFT 1 768d3cb2de2SBard Liao #define RT5659_G_DAC_R2_STO_R_MASK (0x1) 769d3cb2de2SBard Liao #define RT5659_G_DAC_R2_STO_R_SFT 0 770d3cb2de2SBard Liao 771d3cb2de2SBard Liao /* Mono DAC Mixer Control (0x002b) */ 772d3cb2de2SBard Liao #define RT5659_M_DAC_L1_MONO_L (0x1 << 15) 773d3cb2de2SBard Liao #define RT5659_M_DAC_L1_MONO_L_SFT 15 774d3cb2de2SBard Liao #define RT5659_G_DAC_L1_MONO_L_MASK (0x1 << 14) 775d3cb2de2SBard Liao #define RT5659_G_DAC_L1_MONO_L_SFT 14 776d3cb2de2SBard Liao #define RT5659_M_DAC_R1_MONO_L (0x1 << 13) 777d3cb2de2SBard Liao #define RT5659_M_DAC_R1_MONO_L_SFT 13 778d3cb2de2SBard Liao #define RT5659_G_DAC_R1_MONO_L_MASK (0x1 << 12) 779d3cb2de2SBard Liao #define RT5659_G_DAC_R1_MONO_L_SFT 12 780d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MONO_L (0x1 << 11) 781d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MONO_L_SFT 11 782d3cb2de2SBard Liao #define RT5659_G_DAC_L2_MONO_L_MASK (0x1 << 10) 783d3cb2de2SBard Liao #define RT5659_G_DAC_L2_MONO_L_SFT 10 784d3cb2de2SBard Liao #define RT5659_M_DAC_R2_MONO_L (0x1 << 9) 785d3cb2de2SBard Liao #define RT5659_M_DAC_R2_MONO_L_SFT 9 786d3cb2de2SBard Liao #define RT5659_G_DAC_R2_MONO_L_MASK (0x1 << 8) 787d3cb2de2SBard Liao #define RT5659_G_DAC_R2_MONO_L_SFT 8 788d3cb2de2SBard Liao #define RT5659_M_DAC_L1_MONO_R (0x1 << 7) 789d3cb2de2SBard Liao #define RT5659_M_DAC_L1_MONO_R_SFT 7 790d3cb2de2SBard Liao #define RT5659_G_DAC_L1_MONO_R_MASK (0x1 << 6) 791d3cb2de2SBard Liao #define RT5659_G_DAC_L1_MONO_R_SFT 6 792d3cb2de2SBard Liao #define RT5659_M_DAC_R1_MONO_R (0x1 << 5) 793d3cb2de2SBard Liao #define RT5659_M_DAC_R1_MONO_R_SFT 5 794d3cb2de2SBard Liao #define RT5659_G_DAC_R1_MONO_R_MASK (0x1 << 4) 795d3cb2de2SBard Liao #define RT5659_G_DAC_R1_MONO_R_SFT 4 796d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MONO_R (0x1 << 3) 797d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MONO_R_SFT 3 798d3cb2de2SBard Liao #define RT5659_G_DAC_L2_MONO_R_MASK (0x1 << 2) 799d3cb2de2SBard Liao #define RT5659_G_DAC_L2_MONO_R_SFT 2 800d3cb2de2SBard Liao #define RT5659_M_DAC_R2_MONO_R (0x1 << 1) 801d3cb2de2SBard Liao #define RT5659_M_DAC_R2_MONO_R_SFT 1 802d3cb2de2SBard Liao #define RT5659_G_DAC_R2_MONO_R_MASK (0x1) 803d3cb2de2SBard Liao #define RT5659_G_DAC_R2_MONO_R_SFT 0 804d3cb2de2SBard Liao 805d3cb2de2SBard Liao /* Digital Mixer Control (0x002c) */ 806d3cb2de2SBard Liao #define RT5659_M_DAC_MIX_L (0x1 << 7) 807d3cb2de2SBard Liao #define RT5659_M_DAC_MIX_L_SFT 7 808d3cb2de2SBard Liao #define RT5659_DAC_MIX_L_MASK (0x1 << 6) 809d3cb2de2SBard Liao #define RT5659_DAC_MIX_L_SFT 6 810d3cb2de2SBard Liao #define RT5659_M_DAC_MIX_R (0x1 << 5) 811d3cb2de2SBard Liao #define RT5659_M_DAC_MIX_R_SFT 5 812d3cb2de2SBard Liao #define RT5659_DAC_MIX_R_MASK (0x1 << 4) 813d3cb2de2SBard Liao #define RT5659_DAC_MIX_R_SFT 4 814d3cb2de2SBard Liao 815d3cb2de2SBard Liao /* Analog DAC Input Source Control (0x002d) */ 816d3cb2de2SBard Liao #define RT5659_A_DACL1_SEL (0x1 << 3) 817d3cb2de2SBard Liao #define RT5659_A_DACL1_SFT 3 818d3cb2de2SBard Liao #define RT5659_A_DACR1_SEL (0x1 << 2) 819d3cb2de2SBard Liao #define RT5659_A_DACR1_SFT 2 820d3cb2de2SBard Liao #define RT5659_A_DACL2_SEL (0x1 << 1) 821d3cb2de2SBard Liao #define RT5659_A_DACL2_SFT 1 822d3cb2de2SBard Liao #define RT5659_A_DACR2_SEL (0x1 << 0) 823d3cb2de2SBard Liao #define RT5659_A_DACR2_SFT 0 824d3cb2de2SBard Liao 825d3cb2de2SBard Liao /* Digital Interface Data Control (0x002f) */ 826d3cb2de2SBard Liao #define RT5659_IF2_ADC3_IN_MASK (0x3 << 14) 827d3cb2de2SBard Liao #define RT5659_IF2_ADC3_IN_SFT 14 828d3cb2de2SBard Liao #define RT5659_IF2_ADC_IN_MASK (0x3 << 12) 829d3cb2de2SBard Liao #define RT5659_IF2_ADC_IN_SFT 12 830d3cb2de2SBard Liao #define RT5659_IF2_DAC_SEL_MASK (0x3 << 10) 831d3cb2de2SBard Liao #define RT5659_IF2_DAC_SEL_SFT 10 832d3cb2de2SBard Liao #define RT5659_IF2_ADC_SEL_MASK (0x3 << 8) 833d3cb2de2SBard Liao #define RT5659_IF2_ADC_SEL_SFT 8 834d3cb2de2SBard Liao #define RT5659_IF3_DAC_SEL_MASK (0x3 << 6) 835d3cb2de2SBard Liao #define RT5659_IF3_DAC_SEL_SFT 6 836d3cb2de2SBard Liao #define RT5659_IF3_ADC_SEL_MASK (0x3 << 4) 837d3cb2de2SBard Liao #define RT5659_IF3_ADC_SEL_SFT 4 838d3cb2de2SBard Liao #define RT5659_IF3_ADC_IN_MASK (0x3 << 0) 839d3cb2de2SBard Liao #define RT5659_IF3_ADC_IN_SFT 0 840d3cb2de2SBard Liao 841d3cb2de2SBard Liao /* PDM Output Control (0x0031) */ 842d3cb2de2SBard Liao #define RT5659_PDM1_L_MASK (0x1 << 15) 843d3cb2de2SBard Liao #define RT5659_PDM1_L_SFT 15 844d3cb2de2SBard Liao #define RT5659_M_PDM1_L (0x1 << 14) 845d3cb2de2SBard Liao #define RT5659_M_PDM1_L_SFT 14 846d3cb2de2SBard Liao #define RT5659_PDM1_R_MASK (0x1 << 13) 847d3cb2de2SBard Liao #define RT5659_PDM1_R_SFT 13 848d3cb2de2SBard Liao #define RT5659_M_PDM1_R (0x1 << 12) 849d3cb2de2SBard Liao #define RT5659_M_PDM1_R_SFT 12 850d3cb2de2SBard Liao #define RT5659_PDM2_BUSY (0x1 << 7) 851d3cb2de2SBard Liao #define RT5659_PDM1_BUSY (0x1 << 6) 852d3cb2de2SBard Liao #define RT5659_PDM_PATTERN (0x1 << 5) 853d3cb2de2SBard Liao #define RT5659_PDM_GAIN (0x1 << 4) 854d3cb2de2SBard Liao #define RT5659_PDM_DIV_MASK (0x3) 855d3cb2de2SBard Liao 856d3cb2de2SBard Liao /*S/PDIF Output Control (0x0036) */ 857d3cb2de2SBard Liao #define RT5659_SPDIF_SEL_MASK (0x3 << 0) 858d3cb2de2SBard Liao #define RT5659_SPDIF_SEL_SFT 0 859d3cb2de2SBard Liao 860d3cb2de2SBard Liao /* REC Left Mixer Control 2 (0x003c) */ 861d3cb2de2SBard Liao #define RT5659_M_BST1_RM1_L (0x1 << 5) 862d3cb2de2SBard Liao #define RT5659_M_BST1_RM1_L_SFT 5 863d3cb2de2SBard Liao #define RT5659_M_BST2_RM1_L (0x1 << 4) 864d3cb2de2SBard Liao #define RT5659_M_BST2_RM1_L_SFT 4 865d3cb2de2SBard Liao #define RT5659_M_BST3_RM1_L (0x1 << 3) 866d3cb2de2SBard Liao #define RT5659_M_BST3_RM1_L_SFT 3 867d3cb2de2SBard Liao #define RT5659_M_BST4_RM1_L (0x1 << 2) 868d3cb2de2SBard Liao #define RT5659_M_BST4_RM1_L_SFT 2 869d3cb2de2SBard Liao #define RT5659_M_INL_RM1_L (0x1 << 1) 870d3cb2de2SBard Liao #define RT5659_M_INL_RM1_L_SFT 1 871d3cb2de2SBard Liao #define RT5659_M_SPKVOLL_RM1_L (0x1) 872d3cb2de2SBard Liao #define RT5659_M_SPKVOLL_RM1_L_SFT 0 873d3cb2de2SBard Liao 874d3cb2de2SBard Liao /* REC Right Mixer Control 2 (0x003e) */ 875d3cb2de2SBard Liao #define RT5659_M_BST1_RM1_R (0x1 << 5) 876d3cb2de2SBard Liao #define RT5659_M_BST1_RM1_R_SFT 5 877d3cb2de2SBard Liao #define RT5659_M_BST2_RM1_R (0x1 << 4) 878d3cb2de2SBard Liao #define RT5659_M_BST2_RM1_R_SFT 4 879d3cb2de2SBard Liao #define RT5659_M_BST3_RM1_R (0x1 << 3) 880d3cb2de2SBard Liao #define RT5659_M_BST3_RM1_R_SFT 3 881d3cb2de2SBard Liao #define RT5659_M_BST4_RM1_R (0x1 << 2) 882d3cb2de2SBard Liao #define RT5659_M_BST4_RM1_R_SFT 2 883d3cb2de2SBard Liao #define RT5659_M_INR_RM1_R (0x1 << 1) 884d3cb2de2SBard Liao #define RT5659_M_INR_RM1_R_SFT 1 885d3cb2de2SBard Liao #define RT5659_M_HPOVOLR_RM1_R (0x1) 886d3cb2de2SBard Liao #define RT5659_M_HPOVOLR_RM1_R_SFT 0 887d3cb2de2SBard Liao 888d3cb2de2SBard Liao /* SPK Left Mixer Control (0x0046) */ 889d3cb2de2SBard Liao #define RT5659_M_BST3_SM_L (0x1 << 4) 890d3cb2de2SBard Liao #define RT5659_M_BST3_SM_L_SFT 4 891d3cb2de2SBard Liao #define RT5659_M_IN_R_SM_L (0x1 << 3) 892d3cb2de2SBard Liao #define RT5659_M_IN_R_SM_L_SFT 3 893d3cb2de2SBard Liao #define RT5659_M_IN_L_SM_L (0x1 << 2) 894d3cb2de2SBard Liao #define RT5659_M_IN_L_SM_L_SFT 2 895d3cb2de2SBard Liao #define RT5659_M_BST1_SM_L (0x1 << 1) 896d3cb2de2SBard Liao #define RT5659_M_BST1_SM_L_SFT 1 897d3cb2de2SBard Liao #define RT5659_M_DAC_L2_SM_L (0x1) 898d3cb2de2SBard Liao #define RT5659_M_DAC_L2_SM_L_SFT 0 899d3cb2de2SBard Liao 900d3cb2de2SBard Liao /* SPK Right Mixer Control (0x0047) */ 901d3cb2de2SBard Liao #define RT5659_M_BST3_SM_R (0x1 << 4) 902d3cb2de2SBard Liao #define RT5659_M_BST3_SM_R_SFT 4 903d3cb2de2SBard Liao #define RT5659_M_IN_R_SM_R (0x1 << 3) 904d3cb2de2SBard Liao #define RT5659_M_IN_R_SM_R_SFT 3 905d3cb2de2SBard Liao #define RT5659_M_IN_L_SM_R (0x1 << 2) 906d3cb2de2SBard Liao #define RT5659_M_IN_L_SM_R_SFT 2 907d3cb2de2SBard Liao #define RT5659_M_BST4_SM_R (0x1 << 1) 908d3cb2de2SBard Liao #define RT5659_M_BST4_SM_R_SFT 1 909d3cb2de2SBard Liao #define RT5659_M_DAC_R2_SM_R (0x1) 910d3cb2de2SBard Liao #define RT5659_M_DAC_R2_SM_R_SFT 0 911d3cb2de2SBard Liao 912d3cb2de2SBard Liao /* SPO Amp Input and Gain Control (0x0048) */ 913d3cb2de2SBard Liao #define RT5659_M_DAC_L2_SPKOMIX (0x1 << 13) 914d3cb2de2SBard Liao #define RT5659_M_DAC_L2_SPKOMIX_SFT 13 915d3cb2de2SBard Liao #define RT5659_M_SPKVOLL_SPKOMIX (0x1 << 12) 916d3cb2de2SBard Liao #define RT5659_M_SPKVOLL_SPKOMIX_SFT 12 917d3cb2de2SBard Liao #define RT5659_M_DAC_R2_SPKOMIX (0x1 << 9) 918d3cb2de2SBard Liao #define RT5659_M_DAC_R2_SPKOMIX_SFT 9 919d3cb2de2SBard Liao #define RT5659_M_SPKVOLR_SPKOMIX (0x1 << 8) 920d3cb2de2SBard Liao #define RT5659_M_SPKVOLR_SPKOMIX_SFT 8 921d3cb2de2SBard Liao 922d3cb2de2SBard Liao /* MONOMIX Input and Gain Control (0x004b) */ 923d3cb2de2SBard Liao #define RT5659_M_MONOVOL_MA (0x1 << 9) 924d3cb2de2SBard Liao #define RT5659_M_MONOVOL_MA_SFT 9 925d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MA (0x1 << 8) 926d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MA_SFT 8 927d3cb2de2SBard Liao #define RT5659_M_BST3_MM (0x1 << 4) 928d3cb2de2SBard Liao #define RT5659_M_BST3_MM_SFT 4 929d3cb2de2SBard Liao #define RT5659_M_BST2_MM (0x1 << 3) 930d3cb2de2SBard Liao #define RT5659_M_BST2_MM_SFT 3 931d3cb2de2SBard Liao #define RT5659_M_BST1_MM (0x1 << 2) 932d3cb2de2SBard Liao #define RT5659_M_BST1_MM_SFT 2 933d3cb2de2SBard Liao #define RT5659_M_DAC_R2_MM (0x1 << 1) 934d3cb2de2SBard Liao #define RT5659_M_DAC_R2_MM_SFT 1 935d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MM (0x1) 936d3cb2de2SBard Liao #define RT5659_M_DAC_L2_MM_SFT 0 937d3cb2de2SBard Liao 938d3cb2de2SBard Liao /* Output Left Mixer Control 1 (0x004d) */ 939d3cb2de2SBard Liao #define RT5659_G_BST3_OM_L_MASK (0x7 << 12) 940d3cb2de2SBard Liao #define RT5659_G_BST3_OM_L_SFT 12 941d3cb2de2SBard Liao #define RT5659_G_BST2_OM_L_MASK (0x7 << 9) 942d3cb2de2SBard Liao #define RT5659_G_BST2_OM_L_SFT 9 943d3cb2de2SBard Liao #define RT5659_G_BST1_OM_L_MASK (0x7 << 6) 944d3cb2de2SBard Liao #define RT5659_G_BST1_OM_L_SFT 6 945d3cb2de2SBard Liao #define RT5659_G_IN_L_OM_L_MASK (0x7 << 3) 946d3cb2de2SBard Liao #define RT5659_G_IN_L_OM_L_SFT 3 947d3cb2de2SBard Liao #define RT5659_G_DAC_L2_OM_L_MASK (0x7 << 0) 948d3cb2de2SBard Liao #define RT5659_G_DAC_L2_OM_L_SFT 0 949d3cb2de2SBard Liao 950d3cb2de2SBard Liao /* Output Left Mixer Input Control (0x004e) */ 951d3cb2de2SBard Liao #define RT5659_M_BST3_OM_L (0x1 << 4) 952d3cb2de2SBard Liao #define RT5659_M_BST3_OM_L_SFT 4 953d3cb2de2SBard Liao #define RT5659_M_BST2_OM_L (0x1 << 3) 954d3cb2de2SBard Liao #define RT5659_M_BST2_OM_L_SFT 3 955d3cb2de2SBard Liao #define RT5659_M_BST1_OM_L (0x1 << 2) 956d3cb2de2SBard Liao #define RT5659_M_BST1_OM_L_SFT 2 957d3cb2de2SBard Liao #define RT5659_M_IN_L_OM_L (0x1 << 1) 958d3cb2de2SBard Liao #define RT5659_M_IN_L_OM_L_SFT 1 959d3cb2de2SBard Liao #define RT5659_M_DAC_L2_OM_L (0x1) 960d3cb2de2SBard Liao #define RT5659_M_DAC_L2_OM_L_SFT 0 961d3cb2de2SBard Liao 962d3cb2de2SBard Liao /* Output Right Mixer Input Control (0x0050) */ 963d3cb2de2SBard Liao #define RT5659_M_BST4_OM_R (0x1 << 4) 964d3cb2de2SBard Liao #define RT5659_M_BST4_OM_R_SFT 4 965d3cb2de2SBard Liao #define RT5659_M_BST3_OM_R (0x1 << 3) 966d3cb2de2SBard Liao #define RT5659_M_BST3_OM_R_SFT 3 967d3cb2de2SBard Liao #define RT5659_M_BST2_OM_R (0x1 << 2) 968d3cb2de2SBard Liao #define RT5659_M_BST2_OM_R_SFT 2 969d3cb2de2SBard Liao #define RT5659_M_IN_R_OM_R (0x1 << 1) 970d3cb2de2SBard Liao #define RT5659_M_IN_R_OM_R_SFT 1 971d3cb2de2SBard Liao #define RT5659_M_DAC_R2_OM_R (0x1) 972d3cb2de2SBard Liao #define RT5659_M_DAC_R2_OM_R_SFT 0 973d3cb2de2SBard Liao 974d3cb2de2SBard Liao /* LOUT Mixer Control (0x0052) */ 975d3cb2de2SBard Liao #define RT5659_M_DAC_L2_LM (0x1 << 15) 976d3cb2de2SBard Liao #define RT5659_M_DAC_L2_LM_SFT 15 977d3cb2de2SBard Liao #define RT5659_M_DAC_R2_LM (0x1 << 14) 978d3cb2de2SBard Liao #define RT5659_M_DAC_R2_LM_SFT 14 979d3cb2de2SBard Liao #define RT5659_M_OV_L_LM (0x1 << 13) 980d3cb2de2SBard Liao #define RT5659_M_OV_L_LM_SFT 13 981d3cb2de2SBard Liao #define RT5659_M_OV_R_LM (0x1 << 12) 982d3cb2de2SBard Liao #define RT5659_M_OV_R_LM_SFT 12 983d3cb2de2SBard Liao 984d3cb2de2SBard Liao /* Power Management for Digital 1 (0x0061) */ 985d3cb2de2SBard Liao #define RT5659_PWR_I2S1 (0x1 << 15) 986d3cb2de2SBard Liao #define RT5659_PWR_I2S1_BIT 15 987d3cb2de2SBard Liao #define RT5659_PWR_I2S2 (0x1 << 14) 988d3cb2de2SBard Liao #define RT5659_PWR_I2S2_BIT 14 989d3cb2de2SBard Liao #define RT5659_PWR_I2S3 (0x1 << 13) 990d3cb2de2SBard Liao #define RT5659_PWR_I2S3_BIT 13 991d3cb2de2SBard Liao #define RT5659_PWR_SPDIF (0x1 << 12) 992d3cb2de2SBard Liao #define RT5659_PWR_SPDIF_BIT 12 993d3cb2de2SBard Liao #define RT5659_PWR_DAC_L1 (0x1 << 11) 994d3cb2de2SBard Liao #define RT5659_PWR_DAC_L1_BIT 11 995d3cb2de2SBard Liao #define RT5659_PWR_DAC_R1 (0x1 << 10) 996d3cb2de2SBard Liao #define RT5659_PWR_DAC_R1_BIT 10 997d3cb2de2SBard Liao #define RT5659_PWR_DAC_L2 (0x1 << 9) 998d3cb2de2SBard Liao #define RT5659_PWR_DAC_L2_BIT 9 999d3cb2de2SBard Liao #define RT5659_PWR_DAC_R2 (0x1 << 8) 1000d3cb2de2SBard Liao #define RT5659_PWR_DAC_R2_BIT 8 1001d3cb2de2SBard Liao #define RT5659_PWR_LDO (0x1 << 7) 1002d3cb2de2SBard Liao #define RT5659_PWR_LDO_BIT 7 1003d3cb2de2SBard Liao #define RT5659_PWR_ADC_L1 (0x1 << 4) 1004d3cb2de2SBard Liao #define RT5659_PWR_ADC_L1_BIT 4 1005d3cb2de2SBard Liao #define RT5659_PWR_ADC_R1 (0x1 << 3) 1006d3cb2de2SBard Liao #define RT5659_PWR_ADC_R1_BIT 3 1007d3cb2de2SBard Liao #define RT5659_PWR_ADC_L2 (0x1 << 2) 10089849ef55SBard Liao #define RT5659_PWR_ADC_L2_BIT 2 1009d3cb2de2SBard Liao #define RT5659_PWR_ADC_R2 (0x1 << 1) 1010d3cb2de2SBard Liao #define RT5659_PWR_ADC_R2_BIT 1 1011d3cb2de2SBard Liao #define RT5659_PWR_CLS_D (0x1) 1012d3cb2de2SBard Liao #define RT5659_PWR_CLS_D_BIT 0 1013d3cb2de2SBard Liao 1014d3cb2de2SBard Liao /* Power Management for Digital 2 (0x0062) */ 1015d3cb2de2SBard Liao #define RT5659_PWR_ADC_S1F (0x1 << 15) 1016d3cb2de2SBard Liao #define RT5659_PWR_ADC_S1F_BIT 15 1017d3cb2de2SBard Liao #define RT5659_PWR_ADC_S2F (0x1 << 14) 1018d3cb2de2SBard Liao #define RT5659_PWR_ADC_S2F_BIT 14 1019d3cb2de2SBard Liao #define RT5659_PWR_ADC_MF_L (0x1 << 13) 1020d3cb2de2SBard Liao #define RT5659_PWR_ADC_MF_L_BIT 13 1021d3cb2de2SBard Liao #define RT5659_PWR_ADC_MF_R (0x1 << 12) 1022d3cb2de2SBard Liao #define RT5659_PWR_ADC_MF_R_BIT 12 1023d3cb2de2SBard Liao #define RT5659_PWR_DAC_S1F (0x1 << 10) 1024d3cb2de2SBard Liao #define RT5659_PWR_DAC_S1F_BIT 10 1025d3cb2de2SBard Liao #define RT5659_PWR_DAC_MF_L (0x1 << 9) 1026d3cb2de2SBard Liao #define RT5659_PWR_DAC_MF_L_BIT 9 1027d3cb2de2SBard Liao #define RT5659_PWR_DAC_MF_R (0x1 << 8) 1028d3cb2de2SBard Liao #define RT5659_PWR_DAC_MF_R_BIT 8 1029d3cb2de2SBard Liao #define RT5659_PWR_PDM1 (0x1 << 7) 1030d3cb2de2SBard Liao #define RT5659_PWR_PDM1_BIT 7 1031d3cb2de2SBard Liao 1032d3cb2de2SBard Liao /* Power Management for Analog 1 (0x0063) */ 1033d3cb2de2SBard Liao #define RT5659_PWR_VREF1 (0x1 << 15) 1034d3cb2de2SBard Liao #define RT5659_PWR_VREF1_BIT 15 1035d3cb2de2SBard Liao #define RT5659_PWR_FV1 (0x1 << 14) 1036d3cb2de2SBard Liao #define RT5659_PWR_FV1_BIT 14 1037d3cb2de2SBard Liao #define RT5659_PWR_VREF2 (0x1 << 13) 1038d3cb2de2SBard Liao #define RT5659_PWR_VREF2_BIT 13 1039d3cb2de2SBard Liao #define RT5659_PWR_FV2 (0x1 << 12) 1040d3cb2de2SBard Liao #define RT5659_PWR_FV2_BIT 12 1041d3cb2de2SBard Liao #define RT5659_PWR_VREF3 (0x1 << 11) 1042d3cb2de2SBard Liao #define RT5659_PWR_VREF3_BIT 11 1043d3cb2de2SBard Liao #define RT5659_PWR_FV3 (0x1 << 10) 1044d3cb2de2SBard Liao #define RT5659_PWR_FV3_BIT 10 1045d3cb2de2SBard Liao #define RT5659_PWR_MB (0x1 << 9) 1046d3cb2de2SBard Liao #define RT5659_PWR_MB_BIT 9 1047d3cb2de2SBard Liao #define RT5659_PWR_LM (0x1 << 8) 1048d3cb2de2SBard Liao #define RT5659_PWR_LM_BIT 8 1049d3cb2de2SBard Liao #define RT5659_PWR_BG (0x1 << 7) 1050d3cb2de2SBard Liao #define RT5659_PWR_BG_BIT 7 1051d3cb2de2SBard Liao #define RT5659_PWR_MA (0x1 << 6) 1052d3cb2de2SBard Liao #define RT5659_PWR_MA_BIT 6 1053d3cb2de2SBard Liao #define RT5659_PWR_HA_L (0x1 << 5) 1054d3cb2de2SBard Liao #define RT5659_PWR_HA_L_BIT 5 1055d3cb2de2SBard Liao #define RT5659_PWR_HA_R (0x1 << 4) 1056d3cb2de2SBard Liao #define RT5659_PWR_HA_R_BIT 4 1057d3cb2de2SBard Liao 1058d3cb2de2SBard Liao /* Power Management for Analog 2 (0x0064) */ 1059d3cb2de2SBard Liao #define RT5659_PWR_BST1 (0x1 << 15) 1060d3cb2de2SBard Liao #define RT5659_PWR_BST1_BIT 15 1061d3cb2de2SBard Liao #define RT5659_PWR_BST2 (0x1 << 14) 1062d3cb2de2SBard Liao #define RT5659_PWR_BST2_BIT 14 1063d3cb2de2SBard Liao #define RT5659_PWR_BST3 (0x1 << 13) 1064d3cb2de2SBard Liao #define RT5659_PWR_BST3_BIT 13 1065d3cb2de2SBard Liao #define RT5659_PWR_BST4 (0x1 << 12) 1066d3cb2de2SBard Liao #define RT5659_PWR_BST4_BIT 12 1067d3cb2de2SBard Liao #define RT5659_PWR_MB1 (0x1 << 11) 1068d3cb2de2SBard Liao #define RT5659_PWR_MB1_BIT 11 1069d3cb2de2SBard Liao #define RT5659_PWR_MB2 (0x1 << 10) 1070d3cb2de2SBard Liao #define RT5659_PWR_MB2_BIT 10 1071d3cb2de2SBard Liao #define RT5659_PWR_MB3 (0x1 << 9) 1072d3cb2de2SBard Liao #define RT5659_PWR_MB3_BIT 9 1073d3cb2de2SBard Liao #define RT5659_PWR_BST1_P (0x1 << 6) 1074d3cb2de2SBard Liao #define RT5659_PWR_BST1_P_BIT 6 1075d3cb2de2SBard Liao #define RT5659_PWR_BST2_P (0x1 << 5) 1076d3cb2de2SBard Liao #define RT5659_PWR_BST2_P_BIT 5 1077d3cb2de2SBard Liao #define RT5659_PWR_BST3_P (0x1 << 4) 1078d3cb2de2SBard Liao #define RT5659_PWR_BST3_P_BIT 4 1079d3cb2de2SBard Liao #define RT5659_PWR_BST4_P (0x1 << 3) 1080d3cb2de2SBard Liao #define RT5659_PWR_BST4_P_BIT 3 1081d3cb2de2SBard Liao #define RT5659_PWR_JD1 (0x1 << 2) 1082d3cb2de2SBard Liao #define RT5659_PWR_JD1_BIT 2 1083d3cb2de2SBard Liao #define RT5659_PWR_JD2 (0x1 << 1) 1084d3cb2de2SBard Liao #define RT5659_PWR_JD2_BIT 1 1085d3cb2de2SBard Liao #define RT5659_PWR_JD3 (0x1) 1086d3cb2de2SBard Liao #define RT5659_PWR_JD3_BIT 0 1087d3cb2de2SBard Liao 1088d3cb2de2SBard Liao /* Power Management for Analog 3 (0x0065) */ 1089d3cb2de2SBard Liao #define RT5659_PWR_BST_L (0x1 << 8) 1090d3cb2de2SBard Liao #define RT5659_PWR_BST_L_BIT 8 1091d3cb2de2SBard Liao #define RT5659_PWR_BST_R (0x1 << 7) 1092d3cb2de2SBard Liao #define RT5659_PWR_BST_R_BIT 7 1093d3cb2de2SBard Liao #define RT5659_PWR_PLL (0x1 << 6) 1094d3cb2de2SBard Liao #define RT5659_PWR_PLL_BIT 6 1095d3cb2de2SBard Liao #define RT5659_PWR_LDO5 (0x1 << 5) 1096d3cb2de2SBard Liao #define RT5659_PWR_LDO5_BIT 5 1097d3cb2de2SBard Liao #define RT5659_PWR_LDO4 (0x1 << 4) 1098d3cb2de2SBard Liao #define RT5659_PWR_LDO4_BIT 4 1099d3cb2de2SBard Liao #define RT5659_PWR_LDO3 (0x1 << 3) 1100d3cb2de2SBard Liao #define RT5659_PWR_LDO3_BIT 3 1101d3cb2de2SBard Liao #define RT5659_PWR_LDO2 (0x1 << 2) 1102d3cb2de2SBard Liao #define RT5659_PWR_LDO2_BIT 2 1103d3cb2de2SBard Liao #define RT5659_PWR_SVD (0x1 << 1) 1104d3cb2de2SBard Liao #define RT5659_PWR_SVD_BIT 1 1105d3cb2de2SBard Liao 1106d3cb2de2SBard Liao /* Power Management for Mixer (0x0066) */ 1107d3cb2de2SBard Liao #define RT5659_PWR_OM_L (0x1 << 15) 1108d3cb2de2SBard Liao #define RT5659_PWR_OM_L_BIT 15 1109d3cb2de2SBard Liao #define RT5659_PWR_OM_R (0x1 << 14) 1110d3cb2de2SBard Liao #define RT5659_PWR_OM_R_BIT 14 1111d3cb2de2SBard Liao #define RT5659_PWR_SM_L (0x1 << 13) 1112d3cb2de2SBard Liao #define RT5659_PWR_SM_L_BIT 13 1113d3cb2de2SBard Liao #define RT5659_PWR_SM_R (0x1 << 12) 1114d3cb2de2SBard Liao #define RT5659_PWR_SM_R_BIT 12 1115d3cb2de2SBard Liao #define RT5659_PWR_RM1_L (0x1 << 11) 1116d3cb2de2SBard Liao #define RT5659_PWR_RM1_L_BIT 11 1117d3cb2de2SBard Liao #define RT5659_PWR_RM1_R (0x1 << 10) 1118d3cb2de2SBard Liao #define RT5659_PWR_RM1_R_BIT 10 1119d3cb2de2SBard Liao #define RT5659_PWR_MM (0x1 << 8) 1120d3cb2de2SBard Liao #define RT5659_PWR_MM_BIT 8 1121d3cb2de2SBard Liao #define RT5659_PWR_RM2_L (0x1 << 3) 1122d3cb2de2SBard Liao #define RT5659_PWR_RM2_L_BIT 3 1123d3cb2de2SBard Liao #define RT5659_PWR_RM2_R (0x1 << 2) 1124d3cb2de2SBard Liao #define RT5659_PWR_RM2_R_BIT 2 1125d3cb2de2SBard Liao 1126d3cb2de2SBard Liao /* Power Management for Volume (0x0067) */ 1127d3cb2de2SBard Liao #define RT5659_PWR_SV_L (0x1 << 15) 1128d3cb2de2SBard Liao #define RT5659_PWR_SV_L_BIT 15 1129d3cb2de2SBard Liao #define RT5659_PWR_SV_R (0x1 << 14) 1130d3cb2de2SBard Liao #define RT5659_PWR_SV_R_BIT 14 1131d3cb2de2SBard Liao #define RT5659_PWR_OV_L (0x1 << 13) 1132d3cb2de2SBard Liao #define RT5659_PWR_OV_L_BIT 13 1133d3cb2de2SBard Liao #define RT5659_PWR_OV_R (0x1 << 12) 1134d3cb2de2SBard Liao #define RT5659_PWR_OV_R_BIT 12 1135d3cb2de2SBard Liao #define RT5659_PWR_IN_L (0x1 << 9) 1136d3cb2de2SBard Liao #define RT5659_PWR_IN_L_BIT 9 1137d3cb2de2SBard Liao #define RT5659_PWR_IN_R (0x1 << 8) 1138d3cb2de2SBard Liao #define RT5659_PWR_IN_R_BIT 8 1139d3cb2de2SBard Liao #define RT5659_PWR_MV (0x1 << 7) 1140d3cb2de2SBard Liao #define RT5659_PWR_MV_BIT 7 1141d3cb2de2SBard Liao #define RT5659_PWR_MIC_DET (0x1 << 5) 1142d3cb2de2SBard Liao #define RT5659_PWR_MIC_DET_BIT 5 1143d3cb2de2SBard Liao 1144d3cb2de2SBard Liao /* I2S1/2/3 Audio Serial Data Port Control (0x0070 0x0071 0x0072) */ 1145d3cb2de2SBard Liao #define RT5659_I2S_MS_MASK (0x1 << 15) 1146d3cb2de2SBard Liao #define RT5659_I2S_MS_SFT 15 1147d3cb2de2SBard Liao #define RT5659_I2S_MS_M (0x0 << 15) 1148d3cb2de2SBard Liao #define RT5659_I2S_MS_S (0x1 << 15) 1149d3cb2de2SBard Liao #define RT5659_I2S_O_CP_MASK (0x3 << 12) 1150d3cb2de2SBard Liao #define RT5659_I2S_O_CP_SFT 12 1151d3cb2de2SBard Liao #define RT5659_I2S_O_CP_OFF (0x0 << 12) 1152d3cb2de2SBard Liao #define RT5659_I2S_O_CP_U_LAW (0x1 << 12) 1153d3cb2de2SBard Liao #define RT5659_I2S_O_CP_A_LAW (0x2 << 12) 1154d3cb2de2SBard Liao #define RT5659_I2S_I_CP_MASK (0x3 << 10) 1155d3cb2de2SBard Liao #define RT5659_I2S_I_CP_SFT 10 1156d3cb2de2SBard Liao #define RT5659_I2S_I_CP_OFF (0x0 << 10) 1157d3cb2de2SBard Liao #define RT5659_I2S_I_CP_U_LAW (0x1 << 10) 1158d3cb2de2SBard Liao #define RT5659_I2S_I_CP_A_LAW (0x2 << 10) 1159d3cb2de2SBard Liao #define RT5659_I2S_BP_MASK (0x1 << 8) 1160d3cb2de2SBard Liao #define RT5659_I2S_BP_SFT 8 1161d3cb2de2SBard Liao #define RT5659_I2S_BP_NOR (0x0 << 8) 1162d3cb2de2SBard Liao #define RT5659_I2S_BP_INV (0x1 << 8) 1163d3cb2de2SBard Liao #define RT5659_I2S_DL_MASK (0x3 << 4) 1164d3cb2de2SBard Liao #define RT5659_I2S_DL_SFT 4 1165d3cb2de2SBard Liao #define RT5659_I2S_DL_16 (0x0 << 4) 1166d3cb2de2SBard Liao #define RT5659_I2S_DL_20 (0x1 << 4) 1167d3cb2de2SBard Liao #define RT5659_I2S_DL_24 (0x2 << 4) 1168d3cb2de2SBard Liao #define RT5659_I2S_DL_8 (0x3 << 4) 1169d3cb2de2SBard Liao #define RT5659_I2S_DF_MASK (0x7) 1170d3cb2de2SBard Liao #define RT5659_I2S_DF_SFT 0 1171d3cb2de2SBard Liao #define RT5659_I2S_DF_I2S (0x0) 1172d3cb2de2SBard Liao #define RT5659_I2S_DF_LEFT (0x1) 1173d3cb2de2SBard Liao #define RT5659_I2S_DF_PCM_A (0x2) 1174d3cb2de2SBard Liao #define RT5659_I2S_DF_PCM_B (0x3) 1175d3cb2de2SBard Liao #define RT5659_I2S_DF_PCM_A_N (0x6) 1176d3cb2de2SBard Liao #define RT5659_I2S_DF_PCM_B_N (0x7) 1177d3cb2de2SBard Liao 1178d3cb2de2SBard Liao /* ADC/DAC Clock Control 1 (0x0073) */ 1179d3cb2de2SBard Liao #define RT5659_I2S_PD1_MASK (0x7 << 12) 1180d3cb2de2SBard Liao #define RT5659_I2S_PD1_SFT 12 1181d3cb2de2SBard Liao #define RT5659_I2S_PD1_1 (0x0 << 12) 1182d3cb2de2SBard Liao #define RT5659_I2S_PD1_2 (0x1 << 12) 1183d3cb2de2SBard Liao #define RT5659_I2S_PD1_3 (0x2 << 12) 1184d3cb2de2SBard Liao #define RT5659_I2S_PD1_4 (0x3 << 12) 1185d3cb2de2SBard Liao #define RT5659_I2S_PD1_6 (0x4 << 12) 1186d3cb2de2SBard Liao #define RT5659_I2S_PD1_8 (0x5 << 12) 1187d3cb2de2SBard Liao #define RT5659_I2S_PD1_12 (0x6 << 12) 1188d3cb2de2SBard Liao #define RT5659_I2S_PD1_16 (0x7 << 12) 1189d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS2_MASK (0x1 << 11) 1190d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS2_SFT 11 1191d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS2_32 (0x0 << 11) 1192d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS2_64 (0x1 << 11) 1193d3cb2de2SBard Liao #define RT5659_I2S_PD2_MASK (0x7 << 8) 1194d3cb2de2SBard Liao #define RT5659_I2S_PD2_SFT 8 1195d3cb2de2SBard Liao #define RT5659_I2S_PD2_1 (0x0 << 8) 1196d3cb2de2SBard Liao #define RT5659_I2S_PD2_2 (0x1 << 8) 1197d3cb2de2SBard Liao #define RT5659_I2S_PD2_3 (0x2 << 8) 1198d3cb2de2SBard Liao #define RT5659_I2S_PD2_4 (0x3 << 8) 1199d3cb2de2SBard Liao #define RT5659_I2S_PD2_6 (0x4 << 8) 1200d3cb2de2SBard Liao #define RT5659_I2S_PD2_8 (0x5 << 8) 1201d3cb2de2SBard Liao #define RT5659_I2S_PD2_12 (0x6 << 8) 1202d3cb2de2SBard Liao #define RT5659_I2S_PD2_16 (0x7 << 8) 1203d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS3_MASK (0x1 << 7) 1204d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS3_SFT 7 1205d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS3_32 (0x0 << 7) 1206d3cb2de2SBard Liao #define RT5659_I2S_BCLK_MS3_64 (0x1 << 7) 1207d3cb2de2SBard Liao #define RT5659_I2S_PD3_MASK (0x7 << 4) 1208d3cb2de2SBard Liao #define RT5659_I2S_PD3_SFT 4 1209d3cb2de2SBard Liao #define RT5659_I2S_PD3_1 (0x0 << 4) 1210d3cb2de2SBard Liao #define RT5659_I2S_PD3_2 (0x1 << 4) 1211d3cb2de2SBard Liao #define RT5659_I2S_PD3_3 (0x2 << 4) 1212d3cb2de2SBard Liao #define RT5659_I2S_PD3_4 (0x3 << 4) 1213d3cb2de2SBard Liao #define RT5659_I2S_PD3_6 (0x4 << 4) 1214d3cb2de2SBard Liao #define RT5659_I2S_PD3_8 (0x5 << 4) 1215d3cb2de2SBard Liao #define RT5659_I2S_PD3_12 (0x6 << 4) 1216d3cb2de2SBard Liao #define RT5659_I2S_PD3_16 (0x7 << 4) 1217d3cb2de2SBard Liao #define RT5659_DAC_OSR_MASK (0x3 << 2) 1218d3cb2de2SBard Liao #define RT5659_DAC_OSR_SFT 2 1219d3cb2de2SBard Liao #define RT5659_DAC_OSR_128 (0x0 << 2) 1220d3cb2de2SBard Liao #define RT5659_DAC_OSR_64 (0x1 << 2) 1221d3cb2de2SBard Liao #define RT5659_DAC_OSR_32 (0x2 << 2) 1222d3cb2de2SBard Liao #define RT5659_DAC_OSR_16 (0x3 << 2) 1223d3cb2de2SBard Liao #define RT5659_ADC_OSR_MASK (0x3) 1224d3cb2de2SBard Liao #define RT5659_ADC_OSR_SFT 0 1225d3cb2de2SBard Liao #define RT5659_ADC_OSR_128 (0x0) 1226d3cb2de2SBard Liao #define RT5659_ADC_OSR_64 (0x1) 1227d3cb2de2SBard Liao #define RT5659_ADC_OSR_32 (0x2) 1228d3cb2de2SBard Liao #define RT5659_ADC_OSR_16 (0x3) 1229d3cb2de2SBard Liao 1230d3cb2de2SBard Liao /* Digital Microphone Control (0x0075) */ 1231d3cb2de2SBard Liao #define RT5659_DMIC_1_EN_MASK (0x1 << 15) 1232d3cb2de2SBard Liao #define RT5659_DMIC_1_EN_SFT 15 1233d3cb2de2SBard Liao #define RT5659_DMIC_1_DIS (0x0 << 15) 1234d3cb2de2SBard Liao #define RT5659_DMIC_1_EN (0x1 << 15) 1235d3cb2de2SBard Liao #define RT5659_DMIC_2_EN_MASK (0x1 << 14) 1236d3cb2de2SBard Liao #define RT5659_DMIC_2_EN_SFT 14 1237d3cb2de2SBard Liao #define RT5659_DMIC_2_DIS (0x0 << 14) 1238d3cb2de2SBard Liao #define RT5659_DMIC_2_EN (0x1 << 14) 1239d3cb2de2SBard Liao #define RT5659_DMIC_1L_LH_MASK (0x1 << 13) 1240d3cb2de2SBard Liao #define RT5659_DMIC_1L_LH_SFT 13 1241d3cb2de2SBard Liao #define RT5659_DMIC_1L_LH_RISING (0x0 << 13) 1242d3cb2de2SBard Liao #define RT5659_DMIC_1L_LH_FALLING (0x1 << 13) 1243d3cb2de2SBard Liao #define RT5659_DMIC_1R_LH_MASK (0x1 << 12) 1244d3cb2de2SBard Liao #define RT5659_DMIC_1R_LH_SFT 12 1245d3cb2de2SBard Liao #define RT5659_DMIC_1R_LH_RISING (0x0 << 12) 1246d3cb2de2SBard Liao #define RT5659_DMIC_1R_LH_FALLING (0x1 << 12) 1247d3cb2de2SBard Liao #define RT5659_DMIC_2_DP_MASK (0x3 << 10) 1248d3cb2de2SBard Liao #define RT5659_DMIC_2_DP_SFT 10 1249d3cb2de2SBard Liao #define RT5659_DMIC_2_DP_GPIO6 (0x0 << 10) 1250d3cb2de2SBard Liao #define RT5659_DMIC_2_DP_GPIO10 (0x1 << 10) 1251d3cb2de2SBard Liao #define RT5659_DMIC_2_DP_GPIO12 (0x2 << 10) 1252d3cb2de2SBard Liao #define RT5659_DMIC_2_DP_IN2P (0x3 << 10) 1253d3cb2de2SBard Liao #define RT5659_DMIC_CLK_MASK (0x7 << 5) 1254d3cb2de2SBard Liao #define RT5659_DMIC_CLK_SFT 5 1255d3cb2de2SBard Liao #define RT5659_DMIC_1_DP_MASK (0x3 << 0) 1256d3cb2de2SBard Liao #define RT5659_DMIC_1_DP_SFT 0 1257d3cb2de2SBard Liao #define RT5659_DMIC_1_DP_GPIO5 (0x0 << 0) 1258d3cb2de2SBard Liao #define RT5659_DMIC_1_DP_GPIO9 (0x1 << 0) 1259d3cb2de2SBard Liao #define RT5659_DMIC_1_DP_GPIO11 (0x2 << 0) 1260d3cb2de2SBard Liao #define RT5659_DMIC_1_DP_IN2N (0x3 << 0) 1261d3cb2de2SBard Liao 1262d3cb2de2SBard Liao /* TDM control 1 (0x0078)*/ 1263d3cb2de2SBard Liao #define RT5659_DS_ADC_SLOT01_SFT 14 1264d3cb2de2SBard Liao #define RT5659_DS_ADC_SLOT23_SFT 12 1265d3cb2de2SBard Liao #define RT5659_DS_ADC_SLOT45_SFT 10 1266d3cb2de2SBard Liao #define RT5659_DS_ADC_SLOT67_SFT 8 1267d3cb2de2SBard Liao #define RT5659_ADCDAT_SRC_MASK 0x1f 1268d3cb2de2SBard Liao #define RT5659_ADCDAT_SRC_SFT 0 1269d3cb2de2SBard Liao 1270d3cb2de2SBard Liao /* Global Clock Control (0x0080) */ 1271d3cb2de2SBard Liao #define RT5659_SCLK_SRC_MASK (0x3 << 14) 1272d3cb2de2SBard Liao #define RT5659_SCLK_SRC_SFT 14 1273d3cb2de2SBard Liao #define RT5659_SCLK_SRC_MCLK (0x0 << 14) 1274d3cb2de2SBard Liao #define RT5659_SCLK_SRC_PLL1 (0x1 << 14) 1275d3cb2de2SBard Liao #define RT5659_SCLK_SRC_RCCLK (0x2 << 14) 1276d3cb2de2SBard Liao #define RT5659_PLL1_SRC_MASK (0x7 << 11) 1277d3cb2de2SBard Liao #define RT5659_PLL1_SRC_SFT 11 1278d3cb2de2SBard Liao #define RT5659_PLL1_SRC_MCLK (0x0 << 11) 1279d3cb2de2SBard Liao #define RT5659_PLL1_SRC_BCLK1 (0x1 << 11) 1280d3cb2de2SBard Liao #define RT5659_PLL1_SRC_BCLK2 (0x2 << 11) 1281d3cb2de2SBard Liao #define RT5659_PLL1_SRC_BCLK3 (0x3 << 11) 1282d3cb2de2SBard Liao #define RT5659_PLL1_PD_MASK (0x1 << 3) 1283d3cb2de2SBard Liao #define RT5659_PLL1_PD_SFT 3 1284d3cb2de2SBard Liao #define RT5659_PLL1_PD_1 (0x0 << 3) 1285d3cb2de2SBard Liao #define RT5659_PLL1_PD_2 (0x1 << 3) 1286d3cb2de2SBard Liao 1287d3cb2de2SBard Liao #define RT5659_PLL_INP_MAX 40000000 1288d3cb2de2SBard Liao #define RT5659_PLL_INP_MIN 256000 1289d3cb2de2SBard Liao /* PLL M/N/K Code Control 1 (0x0081) */ 1290d3cb2de2SBard Liao #define RT5659_PLL_N_MAX 0x001ff 1291d3cb2de2SBard Liao #define RT5659_PLL_N_MASK (RT5659_PLL_N_MAX << 7) 1292d3cb2de2SBard Liao #define RT5659_PLL_N_SFT 7 1293d3cb2de2SBard Liao #define RT5659_PLL_K_MAX 0x001f 1294d3cb2de2SBard Liao #define RT5659_PLL_K_MASK (RT5659_PLL_K_MAX) 1295d3cb2de2SBard Liao #define RT5659_PLL_K_SFT 0 1296d3cb2de2SBard Liao 1297d3cb2de2SBard Liao /* PLL M/N/K Code Control 2 (0x0082) */ 1298d3cb2de2SBard Liao #define RT5659_PLL_M_MAX 0x00f 1299d3cb2de2SBard Liao #define RT5659_PLL_M_MASK (RT5659_PLL_M_MAX << 12) 1300d3cb2de2SBard Liao #define RT5659_PLL_M_SFT 12 1301d3cb2de2SBard Liao #define RT5659_PLL_M_BP (0x1 << 11) 1302d3cb2de2SBard Liao #define RT5659_PLL_M_BP_SFT 11 1303d3cb2de2SBard Liao 1304d3cb2de2SBard Liao /* PLL tracking mode 1 (0x0083) */ 1305d3cb2de2SBard Liao #define RT5659_I2S3_ASRC_MASK (0x1 << 13) 1306d3cb2de2SBard Liao #define RT5659_I2S3_ASRC_SFT 13 1307d3cb2de2SBard Liao #define RT5659_I2S2_ASRC_MASK (0x1 << 12) 1308d3cb2de2SBard Liao #define RT5659_I2S2_ASRC_SFT 12 1309d3cb2de2SBard Liao #define RT5659_I2S1_ASRC_MASK (0x1 << 11) 1310d3cb2de2SBard Liao #define RT5659_I2S1_ASRC_SFT 11 1311d3cb2de2SBard Liao #define RT5659_DAC_STO_ASRC_MASK (0x1 << 10) 1312d3cb2de2SBard Liao #define RT5659_DAC_STO_ASRC_SFT 10 1313d3cb2de2SBard Liao #define RT5659_DAC_MONO_L_ASRC_MASK (0x1 << 9) 1314d3cb2de2SBard Liao #define RT5659_DAC_MONO_L_ASRC_SFT 9 1315d3cb2de2SBard Liao #define RT5659_DAC_MONO_R_ASRC_MASK (0x1 << 8) 1316d3cb2de2SBard Liao #define RT5659_DAC_MONO_R_ASRC_SFT 8 1317d3cb2de2SBard Liao #define RT5659_DMIC_STO1_ASRC_MASK (0x1 << 7) 1318d3cb2de2SBard Liao #define RT5659_DMIC_STO1_ASRC_SFT 7 1319d3cb2de2SBard Liao #define RT5659_DMIC_MONO_L_ASRC_MASK (0x1 << 5) 1320d3cb2de2SBard Liao #define RT5659_DMIC_MONO_L_ASRC_SFT 5 1321d3cb2de2SBard Liao #define RT5659_DMIC_MONO_R_ASRC_MASK (0x1 << 4) 1322d3cb2de2SBard Liao #define RT5659_DMIC_MONO_R_ASRC_SFT 4 1323d3cb2de2SBard Liao #define RT5659_ADC_STO1_ASRC_MASK (0x1 << 3) 1324d3cb2de2SBard Liao #define RT5659_ADC_STO1_ASRC_SFT 3 1325d3cb2de2SBard Liao #define RT5659_ADC_MONO_L_ASRC_MASK (0x1 << 1) 1326d3cb2de2SBard Liao #define RT5659_ADC_MONO_L_ASRC_SFT 1 1327d3cb2de2SBard Liao #define RT5659_ADC_MONO_R_ASRC_MASK (0x1) 1328d3cb2de2SBard Liao #define RT5659_ADC_MONO_R_ASRC_SFT 0 1329d3cb2de2SBard Liao 1330d3cb2de2SBard Liao /* PLL tracking mode 2 (0x0084)*/ 1331d3cb2de2SBard Liao #define RT5659_DA_STO_T_MASK (0x7 << 12) 1332d3cb2de2SBard Liao #define RT5659_DA_STO_T_SFT 12 1333d3cb2de2SBard Liao #define RT5659_DA_MONO_L_T_MASK (0x7 << 8) 1334d3cb2de2SBard Liao #define RT5659_DA_MONO_L_T_SFT 8 1335d3cb2de2SBard Liao #define RT5659_DA_MONO_R_T_MASK (0x7 << 4) 1336d3cb2de2SBard Liao #define RT5659_DA_MONO_R_T_SFT 4 1337d3cb2de2SBard Liao #define RT5659_AD_STO1_T_MASK (0x7) 1338d3cb2de2SBard Liao #define RT5659_AD_STO1_T_SFT 0 1339d3cb2de2SBard Liao 1340d3cb2de2SBard Liao /* PLL tracking mode 3 (0x0085)*/ 1341d3cb2de2SBard Liao #define RT5659_AD_STO2_T_MASK (0x7 << 8) 1342d3cb2de2SBard Liao #define RT5659_AD_STO2_T_SFT 8 1343d3cb2de2SBard Liao #define RT5659_AD_MONO_L_T_MASK (0x7 << 4) 1344d3cb2de2SBard Liao #define RT5659_AD_MONO_L_T_SFT 4 1345d3cb2de2SBard Liao #define RT5659_AD_MONO_R_T_MASK (0x7) 1346d3cb2de2SBard Liao #define RT5659_AD_MONO_R_T_SFT 0 1347d3cb2de2SBard Liao 1348d3cb2de2SBard Liao /* ASRC Control 4 (0x0086) */ 1349d3cb2de2SBard Liao #define RT5659_I2S1_RATE_MASK (0xf << 12) 1350d3cb2de2SBard Liao #define RT5659_I2S1_RATE_SFT 12 1351d3cb2de2SBard Liao #define RT5659_I2S2_RATE_MASK (0xf << 8) 1352d3cb2de2SBard Liao #define RT5659_I2S2_RATE_SFT 8 1353d3cb2de2SBard Liao #define RT5659_I2S3_RATE_MASK (0xf << 4) 1354d3cb2de2SBard Liao #define RT5659_I2S3_RATE_SFT 4 1355d3cb2de2SBard Liao 1356d3cb2de2SBard Liao /* Depop Mode Control 1 (0x8e) */ 1357d3cb2de2SBard Liao #define RT5659_SMT_TRIG_MASK (0x1 << 15) 1358d3cb2de2SBard Liao #define RT5659_SMT_TRIG_SFT 15 1359d3cb2de2SBard Liao #define RT5659_SMT_TRIG_DIS (0x0 << 15) 1360d3cb2de2SBard Liao #define RT5659_SMT_TRIG_EN (0x1 << 15) 1361d3cb2de2SBard Liao #define RT5659_HP_L_SMT_MASK (0x1 << 9) 1362d3cb2de2SBard Liao #define RT5659_HP_L_SMT_SFT 9 1363d3cb2de2SBard Liao #define RT5659_HP_L_SMT_DIS (0x0 << 9) 1364d3cb2de2SBard Liao #define RT5659_HP_L_SMT_EN (0x1 << 9) 1365d3cb2de2SBard Liao #define RT5659_HP_R_SMT_MASK (0x1 << 8) 1366d3cb2de2SBard Liao #define RT5659_HP_R_SMT_SFT 8 1367d3cb2de2SBard Liao #define RT5659_HP_R_SMT_DIS (0x0 << 8) 1368d3cb2de2SBard Liao #define RT5659_HP_R_SMT_EN (0x1 << 8) 1369d3cb2de2SBard Liao #define RT5659_HP_CD_PD_MASK (0x1 << 7) 1370d3cb2de2SBard Liao #define RT5659_HP_CD_PD_SFT 7 1371d3cb2de2SBard Liao #define RT5659_HP_CD_PD_DIS (0x0 << 7) 1372d3cb2de2SBard Liao #define RT5659_HP_CD_PD_EN (0x1 << 7) 1373d3cb2de2SBard Liao #define RT5659_RSTN_MASK (0x1 << 6) 1374d3cb2de2SBard Liao #define RT5659_RSTN_SFT 6 1375d3cb2de2SBard Liao #define RT5659_RSTN_DIS (0x0 << 6) 1376d3cb2de2SBard Liao #define RT5659_RSTN_EN (0x1 << 6) 1377d3cb2de2SBard Liao #define RT5659_RSTP_MASK (0x1 << 5) 1378d3cb2de2SBard Liao #define RT5659_RSTP_SFT 5 1379d3cb2de2SBard Liao #define RT5659_RSTP_DIS (0x0 << 5) 1380d3cb2de2SBard Liao #define RT5659_RSTP_EN (0x1 << 5) 1381d3cb2de2SBard Liao #define RT5659_HP_CO_MASK (0x1 << 4) 1382d3cb2de2SBard Liao #define RT5659_HP_CO_SFT 4 1383d3cb2de2SBard Liao #define RT5659_HP_CO_DIS (0x0 << 4) 1384d3cb2de2SBard Liao #define RT5659_HP_CO_EN (0x1 << 4) 1385d3cb2de2SBard Liao #define RT5659_HP_CP_MASK (0x1 << 3) 1386d3cb2de2SBard Liao #define RT5659_HP_CP_SFT 3 1387d3cb2de2SBard Liao #define RT5659_HP_CP_PD (0x0 << 3) 1388d3cb2de2SBard Liao #define RT5659_HP_CP_PU (0x1 << 3) 1389d3cb2de2SBard Liao #define RT5659_HP_SG_MASK (0x1 << 2) 1390d3cb2de2SBard Liao #define RT5659_HP_SG_SFT 2 1391d3cb2de2SBard Liao #define RT5659_HP_SG_DIS (0x0 << 2) 1392d3cb2de2SBard Liao #define RT5659_HP_SG_EN (0x1 << 2) 1393d3cb2de2SBard Liao #define RT5659_HP_DP_MASK (0x1 << 1) 1394d3cb2de2SBard Liao #define RT5659_HP_DP_SFT 1 1395d3cb2de2SBard Liao #define RT5659_HP_DP_PD (0x0 << 1) 1396d3cb2de2SBard Liao #define RT5659_HP_DP_PU (0x1 << 1) 1397d3cb2de2SBard Liao #define RT5659_HP_CB_MASK (0x1) 1398d3cb2de2SBard Liao #define RT5659_HP_CB_SFT 0 1399d3cb2de2SBard Liao #define RT5659_HP_CB_PD (0x0) 1400d3cb2de2SBard Liao #define RT5659_HP_CB_PU (0x1) 1401d3cb2de2SBard Liao 1402d3cb2de2SBard Liao /* Depop Mode Control 2 (0x8f) */ 1403d3cb2de2SBard Liao #define RT5659_DEPOP_MASK (0x1 << 13) 1404d3cb2de2SBard Liao #define RT5659_DEPOP_SFT 13 1405d3cb2de2SBard Liao #define RT5659_DEPOP_AUTO (0x0 << 13) 1406d3cb2de2SBard Liao #define RT5659_DEPOP_MAN (0x1 << 13) 1407d3cb2de2SBard Liao #define RT5659_RAMP_MASK (0x1 << 12) 1408d3cb2de2SBard Liao #define RT5659_RAMP_SFT 12 1409d3cb2de2SBard Liao #define RT5659_RAMP_DIS (0x0 << 12) 1410d3cb2de2SBard Liao #define RT5659_RAMP_EN (0x1 << 12) 1411d3cb2de2SBard Liao #define RT5659_BPS_MASK (0x1 << 11) 1412d3cb2de2SBard Liao #define RT5659_BPS_SFT 11 1413d3cb2de2SBard Liao #define RT5659_BPS_DIS (0x0 << 11) 1414d3cb2de2SBard Liao #define RT5659_BPS_EN (0x1 << 11) 1415d3cb2de2SBard Liao #define RT5659_FAST_UPDN_MASK (0x1 << 10) 1416d3cb2de2SBard Liao #define RT5659_FAST_UPDN_SFT 10 1417d3cb2de2SBard Liao #define RT5659_FAST_UPDN_DIS (0x0 << 10) 1418d3cb2de2SBard Liao #define RT5659_FAST_UPDN_EN (0x1 << 10) 1419d3cb2de2SBard Liao #define RT5659_MRES_MASK (0x3 << 8) 1420d3cb2de2SBard Liao #define RT5659_MRES_SFT 8 1421d3cb2de2SBard Liao #define RT5659_MRES_15MO (0x0 << 8) 1422d3cb2de2SBard Liao #define RT5659_MRES_25MO (0x1 << 8) 1423d3cb2de2SBard Liao #define RT5659_MRES_35MO (0x2 << 8) 1424d3cb2de2SBard Liao #define RT5659_MRES_45MO (0x3 << 8) 1425d3cb2de2SBard Liao #define RT5659_VLO_MASK (0x1 << 7) 1426d3cb2de2SBard Liao #define RT5659_VLO_SFT 7 1427d3cb2de2SBard Liao #define RT5659_VLO_3V (0x0 << 7) 1428d3cb2de2SBard Liao #define RT5659_VLO_32V (0x1 << 7) 1429d3cb2de2SBard Liao #define RT5659_DIG_DP_MASK (0x1 << 6) 1430d3cb2de2SBard Liao #define RT5659_DIG_DP_SFT 6 1431d3cb2de2SBard Liao #define RT5659_DIG_DP_DIS (0x0 << 6) 1432d3cb2de2SBard Liao #define RT5659_DIG_DP_EN (0x1 << 6) 1433d3cb2de2SBard Liao #define RT5659_DP_TH_MASK (0x3 << 4) 1434d3cb2de2SBard Liao #define RT5659_DP_TH_SFT 4 1435d3cb2de2SBard Liao 1436d3cb2de2SBard Liao /* Depop Mode Control 3 (0x90) */ 1437d3cb2de2SBard Liao #define RT5659_CP_SYS_MASK (0x7 << 12) 1438d3cb2de2SBard Liao #define RT5659_CP_SYS_SFT 12 1439d3cb2de2SBard Liao #define RT5659_CP_FQ1_MASK (0x7 << 8) 1440d3cb2de2SBard Liao #define RT5659_CP_FQ1_SFT 8 1441d3cb2de2SBard Liao #define RT5659_CP_FQ2_MASK (0x7 << 4) 1442d3cb2de2SBard Liao #define RT5659_CP_FQ2_SFT 4 1443d3cb2de2SBard Liao #define RT5659_CP_FQ3_MASK (0x7) 1444d3cb2de2SBard Liao #define RT5659_CP_FQ3_SFT 0 1445d3cb2de2SBard Liao #define RT5659_CP_FQ_1_5_KHZ 0 1446d3cb2de2SBard Liao #define RT5659_CP_FQ_3_KHZ 1 1447d3cb2de2SBard Liao #define RT5659_CP_FQ_6_KHZ 2 1448d3cb2de2SBard Liao #define RT5659_CP_FQ_12_KHZ 3 1449d3cb2de2SBard Liao #define RT5659_CP_FQ_24_KHZ 4 1450d3cb2de2SBard Liao #define RT5659_CP_FQ_48_KHZ 5 1451d3cb2de2SBard Liao #define RT5659_CP_FQ_96_KHZ 6 1452d3cb2de2SBard Liao #define RT5659_CP_FQ_192_KHZ 7 1453d3cb2de2SBard Liao 1454d3cb2de2SBard Liao /* HPOUT charge pump 1 (0x0091) */ 1455d3cb2de2SBard Liao #define RT5659_OSW_L_MASK (0x1 << 11) 1456d3cb2de2SBard Liao #define RT5659_OSW_L_SFT 11 1457d3cb2de2SBard Liao #define RT5659_OSW_L_DIS (0x0 << 11) 1458d3cb2de2SBard Liao #define RT5659_OSW_L_EN (0x1 << 11) 1459d3cb2de2SBard Liao #define RT5659_OSW_R_MASK (0x1 << 10) 1460d3cb2de2SBard Liao #define RT5659_OSW_R_SFT 10 1461d3cb2de2SBard Liao #define RT5659_OSW_R_DIS (0x0 << 10) 1462d3cb2de2SBard Liao #define RT5659_OSW_R_EN (0x1 << 10) 1463d3cb2de2SBard Liao #define RT5659_PM_HP_MASK (0x3 << 8) 1464d3cb2de2SBard Liao #define RT5659_PM_HP_SFT 8 1465d3cb2de2SBard Liao #define RT5659_PM_HP_LV (0x0 << 8) 1466d3cb2de2SBard Liao #define RT5659_PM_HP_MV (0x1 << 8) 1467d3cb2de2SBard Liao #define RT5659_PM_HP_HV (0x2 << 8) 1468d3cb2de2SBard Liao #define RT5659_IB_HP_MASK (0x3 << 6) 1469d3cb2de2SBard Liao #define RT5659_IB_HP_SFT 6 1470d3cb2de2SBard Liao #define RT5659_IB_HP_125IL (0x0 << 6) 1471d3cb2de2SBard Liao #define RT5659_IB_HP_25IL (0x1 << 6) 1472d3cb2de2SBard Liao #define RT5659_IB_HP_5IL (0x2 << 6) 1473d3cb2de2SBard Liao #define RT5659_IB_HP_1IL (0x3 << 6) 1474d3cb2de2SBard Liao 1475d3cb2de2SBard Liao /* PV detection and SPK gain control (0x92) */ 1476d3cb2de2SBard Liao #define RT5659_PVDD_DET_MASK (0x1 << 15) 1477d3cb2de2SBard Liao #define RT5659_PVDD_DET_SFT 15 1478d3cb2de2SBard Liao #define RT5659_PVDD_DET_DIS (0x0 << 15) 1479d3cb2de2SBard Liao #define RT5659_PVDD_DET_EN (0x1 << 15) 1480d3cb2de2SBard Liao #define RT5659_SPK_AG_MASK (0x1 << 14) 1481d3cb2de2SBard Liao #define RT5659_SPK_AG_SFT 14 1482d3cb2de2SBard Liao #define RT5659_SPK_AG_DIS (0x0 << 14) 1483d3cb2de2SBard Liao #define RT5659_SPK_AG_EN (0x1 << 14) 1484d3cb2de2SBard Liao 1485d3cb2de2SBard Liao /* Micbias Control (0x93) */ 1486d3cb2de2SBard Liao #define RT5659_MIC1_BS_MASK (0x1 << 15) 1487d3cb2de2SBard Liao #define RT5659_MIC1_BS_SFT 15 1488d3cb2de2SBard Liao #define RT5659_MIC1_BS_9AV (0x0 << 15) 1489d3cb2de2SBard Liao #define RT5659_MIC1_BS_75AV (0x1 << 15) 1490d3cb2de2SBard Liao #define RT5659_MIC2_BS_MASK (0x1 << 14) 1491d3cb2de2SBard Liao #define RT5659_MIC2_BS_SFT 14 1492d3cb2de2SBard Liao #define RT5659_MIC2_BS_9AV (0x0 << 14) 1493d3cb2de2SBard Liao #define RT5659_MIC2_BS_75AV (0x1 << 14) 1494d3cb2de2SBard Liao #define RT5659_MIC1_CLK_MASK (0x1 << 13) 1495d3cb2de2SBard Liao #define RT5659_MIC1_CLK_SFT 13 1496d3cb2de2SBard Liao #define RT5659_MIC1_CLK_DIS (0x0 << 13) 1497d3cb2de2SBard Liao #define RT5659_MIC1_CLK_EN (0x1 << 13) 1498d3cb2de2SBard Liao #define RT5659_MIC2_CLK_MASK (0x1 << 12) 1499d3cb2de2SBard Liao #define RT5659_MIC2_CLK_SFT 12 1500d3cb2de2SBard Liao #define RT5659_MIC2_CLK_DIS (0x0 << 12) 1501d3cb2de2SBard Liao #define RT5659_MIC2_CLK_EN (0x1 << 12) 1502d3cb2de2SBard Liao #define RT5659_MIC1_OVCD_MASK (0x1 << 11) 1503d3cb2de2SBard Liao #define RT5659_MIC1_OVCD_SFT 11 1504d3cb2de2SBard Liao #define RT5659_MIC1_OVCD_DIS (0x0 << 11) 1505d3cb2de2SBard Liao #define RT5659_MIC1_OVCD_EN (0x1 << 11) 1506d3cb2de2SBard Liao #define RT5659_MIC1_OVTH_MASK (0x3 << 9) 1507d3cb2de2SBard Liao #define RT5659_MIC1_OVTH_SFT 9 1508d3cb2de2SBard Liao #define RT5659_MIC1_OVTH_600UA (0x0 << 9) 1509d3cb2de2SBard Liao #define RT5659_MIC1_OVTH_1500UA (0x1 << 9) 1510d3cb2de2SBard Liao #define RT5659_MIC1_OVTH_2000UA (0x2 << 9) 1511d3cb2de2SBard Liao #define RT5659_MIC2_OVCD_MASK (0x1 << 8) 1512d3cb2de2SBard Liao #define RT5659_MIC2_OVCD_SFT 8 1513d3cb2de2SBard Liao #define RT5659_MIC2_OVCD_DIS (0x0 << 8) 1514d3cb2de2SBard Liao #define RT5659_MIC2_OVCD_EN (0x1 << 8) 1515d3cb2de2SBard Liao #define RT5659_MIC2_OVTH_MASK (0x3 << 6) 1516d3cb2de2SBard Liao #define RT5659_MIC2_OVTH_SFT 6 1517d3cb2de2SBard Liao #define RT5659_MIC2_OVTH_600UA (0x0 << 6) 1518d3cb2de2SBard Liao #define RT5659_MIC2_OVTH_1500UA (0x1 << 6) 1519d3cb2de2SBard Liao #define RT5659_MIC2_OVTH_2000UA (0x2 << 6) 1520d3cb2de2SBard Liao #define RT5659_PWR_MB_MASK (0x1 << 5) 1521d3cb2de2SBard Liao #define RT5659_PWR_MB_SFT 5 1522d3cb2de2SBard Liao #define RT5659_PWR_MB_PD (0x0 << 5) 1523d3cb2de2SBard Liao #define RT5659_PWR_MB_PU (0x1 << 5) 1524d3cb2de2SBard Liao #define RT5659_PWR_CLK25M_MASK (0x1 << 4) 1525d3cb2de2SBard Liao #define RT5659_PWR_CLK25M_SFT 4 1526d3cb2de2SBard Liao #define RT5659_PWR_CLK25M_PD (0x0 << 4) 1527d3cb2de2SBard Liao #define RT5659_PWR_CLK25M_PU (0x1 << 4) 1528d3cb2de2SBard Liao 1529d3cb2de2SBard Liao /* REC Mixer 2 Left Control 2 (0x009c) */ 1530d3cb2de2SBard Liao #define RT5659_M_BST1_RM2_L (0x1 << 5) 1531d3cb2de2SBard Liao #define RT5659_M_BST1_RM2_L_SFT 5 1532d3cb2de2SBard Liao #define RT5659_M_BST2_RM2_L (0x1 << 4) 1533d3cb2de2SBard Liao #define RT5659_M_BST2_RM2_L_SFT 4 1534d3cb2de2SBard Liao #define RT5659_M_BST3_RM2_L (0x1 << 3) 1535d3cb2de2SBard Liao #define RT5659_M_BST3_RM2_L_SFT 3 1536d3cb2de2SBard Liao #define RT5659_M_BST4_RM2_L (0x1 << 2) 1537d3cb2de2SBard Liao #define RT5659_M_BST4_RM2_L_SFT 2 1538d3cb2de2SBard Liao #define RT5659_M_OUTVOLL_RM2_L (0x1 << 1) 1539d3cb2de2SBard Liao #define RT5659_M_OUTVOLL_RM2_L_SFT 1 1540d3cb2de2SBard Liao #define RT5659_M_SPKVOL_RM2_L (0x1) 1541d3cb2de2SBard Liao #define RT5659_M_SPKVOL_RM2_L_SFT 0 1542d3cb2de2SBard Liao 1543d3cb2de2SBard Liao /* REC Mixer 2 Right Control 2 (0x009e) */ 1544d3cb2de2SBard Liao #define RT5659_M_BST1_RM2_R (0x1 << 5) 1545d3cb2de2SBard Liao #define RT5659_M_BST1_RM2_R_SFT 5 1546d3cb2de2SBard Liao #define RT5659_M_BST2_RM2_R (0x1 << 4) 1547d3cb2de2SBard Liao #define RT5659_M_BST2_RM2_R_SFT 4 1548d3cb2de2SBard Liao #define RT5659_M_BST3_RM2_R (0x1 << 3) 1549d3cb2de2SBard Liao #define RT5659_M_BST3_RM2_R_SFT 3 1550d3cb2de2SBard Liao #define RT5659_M_BST4_RM2_R (0x1 << 2) 1551d3cb2de2SBard Liao #define RT5659_M_BST4_RM2_R_SFT 2 1552d3cb2de2SBard Liao #define RT5659_M_OUTVOLR_RM2_R (0x1 << 1) 1553d3cb2de2SBard Liao #define RT5659_M_OUTVOLR_RM2_R_SFT 1 1554d3cb2de2SBard Liao #define RT5659_M_MONOVOL_RM2_R (0x1) 1555d3cb2de2SBard Liao #define RT5659_M_MONOVOL_RM2_R_SFT 0 1556d3cb2de2SBard Liao 1557d3cb2de2SBard Liao /* Class D Output Control (0x00a0) */ 1558d3cb2de2SBard Liao #define RT5659_POW_CLSD_DB_MASK (0x1 << 9) 1559d3cb2de2SBard Liao #define RT5659_POW_CLSD_DB_EN (0x1 << 9) 1560d3cb2de2SBard Liao #define RT5659_POW_CLSD_DB_DIS (0x0 << 9) 1561d3cb2de2SBard Liao 1562d3cb2de2SBard Liao /* EQ Control 1 (0x00b0) */ 1563d3cb2de2SBard Liao #define RT5659_EQ_SRC_DAC (0x0 << 15) 1564d3cb2de2SBard Liao #define RT5659_EQ_SRC_ADC (0x1 << 15) 1565d3cb2de2SBard Liao #define RT5659_EQ_UPD (0x1 << 14) 1566d3cb2de2SBard Liao #define RT5659_EQ_UPD_BIT 14 1567d3cb2de2SBard Liao #define RT5659_EQ_CD_MASK (0x1 << 13) 1568d3cb2de2SBard Liao #define RT5659_EQ_CD_SFT 13 1569d3cb2de2SBard Liao #define RT5659_EQ_CD_DIS (0x0 << 13) 1570d3cb2de2SBard Liao #define RT5659_EQ_CD_EN (0x1 << 13) 1571d3cb2de2SBard Liao #define RT5659_EQ_DITH_MASK (0x3 << 8) 1572d3cb2de2SBard Liao #define RT5659_EQ_DITH_SFT 8 1573d3cb2de2SBard Liao #define RT5659_EQ_DITH_NOR (0x0 << 8) 1574d3cb2de2SBard Liao #define RT5659_EQ_DITH_LSB (0x1 << 8) 1575d3cb2de2SBard Liao #define RT5659_EQ_DITH_LSB_1 (0x2 << 8) 1576d3cb2de2SBard Liao #define RT5659_EQ_DITH_LSB_2 (0x3 << 8) 1577d3cb2de2SBard Liao 1578d3cb2de2SBard Liao /* IRQ Control 1 (0x00b7) */ 1579d3cb2de2SBard Liao #define RT5659_JD1_1_EN_MASK (0x1 << 15) 1580d3cb2de2SBard Liao #define RT5659_JD1_1_EN_SFT 15 1581d3cb2de2SBard Liao #define RT5659_JD1_1_DIS (0x0 << 15) 1582d3cb2de2SBard Liao #define RT5659_JD1_1_EN (0x1 << 15) 1583d3cb2de2SBard Liao #define RT5659_JD1_2_EN_MASK (0x1 << 12) 1584d3cb2de2SBard Liao #define RT5659_JD1_2_EN_SFT 12 1585d3cb2de2SBard Liao #define RT5659_JD1_2_DIS (0x0 << 12) 1586d3cb2de2SBard Liao #define RT5659_JD1_2_EN (0x1 << 12) 1587d3cb2de2SBard Liao #define RT5659_IL_IRQ_MASK (0x1 << 3) 1588d3cb2de2SBard Liao #define RT5659_IL_IRQ_DIS (0x0 << 3) 1589d3cb2de2SBard Liao #define RT5659_IL_IRQ_EN (0x1 << 3) 1590d3cb2de2SBard Liao 1591d3cb2de2SBard Liao /* IRQ Control 5 (0x00ba) */ 1592d3cb2de2SBard Liao #define RT5659_IRQ_JD_EN (0x1 << 3) 1593d3cb2de2SBard Liao #define RT5659_IRQ_JD_EN_SFT 3 1594d3cb2de2SBard Liao 1595d3cb2de2SBard Liao /* GPIO Control 1 (0x00c0) */ 1596d3cb2de2SBard Liao #define RT5659_GP1_PIN_MASK (0x1 << 15) 1597d3cb2de2SBard Liao #define RT5659_GP1_PIN_SFT 15 1598d3cb2de2SBard Liao #define RT5659_GP1_PIN_GPIO1 (0x0 << 15) 1599d3cb2de2SBard Liao #define RT5659_GP1_PIN_IRQ (0x1 << 15) 1600d3cb2de2SBard Liao #define RT5659_GP2_PIN_MASK (0x1 << 14) 1601d3cb2de2SBard Liao #define RT5659_GP2_PIN_SFT 14 1602d3cb2de2SBard Liao #define RT5659_GP2_PIN_GPIO2 (0x0 << 14) 1603d3cb2de2SBard Liao #define RT5659_GP2_PIN_DMIC1_SCL (0x1 << 14) 1604d3cb2de2SBard Liao #define RT5659_GP3_PIN_MASK (0x1 << 13) 1605d3cb2de2SBard Liao #define RT5659_GP3_PIN_SFT 13 1606d3cb2de2SBard Liao #define RT5659_GP3_PIN_GPIO3 (0x0 << 13) 1607d3cb2de2SBard Liao #define RT5659_GP3_PIN_PDM_SCL (0x1 << 13) 1608d3cb2de2SBard Liao #define RT5659_GP4_PIN_MASK (0x1 << 12) 1609d3cb2de2SBard Liao #define RT5659_GP4_PIN_SFT 12 1610d3cb2de2SBard Liao #define RT5659_GP4_PIN_GPIO4 (0x0 << 12) 1611d3cb2de2SBard Liao #define RT5659_GP4_PIN_PDM_SDA (0x1 << 12) 1612d3cb2de2SBard Liao #define RT5659_GP5_PIN_MASK (0x1 << 11) 1613d3cb2de2SBard Liao #define RT5659_GP5_PIN_SFT 11 1614d3cb2de2SBard Liao #define RT5659_GP5_PIN_GPIO5 (0x0 << 11) 1615d3cb2de2SBard Liao #define RT5659_GP5_PIN_DMIC1_SDA (0x1 << 11) 1616d3cb2de2SBard Liao #define RT5659_GP6_PIN_MASK (0x1 << 10) 1617d3cb2de2SBard Liao #define RT5659_GP6_PIN_SFT 10 1618d3cb2de2SBard Liao #define RT5659_GP6_PIN_GPIO6 (0x0 << 10) 1619d3cb2de2SBard Liao #define RT5659_GP6_PIN_DMIC2_SDA (0x1 << 10) 1620d3cb2de2SBard Liao #define RT5659_GP7_PIN_MASK (0x1 << 9) 1621d3cb2de2SBard Liao #define RT5659_GP7_PIN_SFT 9 1622d3cb2de2SBard Liao #define RT5659_GP7_PIN_GPIO7 (0x0 << 9) 1623d3cb2de2SBard Liao #define RT5659_GP7_PIN_PDM_SCL (0x1 << 9) 1624d3cb2de2SBard Liao #define RT5659_GP8_PIN_MASK (0x1 << 8) 1625d3cb2de2SBard Liao #define RT5659_GP8_PIN_SFT 8 1626d3cb2de2SBard Liao #define RT5659_GP8_PIN_GPIO8 (0x0 << 8) 1627d3cb2de2SBard Liao #define RT5659_GP8_PIN_PDM_SDA (0x1 << 8) 1628d3cb2de2SBard Liao #define RT5659_GP9_PIN_MASK (0x1 << 7) 1629d3cb2de2SBard Liao #define RT5659_GP9_PIN_SFT 7 1630d3cb2de2SBard Liao #define RT5659_GP9_PIN_GPIO9 (0x0 << 7) 1631d3cb2de2SBard Liao #define RT5659_GP9_PIN_DMIC1_SDA (0x1 << 7) 1632d3cb2de2SBard Liao #define RT5659_GP10_PIN_MASK (0x1 << 6) 1633d3cb2de2SBard Liao #define RT5659_GP10_PIN_SFT 6 1634d3cb2de2SBard Liao #define RT5659_GP10_PIN_GPIO10 (0x0 << 6) 1635d3cb2de2SBard Liao #define RT5659_GP10_PIN_DMIC2_SDA (0x1 << 6) 1636d3cb2de2SBard Liao #define RT5659_GP11_PIN_MASK (0x1 << 5) 1637d3cb2de2SBard Liao #define RT5659_GP11_PIN_SFT 5 1638d3cb2de2SBard Liao #define RT5659_GP11_PIN_GPIO11 (0x0 << 5) 1639d3cb2de2SBard Liao #define RT5659_GP11_PIN_DMIC1_SDA (0x1 << 5) 1640d3cb2de2SBard Liao #define RT5659_GP12_PIN_MASK (0x1 << 4) 1641d3cb2de2SBard Liao #define RT5659_GP12_PIN_SFT 4 1642d3cb2de2SBard Liao #define RT5659_GP12_PIN_GPIO12 (0x0 << 4) 1643d3cb2de2SBard Liao #define RT5659_GP12_PIN_DMIC2_SDA (0x1 << 4) 1644d3cb2de2SBard Liao #define RT5659_GP13_PIN_MASK (0x3 << 2) 1645d3cb2de2SBard Liao #define RT5659_GP13_PIN_SFT 2 1646d3cb2de2SBard Liao #define RT5659_GP13_PIN_GPIO13 (0x0 << 2) 1647d3cb2de2SBard Liao #define RT5659_GP13_PIN_SPDIF_SDA (0x1 << 2) 1648d3cb2de2SBard Liao #define RT5659_GP13_PIN_DMIC2_SCL (0x2 << 2) 1649d3cb2de2SBard Liao #define RT5659_GP13_PIN_PDM_SCL (0x3 << 2) 1650d3cb2de2SBard Liao #define RT5659_GP15_PIN_MASK (0x3) 1651d3cb2de2SBard Liao #define RT5659_GP15_PIN_SFT 0 1652d3cb2de2SBard Liao #define RT5659_GP15_PIN_GPIO15 (0x0) 1653d3cb2de2SBard Liao #define RT5659_GP15_PIN_DMIC3_SCL (0x1) 1654d3cb2de2SBard Liao #define RT5659_GP15_PIN_PDM_SDA (0x2) 1655d3cb2de2SBard Liao 1656d3cb2de2SBard Liao /* GPIO Control 2 (0x00c1)*/ 1657d3cb2de2SBard Liao #define RT5659_GP1_PF_IN (0x0 << 2) 1658d3cb2de2SBard Liao #define RT5659_GP1_PF_OUT (0x1 << 2) 1659d3cb2de2SBard Liao #define RT5659_GP1_PF_MASK (0x1 << 2) 1660d3cb2de2SBard Liao #define RT5659_GP1_PF_SFT 2 1661d3cb2de2SBard Liao 1662d3cb2de2SBard Liao /* GPIO Control 3 (0x00c2) */ 1663d3cb2de2SBard Liao #define RT5659_I2S2_PIN_MASK (0x1 << 15) 1664d3cb2de2SBard Liao #define RT5659_I2S2_PIN_SFT 15 1665d3cb2de2SBard Liao #define RT5659_I2S2_PIN_I2S (0x0 << 15) 1666d3cb2de2SBard Liao #define RT5659_I2S2_PIN_GPIO (0x1 << 15) 1667d3cb2de2SBard Liao 1668d3cb2de2SBard Liao /* Soft volume and zero cross control 1 (0x00d9) */ 1669d3cb2de2SBard Liao #define RT5659_SV_MASK (0x1 << 15) 1670d3cb2de2SBard Liao #define RT5659_SV_SFT 15 1671d3cb2de2SBard Liao #define RT5659_SV_DIS (0x0 << 15) 1672d3cb2de2SBard Liao #define RT5659_SV_EN (0x1 << 15) 1673d3cb2de2SBard Liao #define RT5659_OUT_SV_MASK (0x1 << 13) 1674d3cb2de2SBard Liao #define RT5659_OUT_SV_SFT 13 1675d3cb2de2SBard Liao #define RT5659_OUT_SV_DIS (0x0 << 13) 1676d3cb2de2SBard Liao #define RT5659_OUT_SV_EN (0x1 << 13) 1677d3cb2de2SBard Liao #define RT5659_HP_SV_MASK (0x1 << 12) 1678d3cb2de2SBard Liao #define RT5659_HP_SV_SFT 12 1679d3cb2de2SBard Liao #define RT5659_HP_SV_DIS (0x0 << 12) 1680d3cb2de2SBard Liao #define RT5659_HP_SV_EN (0x1 << 12) 1681d3cb2de2SBard Liao #define RT5659_ZCD_DIG_MASK (0x1 << 11) 1682d3cb2de2SBard Liao #define RT5659_ZCD_DIG_SFT 11 1683d3cb2de2SBard Liao #define RT5659_ZCD_DIG_DIS (0x0 << 11) 1684d3cb2de2SBard Liao #define RT5659_ZCD_DIG_EN (0x1 << 11) 1685d3cb2de2SBard Liao #define RT5659_ZCD_MASK (0x1 << 10) 1686d3cb2de2SBard Liao #define RT5659_ZCD_SFT 10 1687d3cb2de2SBard Liao #define RT5659_ZCD_PD (0x0 << 10) 1688d3cb2de2SBard Liao #define RT5659_ZCD_PU (0x1 << 10) 1689d3cb2de2SBard Liao #define RT5659_SV_DLY_MASK (0xf) 1690d3cb2de2SBard Liao #define RT5659_SV_DLY_SFT 0 1691d3cb2de2SBard Liao 1692d3cb2de2SBard Liao /* Soft volume and zero cross control 2 (0x00da) */ 1693d3cb2de2SBard Liao #define RT5659_ZCD_HP_MASK (0x1 << 15) 1694d3cb2de2SBard Liao #define RT5659_ZCD_HP_SFT 15 1695d3cb2de2SBard Liao #define RT5659_ZCD_HP_DIS (0x0 << 15) 1696d3cb2de2SBard Liao #define RT5659_ZCD_HP_EN (0x1 << 15) 1697d3cb2de2SBard Liao 1698d3cb2de2SBard Liao /* 4 Button Inline Command Control 2 (0x00e0) */ 1699d3cb2de2SBard Liao #define RT5659_4BTN_IL_MASK (0x1 << 15) 1700d3cb2de2SBard Liao #define RT5659_4BTN_IL_EN (0x1 << 15) 1701d3cb2de2SBard Liao #define RT5659_4BTN_IL_DIS (0x0 << 15) 1702d3cb2de2SBard Liao 1703d3cb2de2SBard Liao /* Analog JD Control 1 (0x00f0) */ 1704d3cb2de2SBard Liao #define RT5659_JD1_MODE_MASK (0x3 << 0) 1705d3cb2de2SBard Liao #define RT5659_JD1_MODE_0 (0x0 << 0) 1706d3cb2de2SBard Liao #define RT5659_JD1_MODE_1 (0x1 << 0) 1707d3cb2de2SBard Liao #define RT5659_JD1_MODE_2 (0x2 << 0) 1708d3cb2de2SBard Liao 1709d3cb2de2SBard Liao /* Jack Detect Control 3 (0x00f8) */ 1710d3cb2de2SBard Liao #define RT5659_JD_TRI_HPO_SEL_MASK (0x7) 1711d3cb2de2SBard Liao #define RT5659_JD_TRI_HPO_SEL_SFT (0) 1712d3cb2de2SBard Liao #define RT5659_JD_HPO_GPIO_JD1 (0x0) 1713d3cb2de2SBard Liao #define RT5659_JD_HPO_JD1_1 (0x1) 1714d3cb2de2SBard Liao #define RT5659_JD_HPO_JD1_2 (0x2) 1715d3cb2de2SBard Liao #define RT5659_JD_HPO_JD2 (0x3) 1716d3cb2de2SBard Liao #define RT5659_JD_HPO_GPIO_JD2 (0x4) 1717d3cb2de2SBard Liao #define RT5659_JD_HPO_JD3 (0x5) 1718d3cb2de2SBard Liao #define RT5659_JD_HPO_JD_D (0x6) 1719d3cb2de2SBard Liao 1720d3cb2de2SBard Liao /* Digital Misc Control (0x00fa) */ 1721d3cb2de2SBard Liao #define RT5659_AM_MASK (0x1 << 7) 1722d3cb2de2SBard Liao #define RT5659_AM_EN (0x1 << 7) 1723d3cb2de2SBard Liao #define RT5659_AM_DIS (0x1 << 7) 1724d3cb2de2SBard Liao #define RT5659_DIG_GATE_CTRL 0x1 1725d3cb2de2SBard Liao #define RT5659_DIG_GATE_CTRL_SFT (0) 1726d3cb2de2SBard Liao 1727d3cb2de2SBard Liao /* Chopper and Clock control for ADC (0x011c)*/ 1728d3cb2de2SBard Liao #define RT5659_M_RF_DIG_MASK (0x1 << 12) 1729d3cb2de2SBard Liao #define RT5659_M_RF_DIG_SFT 12 1730d3cb2de2SBard Liao #define RT5659_M_RI_DIG (0x1 << 11) 1731d3cb2de2SBard Liao 1732d3cb2de2SBard Liao /* Chopper and Clock control for DAC (0x013a)*/ 1733d3cb2de2SBard Liao #define RT5659_CKXEN_DAC1_MASK (0x1 << 13) 1734d3cb2de2SBard Liao #define RT5659_CKXEN_DAC1_SFT 13 1735d3cb2de2SBard Liao #define RT5659_CKGEN_DAC1_MASK (0x1 << 12) 1736d3cb2de2SBard Liao #define RT5659_CKGEN_DAC1_SFT 12 1737d3cb2de2SBard Liao #define RT5659_CKXEN_DAC2_MASK (0x1 << 5) 1738d3cb2de2SBard Liao #define RT5659_CKXEN_DAC2_SFT 5 1739d3cb2de2SBard Liao #define RT5659_CKGEN_DAC2_MASK (0x1 << 4) 1740d3cb2de2SBard Liao #define RT5659_CKGEN_DAC2_SFT 4 1741d3cb2de2SBard Liao 1742d3cb2de2SBard Liao /* Chopper and Clock control for ADC (0x013b)*/ 1743ce571b80SBard Liao #define RT5659_CKXEN_ADC1_MASK (0x1 << 13) 1744ce571b80SBard Liao #define RT5659_CKXEN_ADC1_SFT 13 1745ce571b80SBard Liao #define RT5659_CKGEN_ADC1_MASK (0x1 << 12) 1746ce571b80SBard Liao #define RT5659_CKGEN_ADC1_SFT 12 1747ce571b80SBard Liao #define RT5659_CKXEN_ADC2_MASK (0x1 << 5) 1748ce571b80SBard Liao #define RT5659_CKXEN_ADC2_SFT 5 1749ce571b80SBard Liao #define RT5659_CKGEN_ADC2_MASK (0x1 << 4) 1750ce571b80SBard Liao #define RT5659_CKGEN_ADC2_SFT 4 1751d3cb2de2SBard Liao 1752d3cb2de2SBard Liao /* Test Mode Control 1 (0x0145) */ 1753d3cb2de2SBard Liao #define RT5659_AD2DA_LB_MASK (0x1 << 9) 1754d3cb2de2SBard Liao #define RT5659_AD2DA_LB_SFT 9 1755d3cb2de2SBard Liao 1756d3cb2de2SBard Liao /* Stereo Noise Gate Control 1 (0x0160) */ 1757d3cb2de2SBard Liao #define RT5659_NG2_EN_MASK (0x1 << 15) 1758d3cb2de2SBard Liao #define RT5659_NG2_EN (0x1 << 15) 1759d3cb2de2SBard Liao #define RT5659_NG2_DIS (0x0 << 15) 1760d3cb2de2SBard Liao 1761d3cb2de2SBard Liao /* System Clock Source */ 1762d3cb2de2SBard Liao enum { 1763d3cb2de2SBard Liao RT5659_SCLK_S_MCLK, 1764d3cb2de2SBard Liao RT5659_SCLK_S_PLL1, 1765d3cb2de2SBard Liao RT5659_SCLK_S_RCCLK, 1766d3cb2de2SBard Liao }; 1767d3cb2de2SBard Liao 1768d3cb2de2SBard Liao /* PLL1 Source */ 1769d3cb2de2SBard Liao enum { 1770d3cb2de2SBard Liao RT5659_PLL1_S_MCLK, 1771d3cb2de2SBard Liao RT5659_PLL1_S_BCLK1, 1772d3cb2de2SBard Liao RT5659_PLL1_S_BCLK2, 1773d3cb2de2SBard Liao RT5659_PLL1_S_BCLK3, 1774d3cb2de2SBard Liao RT5659_PLL1_S_BCLK4, 1775d3cb2de2SBard Liao }; 1776d3cb2de2SBard Liao 1777d3cb2de2SBard Liao enum { 1778d3cb2de2SBard Liao RT5659_AIF1, 1779d3cb2de2SBard Liao RT5659_AIF2, 1780d3cb2de2SBard Liao RT5659_AIF3, 1781d3cb2de2SBard Liao RT5659_AIF4, 1782d3cb2de2SBard Liao RT5659_AIFS, 1783d3cb2de2SBard Liao }; 1784d3cb2de2SBard Liao 1785d3cb2de2SBard Liao struct rt5659_pll_code { 1786d3cb2de2SBard Liao bool m_bp; 1787d3cb2de2SBard Liao int m_code; 1788d3cb2de2SBard Liao int n_code; 1789d3cb2de2SBard Liao int k_code; 1790d3cb2de2SBard Liao }; 1791d3cb2de2SBard Liao 1792d3cb2de2SBard Liao struct rt5659_priv { 1793de86a332SKuninori Morimoto struct snd_soc_component *component; 1794d3cb2de2SBard Liao struct rt5659_platform_data pdata; 1795d3cb2de2SBard Liao struct regmap *regmap; 1796d3cb2de2SBard Liao struct gpio_desc *gpiod_ldo1_en; 1797d3cb2de2SBard Liao struct gpio_desc *gpiod_reset; 1798d3cb2de2SBard Liao struct snd_soc_jack *hs_jack; 1799d3cb2de2SBard Liao struct delayed_work jack_detect_work; 1800c6f8769bSNicolin Chen struct clk *mclk; 1801d3cb2de2SBard Liao 1802d3cb2de2SBard Liao int sysclk; 1803d3cb2de2SBard Liao int sysclk_src; 1804d3cb2de2SBard Liao int lrck[RT5659_AIFS]; 1805d3cb2de2SBard Liao int bclk[RT5659_AIFS]; 1806d3cb2de2SBard Liao int master[RT5659_AIFS]; 1807d3cb2de2SBard Liao int v_id; 1808d3cb2de2SBard Liao 1809d3cb2de2SBard Liao int pll_src; 1810d3cb2de2SBard Liao int pll_in; 1811d3cb2de2SBard Liao int pll_out; 1812d3cb2de2SBard Liao 1813d3cb2de2SBard Liao int jack_type; 1814041e74b7Soder_chiou@realtek.com bool hda_hp_plugged; 1815041e74b7Soder_chiou@realtek.com bool hda_mic_plugged; 1816d3cb2de2SBard Liao }; 1817d3cb2de2SBard Liao 1818de86a332SKuninori Morimoto int rt5659_set_jack_detect(struct snd_soc_component *component, 1819d3cb2de2SBard Liao struct snd_soc_jack *hs_jack); 1820d3cb2de2SBard Liao 1821d3cb2de2SBard Liao #endif /* __RT5659_H__ */ 1822