Lines Matching +full:0 +full:x2184
37 #define RT5677_DEVICE_ID 0x6327
40 #define RT5677_DSP_BOOT_VECTOR 0x1801f090
41 #define RT5677_MODEL_ADDR 0x5FFC9800
43 #define RT5677_PR_RANGE_BASE (0xff + 1)
44 #define RT5677_PR_SPACING 0x100
46 #define RT5677_PR_BASE (RT5677_PR_RANGE_BASE + (0 * RT5677_PR_SPACING))
52 .range_max = RT5677_PR_BASE + 0xfd,
54 .selector_mask = 0xff,
55 .selector_shift = 0x0,
57 .window_len = 0x1,
62 {RT5677_ASRC_12, 0x0018},
63 {RT5677_PR_BASE + 0x3d, 0x364d},
64 {RT5677_PR_BASE + 0x17, 0x4fc0},
65 {RT5677_PR_BASE + 0x13, 0x0312},
66 {RT5677_PR_BASE + 0x1e, 0x0000},
67 {RT5677_PR_BASE + 0x12, 0x0eaa},
68 {RT5677_PR_BASE + 0x14, 0x018a},
69 {RT5677_PR_BASE + 0x15, 0x0490},
70 {RT5677_PR_BASE + 0x38, 0x0f71},
71 {RT5677_PR_BASE + 0x39, 0x0f71},
76 {RT5677_RESET , 0x0000},
77 {RT5677_LOUT1 , 0xa800},
78 {RT5677_IN1 , 0x0000},
79 {RT5677_MICBIAS , 0x0000},
80 {RT5677_SLIMBUS_PARAM , 0x0000},
81 {RT5677_SLIMBUS_RX , 0x0000},
82 {RT5677_SLIMBUS_CTRL , 0x0000},
83 {RT5677_SIDETONE_CTRL , 0x000b},
84 {RT5677_ANA_DAC1_2_3_SRC , 0x0000},
85 {RT5677_IF_DSP_DAC3_4_MIXER , 0x1111},
86 {RT5677_DAC4_DIG_VOL , 0xafaf},
87 {RT5677_DAC3_DIG_VOL , 0xafaf},
88 {RT5677_DAC1_DIG_VOL , 0xafaf},
89 {RT5677_DAC2_DIG_VOL , 0xafaf},
90 {RT5677_IF_DSP_DAC2_MIXER , 0x0011},
91 {RT5677_STO1_ADC_DIG_VOL , 0x2f2f},
92 {RT5677_MONO_ADC_DIG_VOL , 0x2f2f},
93 {RT5677_STO1_2_ADC_BST , 0x0000},
94 {RT5677_STO2_ADC_DIG_VOL , 0x2f2f},
95 {RT5677_ADC_BST_CTRL2 , 0x0000},
96 {RT5677_STO3_4_ADC_BST , 0x0000},
97 {RT5677_STO3_ADC_DIG_VOL , 0x2f2f},
98 {RT5677_STO4_ADC_DIG_VOL , 0x2f2f},
99 {RT5677_STO4_ADC_MIXER , 0xd4c0},
100 {RT5677_STO3_ADC_MIXER , 0xd4c0},
101 {RT5677_STO2_ADC_MIXER , 0xd4c0},
102 {RT5677_STO1_ADC_MIXER , 0xd4c0},
103 {RT5677_MONO_ADC_MIXER , 0xd4d1},
104 {RT5677_ADC_IF_DSP_DAC1_MIXER , 0x8080},
105 {RT5677_STO1_DAC_MIXER , 0xaaaa},
106 {RT5677_MONO_DAC_MIXER , 0xaaaa},
107 {RT5677_DD1_MIXER , 0xaaaa},
108 {RT5677_DD2_MIXER , 0xaaaa},
109 {RT5677_IF3_DATA , 0x0000},
110 {RT5677_IF4_DATA , 0x0000},
111 {RT5677_PDM_OUT_CTRL , 0x8888},
112 {RT5677_PDM_DATA_CTRL1 , 0x0000},
113 {RT5677_PDM_DATA_CTRL2 , 0x0000},
114 {RT5677_PDM1_DATA_CTRL2 , 0x0000},
115 {RT5677_PDM1_DATA_CTRL3 , 0x0000},
116 {RT5677_PDM1_DATA_CTRL4 , 0x0000},
117 {RT5677_PDM2_DATA_CTRL2 , 0x0000},
118 {RT5677_PDM2_DATA_CTRL3 , 0x0000},
119 {RT5677_PDM2_DATA_CTRL4 , 0x0000},
120 {RT5677_TDM1_CTRL1 , 0x0300},
121 {RT5677_TDM1_CTRL2 , 0x0000},
122 {RT5677_TDM1_CTRL3 , 0x4000},
123 {RT5677_TDM1_CTRL4 , 0x0123},
124 {RT5677_TDM1_CTRL5 , 0x4567},
125 {RT5677_TDM2_CTRL1 , 0x0300},
126 {RT5677_TDM2_CTRL2 , 0x0000},
127 {RT5677_TDM2_CTRL3 , 0x4000},
128 {RT5677_TDM2_CTRL4 , 0x0123},
129 {RT5677_TDM2_CTRL5 , 0x4567},
130 {RT5677_I2C_MASTER_CTRL1 , 0x0001},
131 {RT5677_I2C_MASTER_CTRL2 , 0x0000},
132 {RT5677_I2C_MASTER_CTRL3 , 0x0000},
133 {RT5677_I2C_MASTER_CTRL4 , 0x0000},
134 {RT5677_I2C_MASTER_CTRL5 , 0x0000},
135 {RT5677_I2C_MASTER_CTRL6 , 0x0000},
136 {RT5677_I2C_MASTER_CTRL7 , 0x0000},
137 {RT5677_I2C_MASTER_CTRL8 , 0x0000},
138 {RT5677_DMIC_CTRL1 , 0x1505},
139 {RT5677_DMIC_CTRL2 , 0x0055},
140 {RT5677_HAP_GENE_CTRL1 , 0x0111},
141 {RT5677_HAP_GENE_CTRL2 , 0x0064},
142 {RT5677_HAP_GENE_CTRL3 , 0xef0e},
143 {RT5677_HAP_GENE_CTRL4 , 0xf0f0},
144 {RT5677_HAP_GENE_CTRL5 , 0xef0e},
145 {RT5677_HAP_GENE_CTRL6 , 0xf0f0},
146 {RT5677_HAP_GENE_CTRL7 , 0xef0e},
147 {RT5677_HAP_GENE_CTRL8 , 0xf0f0},
148 {RT5677_HAP_GENE_CTRL9 , 0xf000},
149 {RT5677_HAP_GENE_CTRL10 , 0x0000},
150 {RT5677_PWR_DIG1 , 0x0000},
151 {RT5677_PWR_DIG2 , 0x0000},
152 {RT5677_PWR_ANLG1 , 0x0055},
153 {RT5677_PWR_ANLG2 , 0x0000},
154 {RT5677_PWR_DSP1 , 0x0001},
155 {RT5677_PWR_DSP_ST , 0x0000},
156 {RT5677_PWR_DSP2 , 0x0000},
157 {RT5677_ADC_DAC_HPF_CTRL1 , 0x0e00},
158 {RT5677_PRIV_INDEX , 0x0000},
159 {RT5677_PRIV_DATA , 0x0000},
160 {RT5677_I2S4_SDP , 0x8000},
161 {RT5677_I2S1_SDP , 0x8000},
162 {RT5677_I2S2_SDP , 0x8000},
163 {RT5677_I2S3_SDP , 0x8000},
164 {RT5677_CLK_TREE_CTRL1 , 0x1111},
165 {RT5677_CLK_TREE_CTRL2 , 0x1111},
166 {RT5677_CLK_TREE_CTRL3 , 0x0000},
167 {RT5677_PLL1_CTRL1 , 0x0000},
168 {RT5677_PLL1_CTRL2 , 0x0000},
169 {RT5677_PLL2_CTRL1 , 0x0c60},
170 {RT5677_PLL2_CTRL2 , 0x2000},
171 {RT5677_GLB_CLK1 , 0x0000},
172 {RT5677_GLB_CLK2 , 0x0000},
173 {RT5677_ASRC_1 , 0x0000},
174 {RT5677_ASRC_2 , 0x0000},
175 {RT5677_ASRC_3 , 0x0000},
176 {RT5677_ASRC_4 , 0x0000},
177 {RT5677_ASRC_5 , 0x0000},
178 {RT5677_ASRC_6 , 0x0000},
179 {RT5677_ASRC_7 , 0x0000},
180 {RT5677_ASRC_8 , 0x0000},
181 {RT5677_ASRC_9 , 0x0000},
182 {RT5677_ASRC_10 , 0x0000},
183 {RT5677_ASRC_11 , 0x0000},
184 {RT5677_ASRC_12 , 0x0018},
185 {RT5677_ASRC_13 , 0x0000},
186 {RT5677_ASRC_14 , 0x0000},
187 {RT5677_ASRC_15 , 0x0000},
188 {RT5677_ASRC_16 , 0x0000},
189 {RT5677_ASRC_17 , 0x0000},
190 {RT5677_ASRC_18 , 0x0000},
191 {RT5677_ASRC_19 , 0x0000},
192 {RT5677_ASRC_20 , 0x0000},
193 {RT5677_ASRC_21 , 0x000c},
194 {RT5677_ASRC_22 , 0x0000},
195 {RT5677_ASRC_23 , 0x0000},
196 {RT5677_VAD_CTRL1 , 0x2184},
197 {RT5677_VAD_CTRL2 , 0x010a},
198 {RT5677_VAD_CTRL3 , 0x0aea},
199 {RT5677_VAD_CTRL4 , 0x000c},
200 {RT5677_VAD_CTRL5 , 0x0000},
201 {RT5677_DSP_INB_CTRL1 , 0x0000},
202 {RT5677_DSP_INB_CTRL2 , 0x0000},
203 {RT5677_DSP_IN_OUTB_CTRL , 0x0000},
204 {RT5677_DSP_OUTB0_1_DIG_VOL , 0x2f2f},
205 {RT5677_DSP_OUTB2_3_DIG_VOL , 0x2f2f},
206 {RT5677_DSP_OUTB4_5_DIG_VOL , 0x2f2f},
207 {RT5677_DSP_OUTB6_7_DIG_VOL , 0x2f2f},
208 {RT5677_ADC_EQ_CTRL1 , 0x6000},
209 {RT5677_ADC_EQ_CTRL2 , 0x0000},
210 {RT5677_EQ_CTRL1 , 0xc000},
211 {RT5677_EQ_CTRL2 , 0x0000},
212 {RT5677_EQ_CTRL3 , 0x0000},
213 {RT5677_SOFT_VOL_ZERO_CROSS1 , 0x0009},
214 {RT5677_JD_CTRL1 , 0x0000},
215 {RT5677_JD_CTRL2 , 0x0000},
216 {RT5677_JD_CTRL3 , 0x0000},
217 {RT5677_IRQ_CTRL1 , 0x0000},
218 {RT5677_IRQ_CTRL2 , 0x0000},
219 {RT5677_GPIO_ST , 0x0000},
220 {RT5677_GPIO_CTRL1 , 0x0000},
221 {RT5677_GPIO_CTRL2 , 0x0000},
222 {RT5677_GPIO_CTRL3 , 0x0000},
223 {RT5677_STO1_ADC_HI_FILTER1 , 0xb320},
224 {RT5677_STO1_ADC_HI_FILTER2 , 0x0000},
225 {RT5677_MONO_ADC_HI_FILTER1 , 0xb300},
226 {RT5677_MONO_ADC_HI_FILTER2 , 0x0000},
227 {RT5677_STO2_ADC_HI_FILTER1 , 0xb300},
228 {RT5677_STO2_ADC_HI_FILTER2 , 0x0000},
229 {RT5677_STO3_ADC_HI_FILTER1 , 0xb300},
230 {RT5677_STO3_ADC_HI_FILTER2 , 0x0000},
231 {RT5677_STO4_ADC_HI_FILTER1 , 0xb300},
232 {RT5677_STO4_ADC_HI_FILTER2 , 0x0000},
233 {RT5677_MB_DRC_CTRL1 , 0x0f20},
234 {RT5677_DRC1_CTRL1 , 0x001f},
235 {RT5677_DRC1_CTRL2 , 0x020c},
236 {RT5677_DRC1_CTRL3 , 0x1f00},
237 {RT5677_DRC1_CTRL4 , 0x0000},
238 {RT5677_DRC1_CTRL5 , 0x0000},
239 {RT5677_DRC1_CTRL6 , 0x0029},
240 {RT5677_DRC2_CTRL1 , 0x001f},
241 {RT5677_DRC2_CTRL2 , 0x020c},
242 {RT5677_DRC2_CTRL3 , 0x1f00},
243 {RT5677_DRC2_CTRL4 , 0x0000},
244 {RT5677_DRC2_CTRL5 , 0x0000},
245 {RT5677_DRC2_CTRL6 , 0x0029},
246 {RT5677_DRC1_HL_CTRL1 , 0x8000},
247 {RT5677_DRC1_HL_CTRL2 , 0x0200},
248 {RT5677_DRC2_HL_CTRL1 , 0x8000},
249 {RT5677_DRC2_HL_CTRL2 , 0x0200},
250 {RT5677_DSP_INB1_SRC_CTRL1 , 0x5800},
251 {RT5677_DSP_INB1_SRC_CTRL2 , 0x0000},
252 {RT5677_DSP_INB1_SRC_CTRL3 , 0x0000},
253 {RT5677_DSP_INB1_SRC_CTRL4 , 0x0800},
254 {RT5677_DSP_INB2_SRC_CTRL1 , 0x5800},
255 {RT5677_DSP_INB2_SRC_CTRL2 , 0x0000},
256 {RT5677_DSP_INB2_SRC_CTRL3 , 0x0000},
257 {RT5677_DSP_INB2_SRC_CTRL4 , 0x0800},
258 {RT5677_DSP_INB3_SRC_CTRL1 , 0x5800},
259 {RT5677_DSP_INB3_SRC_CTRL2 , 0x0000},
260 {RT5677_DSP_INB3_SRC_CTRL3 , 0x0000},
261 {RT5677_DSP_INB3_SRC_CTRL4 , 0x0800},
262 {RT5677_DSP_OUTB1_SRC_CTRL1 , 0x5800},
263 {RT5677_DSP_OUTB1_SRC_CTRL2 , 0x0000},
264 {RT5677_DSP_OUTB1_SRC_CTRL3 , 0x0000},
265 {RT5677_DSP_OUTB1_SRC_CTRL4 , 0x0800},
266 {RT5677_DSP_OUTB2_SRC_CTRL1 , 0x5800},
267 {RT5677_DSP_OUTB2_SRC_CTRL2 , 0x0000},
268 {RT5677_DSP_OUTB2_SRC_CTRL3 , 0x0000},
269 {RT5677_DSP_OUTB2_SRC_CTRL4 , 0x0800},
270 {RT5677_DSP_OUTB_0123_MIXER_CTRL, 0xfefe},
271 {RT5677_DSP_OUTB_45_MIXER_CTRL , 0xfefe},
272 {RT5677_DSP_OUTB_67_MIXER_CTRL , 0xfefe},
273 {RT5677_DIG_MISC , 0x0000},
274 {RT5677_GEN_CTRL1 , 0x0000},
275 {RT5677_GEN_CTRL2 , 0x0000},
276 {RT5677_VENDOR_ID , 0x0000},
277 {RT5677_VENDOR_ID1 , 0x10ec},
278 {RT5677_VENDOR_ID2 , 0x6327},
285 for (i = 0; i < ARRAY_SIZE(rt5677_ranges); i++) { in rt5677_volatile_register()
334 for (i = 0; i < ARRAY_SIZE(rt5677_ranges); i++) { in rt5677_readable_register()
558 * Returns 0 for success or negative error code.
570 if (ret < 0) { in rt5677_dsp_mode_i2c_write_addr()
576 addr & 0xffff); in rt5677_dsp_mode_i2c_write_addr()
577 if (ret < 0) { in rt5677_dsp_mode_i2c_write_addr()
584 if (ret < 0) { in rt5677_dsp_mode_i2c_write_addr()
590 value & 0xffff); in rt5677_dsp_mode_i2c_write_addr()
591 if (ret < 0) { in rt5677_dsp_mode_i2c_write_addr()
598 if (ret < 0) { in rt5677_dsp_mode_i2c_write_addr()
616 * Returns 0 for success or negative error code.
629 if (ret < 0) { in rt5677_dsp_mode_i2c_read_addr()
635 addr & 0xffff); in rt5677_dsp_mode_i2c_read_addr()
636 if (ret < 0) { in rt5677_dsp_mode_i2c_read_addr()
642 0x0002); in rt5677_dsp_mode_i2c_read_addr()
643 if (ret < 0) { in rt5677_dsp_mode_i2c_read_addr()
665 * Returns 0 for success or negative error code.
670 return rt5677_dsp_mode_i2c_write_addr(rt5677, 0x18020000 + reg * 2, in rt5677_dsp_mode_i2c_write()
671 value, 0x0001); in rt5677_dsp_mode_i2c_write()
681 * Returns 0 for success or negative error code.
686 int ret = rt5677_dsp_mode_i2c_read_addr(rt5677, 0x18020000 + reg * 2, in rt5677_dsp_mode_i2c_read()
689 *value &= 0xffff; in rt5677_dsp_mode_i2c_read()
702 RT5677_PWR_DSP, 0x0); in rt5677_set_dsp_mode()
731 regmap_write(rt5677->regmap, RT5677_VAD_CTRL2, 0x013f); in rt5677_set_vad_source()
733 regmap_write(rt5677->regmap, RT5677_VAD_CTRL3, 0x0ae5); in rt5677_set_vad_source()
740 RT5677_VAD_LV_DIFF_MASK, 0x7f << RT5677_VAD_LV_DIFF_SFT); in rt5677_set_vad_source()
757 /* VAD/SAD is not routed to the IRQ output (i.e. MX-BE[14] = 0), but it in rt5677_set_vad_source()
765 0x0f00, 0x0100); in rt5677_set_vad_source()
784 * Isolation for Band 0~7 = disable in rt5677_set_vad_source()
795 /* System Band 0~7 = power on in rt5677_set_vad_source()
808 return 0; in rt5677_set_vad_source()
818 int ret = 0; in rt5677_parse_and_load_dsp()
837 for (i = 0; i < elf_hdr->e_phnum; i++) { in rt5677_parse_and_load_dsp()
840 dev_info(component->dev, "Load 0x%x bytes to 0x%x\n", in rt5677_parse_and_load_dsp()
859 int ret = 0; in rt5677_load_dsp_from_file()
883 schedule_delayed_work(&rt5677->dsp_work, 0); in rt5677_set_dsp_vad()
884 return 0; in rt5677_set_dsp_vad()
916 for (i = 0; i < RT5677_BOOT_RETRY; i++) { in rt5677_dsp_work()
918 if (val == 0x3ff) in rt5677_dsp_work()
922 if (i == RT5677_BOOT_RETRY && val != 0x3ff) { in rt5677_dsp_work()
929 0x0009, 0x0003); in rt5677_dsp_work()
931 0x0019, 0x0003); in rt5677_dsp_work()
933 0x0009, 0x0003); in rt5677_dsp_work()
939 RT5677_PWR_DSP_CPU, 0x0); in rt5677_dsp_work()
952 regmap_write(rt5677->regmap, RT5677_VAD_CTRL1, 0x2184); in rt5677_dsp_work()
962 static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0);
963 static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0);
964 static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
965 static const DECLARE_TLV_DB_SCALE(st_vol_tlv, -4650, 150, 0);
967 /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
969 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
970 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
971 2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
972 3, 5, TLV_DB_SCALE_ITEM(3000, 500, 0),
973 6, 6, TLV_DB_SCALE_ITEM(4400, 0, 0),
974 7, 7, TLV_DB_SCALE_ITEM(5000, 0, 0),
975 8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0)
984 ucontrol->value.integer.value[0] = rt5677->dsp_vad_en_request; in rt5677_dsp_vad_get()
986 return 0; in rt5677_dsp_vad_get()
994 rt5677_set_dsp_vad(component, !!ucontrol->value.integer.value[0]); in rt5677_dsp_vad_put()
996 return 0; in rt5677_dsp_vad_put()
1010 RT5677_L_VOL_SFT, RT5677_R_VOL_SFT, 127, 0, dac_vol_tlv),
1012 RT5677_L_VOL_SFT, RT5677_R_VOL_SFT, 127, 0, dac_vol_tlv),
1014 RT5677_L_VOL_SFT, RT5677_R_VOL_SFT, 127, 0, dac_vol_tlv),
1016 RT5677_L_VOL_SFT, RT5677_R_VOL_SFT, 127, 0, dac_vol_tlv),
1019 SOC_SINGLE_TLV("IN1 Boost", RT5677_IN1, RT5677_BST_SFT1, 8, 0, bst_tlv),
1020 SOC_SINGLE_TLV("IN2 Boost", RT5677_IN1, RT5677_BST_SFT2, 8, 0, bst_tlv),
1035 RT5677_STO1_ADC_L_VOL_SFT, RT5677_STO1_ADC_R_VOL_SFT, 63, 0,
1038 RT5677_STO1_ADC_L_VOL_SFT, RT5677_STO1_ADC_R_VOL_SFT, 63, 0,
1041 RT5677_STO1_ADC_L_VOL_SFT, RT5677_STO1_ADC_R_VOL_SFT, 63, 0,
1044 RT5677_STO1_ADC_L_VOL_SFT, RT5677_STO1_ADC_R_VOL_SFT, 63, 0,
1047 RT5677_MONO_ADC_L_VOL_SFT, RT5677_MONO_ADC_R_VOL_SFT, 63, 0,
1052 RT5677_ST_VOL_SFT, 31, 0, st_vol_tlv),
1056 RT5677_STO1_ADC_L_BST_SFT, RT5677_STO1_ADC_R_BST_SFT, 3, 0,
1059 RT5677_STO2_ADC_L_BST_SFT, RT5677_STO2_ADC_R_BST_SFT, 3, 0,
1062 RT5677_STO3_ADC_L_BST_SFT, RT5677_STO3_ADC_R_BST_SFT, 3, 0,
1065 RT5677_STO4_ADC_L_BST_SFT, RT5677_STO4_ADC_R_BST_SFT, 3, 0,
1068 RT5677_MONO_ADC_L_BST_SFT, RT5677_MONO_ADC_R_BST_SFT, 3, 0,
1071 SOC_SINGLE_EXT("DSP VAD Switch", SND_SOC_NOPM, 0, 1, 0,
1095 if (idx < 0) in set_dmic_clk()
1115 return 0; in is_sys_clk_from_pll()
1129 shift = 0; in is_using_asrc()
1144 return 0; in is_using_asrc()
1148 case 0: in is_using_asrc()
1158 shift = 0; in is_using_asrc()
1174 shift = 0; in is_using_asrc()
1185 return 0; in is_using_asrc()
1190 val = (val >> shift) & 0xf; in is_using_asrc()
1196 return 0; in is_using_asrc()
1210 return 0; in can_use_asrc()
1231 unsigned int asrc3_mask = 0, asrc3_value = 0; in rt5677_sel_asrc_clk_src()
1232 unsigned int asrc4_mask = 0, asrc4_value = 0; in rt5677_sel_asrc_clk_src()
1233 unsigned int asrc5_mask = 0, asrc5_value = 0; in rt5677_sel_asrc_clk_src()
1234 unsigned int asrc6_mask = 0, asrc6_value = 0; in rt5677_sel_asrc_clk_src()
1235 unsigned int asrc7_mask = 0, asrc7_value = 0; in rt5677_sel_asrc_clk_src()
1236 unsigned int asrc8_mask = 0, asrc8_value = 0; in rt5677_sel_asrc_clk_src()
1402 return 0; in rt5677_sel_asrc_clk_src()
1451 return 0; in rt5677_dmic_use_asrc()
1458 return 0; in rt5677_dmic_use_asrc()
1751 /* ADDA1 L/R Source */ /* MX-29 [1:0] */
1764 /*DAC2 L/R Source*/ /* MX-1B [6:4] [2:0] */
1789 /*DAC3 L/R Source*/ /* MX-16 [6:4] [2:0] */
1839 /* In/OutBound Source Pass SRC */ /* MX-A5 [3] [4] [0] [1] [2] */
1905 /* DMIC Source */ /* MX-28 [9:8][1:0] MX-27 MX-26 MX-25 MX-24 [9:8] */
1952 /* Stereo2 ADC Source */ /* MX-26 [0] */
2102 /* InBound6 Source */ /* MX-A3 [2:0] */
2179 /* DAC1/2 Source */ /* MX-15 [1:0] */
2203 /* PDM channel Source */ /* MX-31 [13:12][9:8][5:4][1:0] */
2236 /* TDM IF1/2 SLB ADC1 Data Selection */ /* MX-3C MX-41 [5:4] MX-08 [1:0] */
2340 /* Interface3/4 ADC Data Input */ /* MX-2F [3:0] MX-30 [7:4] */
2360 /* TDM IF1/2 ADC Data Selection */ /* MX-3B MX-40 [7:6][5:4][3:2][1:0] */
2421 /* TDM IF1 ADC Data Selection */ /* MX-3C [2:0] */
2434 /* TDM IF2 ADC Data Selection */ /* MX-41[2:0] */
2447 /* TDM IF1/2 DAC Data Selection */ /* MX-3E[14:12][10:8][6:4][2:0]
2448 MX-3F[14:12][10:8][6:4][2:0]
2449 MX-43[14:12][10:8][6:4][2:0]
2450 MX-44[14:12][10:8][6:4][2:0] */
2581 RT5677_PWR_BST1_P, 0); in rt5677_bst1_event()
2585 return 0; in rt5677_bst1_event()
2588 return 0; in rt5677_bst1_event()
2605 RT5677_PWR_BST2_P, 0); in rt5677_bst2_event()
2609 return 0; in rt5677_bst2_event()
2612 return 0; in rt5677_bst2_event()
2623 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x2); in rt5677_set_pll1_event()
2627 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x0); in rt5677_set_pll1_event()
2631 return 0; in rt5677_set_pll1_event()
2634 return 0; in rt5677_set_pll1_event()
2645 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x2); in rt5677_set_pll2_event()
2649 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x0); in rt5677_set_pll2_event()
2653 return 0; in rt5677_set_pll2_event()
2656 return 0; in rt5677_set_pll2_event()
2676 RT5677_PWR_CLK_MB, 0); in rt5677_set_micbias1_event()
2680 return 0; in rt5677_set_micbias1_event()
2683 return 0; in rt5677_set_micbias1_event()
2703 return 0; in rt5677_if1_adc_tdm_event()
2706 return 0; in rt5677_if1_adc_tdm_event()
2726 return 0; in rt5677_if2_adc_tdm_event()
2729 return 0; in rt5677_if2_adc_tdm_event()
2751 return 0; in rt5677_vref_event()
2754 return 0; in rt5677_vref_event()
2766 return 0; in rt5677_filter_power_event()
2769 return 0; in rt5677_filter_power_event()
2774 0, rt5677_set_pll1_event, SND_SOC_DAPM_PRE_PMU |
2777 0, rt5677_set_pll2_event, SND_SOC_DAPM_PRE_PMU |
2781 SND_SOC_DAPM_SUPPLY_S("I2S1 ASRC", 1, RT5677_ASRC_1, 0, 0, NULL, 0),
2782 SND_SOC_DAPM_SUPPLY_S("I2S2 ASRC", 1, RT5677_ASRC_1, 1, 0, NULL, 0),
2783 SND_SOC_DAPM_SUPPLY_S("I2S3 ASRC", 1, RT5677_ASRC_1, 2, 0, NULL, 0),
2784 SND_SOC_DAPM_SUPPLY_S("I2S4 ASRC", 1, RT5677_ASRC_1, 3, 0, NULL, 0),
2785 SND_SOC_DAPM_SUPPLY_S("DAC STO ASRC", 1, RT5677_ASRC_2, 14, 0,
2787 SND_SOC_DAPM_SUPPLY_S("DAC MONO2 L ASRC", 1, RT5677_ASRC_2, 13, 0, NULL,
2788 0),
2789 SND_SOC_DAPM_SUPPLY_S("DAC MONO2 R ASRC", 1, RT5677_ASRC_2, 12, 0, NULL,
2790 0),
2791 SND_SOC_DAPM_SUPPLY_S("DAC MONO3 L ASRC", 1, RT5677_ASRC_1, 15, 0, NULL,
2792 0),
2793 SND_SOC_DAPM_SUPPLY_S("DAC MONO3 R ASRC", 1, RT5677_ASRC_1, 14, 0, NULL,
2794 0),
2795 SND_SOC_DAPM_SUPPLY_S("DAC MONO4 L ASRC", 1, RT5677_ASRC_1, 13, 0, NULL,
2796 0),
2797 SND_SOC_DAPM_SUPPLY_S("DAC MONO4 R ASRC", 1, RT5677_ASRC_1, 12, 0, NULL,
2798 0),
2799 SND_SOC_DAPM_SUPPLY_S("DMIC STO1 ASRC", 1, RT5677_ASRC_2, 11, 0, NULL,
2800 0),
2801 SND_SOC_DAPM_SUPPLY_S("DMIC STO2 ASRC", 1, RT5677_ASRC_2, 10, 0, NULL,
2802 0),
2803 SND_SOC_DAPM_SUPPLY_S("DMIC STO3 ASRC", 1, RT5677_ASRC_2, 9, 0, NULL,
2804 0),
2805 SND_SOC_DAPM_SUPPLY_S("DMIC STO4 ASRC", 1, RT5677_ASRC_2, 8, 0, NULL,
2806 0),
2807 SND_SOC_DAPM_SUPPLY_S("DMIC MONO L ASRC", 1, RT5677_ASRC_2, 7, 0, NULL,
2808 0),
2809 SND_SOC_DAPM_SUPPLY_S("DMIC MONO R ASRC", 1, RT5677_ASRC_2, 6, 0, NULL,
2810 0),
2811 SND_SOC_DAPM_SUPPLY_S("ADC STO1 ASRC", 1, RT5677_ASRC_2, 5, 0, NULL, 0),
2812 SND_SOC_DAPM_SUPPLY_S("ADC STO2 ASRC", 1, RT5677_ASRC_2, 4, 0, NULL, 0),
2813 SND_SOC_DAPM_SUPPLY_S("ADC STO3 ASRC", 1, RT5677_ASRC_2, 3, 0, NULL, 0),
2814 SND_SOC_DAPM_SUPPLY_S("ADC STO4 ASRC", 1, RT5677_ASRC_2, 2, 0, NULL, 0),
2815 SND_SOC_DAPM_SUPPLY_S("ADC MONO L ASRC", 1, RT5677_ASRC_2, 1, 0, NULL,
2816 0),
2817 SND_SOC_DAPM_SUPPLY_S("ADC MONO R ASRC", 1, RT5677_ASRC_2, 0, 0, NULL,
2818 0),
2823 0, rt5677_set_micbias1_event, SND_SOC_DAPM_PRE_PMD |
2843 SND_SOC_DAPM_PGA("DMIC1", SND_SOC_NOPM, 0, 0, NULL, 0),
2844 SND_SOC_DAPM_PGA("DMIC2", SND_SOC_NOPM, 0, 0, NULL, 0),
2845 SND_SOC_DAPM_PGA("DMIC3", SND_SOC_NOPM, 0, 0, NULL, 0),
2846 SND_SOC_DAPM_PGA("DMIC4", SND_SOC_NOPM, 0, 0, NULL, 0),
2849 RT5677_DMIC_1_EN_SFT, 0, NULL, 0),
2851 RT5677_DMIC_2_EN_SFT, 0, NULL, 0),
2853 RT5677_DMIC_3_EN_SFT, 0, NULL, 0),
2855 RT5677_DMIC_4_EN_SFT, 0, NULL, 0),
2857 SND_SOC_DAPM_SUPPLY("DMIC CLK", SND_SOC_NOPM, 0, 0,
2862 RT5677_PWR_BST1_BIT, 0, NULL, 0, rt5677_bst1_event,
2865 RT5677_PWR_BST2_BIT, 0, NULL, 0, rt5677_bst2_event,
2870 0, 0),
2872 0, 0),
2873 SND_SOC_DAPM_PGA("ADC 1_2", SND_SOC_NOPM, 0, 0, NULL, 0),
2876 RT5677_PWR_ADC_L_BIT, 0, NULL, 0),
2878 RT5677_PWR_ADC_R_BIT, 0, NULL, 0),
2880 RT5677_PWR_ADCFED1_BIT, 0, NULL, 0),
2882 RT5677_PWR_ADCFED2_BIT, 0, NULL, 0),
2885 SND_SOC_DAPM_MUX("Stereo1 DMIC Mux", SND_SOC_NOPM, 0, 0,
2887 SND_SOC_DAPM_MUX("Stereo1 ADC1 Mux", SND_SOC_NOPM, 0, 0,
2889 SND_SOC_DAPM_MUX("Stereo1 ADC2 Mux", SND_SOC_NOPM, 0, 0,
2891 SND_SOC_DAPM_MUX("Stereo2 DMIC Mux", SND_SOC_NOPM, 0, 0,
2893 SND_SOC_DAPM_MUX("Stereo2 ADC1 Mux", SND_SOC_NOPM, 0, 0,
2895 SND_SOC_DAPM_MUX("Stereo2 ADC2 Mux", SND_SOC_NOPM, 0, 0,
2897 SND_SOC_DAPM_MUX("Stereo2 ADC LR Mux", SND_SOC_NOPM, 0, 0,
2899 SND_SOC_DAPM_MUX("Stereo3 DMIC Mux", SND_SOC_NOPM, 0, 0,
2901 SND_SOC_DAPM_MUX("Stereo3 ADC1 Mux", SND_SOC_NOPM, 0, 0,
2903 SND_SOC_DAPM_MUX("Stereo3 ADC2 Mux", SND_SOC_NOPM, 0, 0,
2905 SND_SOC_DAPM_MUX("Stereo4 DMIC Mux", SND_SOC_NOPM, 0, 0,
2907 SND_SOC_DAPM_MUX("Stereo4 ADC1 Mux", SND_SOC_NOPM, 0, 0,
2909 SND_SOC_DAPM_MUX("Stereo4 ADC2 Mux", SND_SOC_NOPM, 0, 0,
2911 SND_SOC_DAPM_MUX("Mono DMIC L Mux", SND_SOC_NOPM, 0, 0,
2913 SND_SOC_DAPM_MUX("Mono DMIC R Mux", SND_SOC_NOPM, 0, 0,
2915 SND_SOC_DAPM_MUX("Mono ADC2 L Mux", SND_SOC_NOPM, 0, 0,
2917 SND_SOC_DAPM_MUX("Mono ADC1 L Mux", SND_SOC_NOPM, 0, 0,
2919 SND_SOC_DAPM_MUX("Mono ADC1 R Mux", SND_SOC_NOPM, 0, 0,
2921 SND_SOC_DAPM_MUX("Mono ADC2 R Mux", SND_SOC_NOPM, 0, 0,
2926 RT5677_PWR_ADC_S1F_BIT, 0, NULL, 0),
2928 RT5677_PWR_ADC_S2F_BIT, 0, NULL, 0),
2930 RT5677_PWR_ADC_S3F_BIT, 0, NULL, 0),
2932 RT5677_PWR_ADC_S4F_BIT, 0, NULL, 0),
2933 SND_SOC_DAPM_MIXER("Sto1 ADC MIXL", SND_SOC_NOPM, 0, 0,
2935 SND_SOC_DAPM_MIXER("Sto1 ADC MIXR", SND_SOC_NOPM, 0, 0,
2937 SND_SOC_DAPM_MIXER("Sto2 ADC MIXL", SND_SOC_NOPM, 0, 0,
2939 SND_SOC_DAPM_MIXER("Sto2 ADC MIXR", SND_SOC_NOPM, 0, 0,
2941 SND_SOC_DAPM_MIXER("Sto3 ADC MIXL", SND_SOC_NOPM, 0, 0,
2943 SND_SOC_DAPM_MIXER("Sto3 ADC MIXR", SND_SOC_NOPM, 0, 0,
2945 SND_SOC_DAPM_MIXER("Sto4 ADC MIXL", SND_SOC_NOPM, 0, 0,
2947 SND_SOC_DAPM_MIXER("Sto4 ADC MIXR", SND_SOC_NOPM, 0, 0,
2950 RT5677_PWR_ADC_MF_L_BIT, 0, NULL, 0),
2951 SND_SOC_DAPM_MIXER("Mono ADC MIXL", SND_SOC_NOPM, 0, 0,
2954 RT5677_PWR_ADC_MF_R_BIT, 0, NULL, 0),
2955 SND_SOC_DAPM_MIXER("Mono ADC MIXR", SND_SOC_NOPM, 0, 0,
2959 SND_SOC_DAPM_PGA("Stereo1 ADC MIXL", SND_SOC_NOPM, 0, 0, NULL, 0),
2960 SND_SOC_DAPM_PGA("Stereo1 ADC MIXR", SND_SOC_NOPM, 0, 0, NULL, 0),
2961 SND_SOC_DAPM_PGA("Stereo1 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2962 SND_SOC_DAPM_PGA("Stereo2 ADC MIXL", SND_SOC_NOPM, 0, 0, NULL, 0),
2963 SND_SOC_DAPM_PGA("Stereo2 ADC MIXR", SND_SOC_NOPM, 0, 0, NULL, 0),
2964 SND_SOC_DAPM_PGA("Stereo2 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2965 SND_SOC_DAPM_PGA("Stereo3 ADC MIXL", SND_SOC_NOPM, 0, 0, NULL, 0),
2966 SND_SOC_DAPM_PGA("Stereo3 ADC MIXR", SND_SOC_NOPM, 0, 0, NULL, 0),
2967 SND_SOC_DAPM_PGA("Stereo3 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2968 SND_SOC_DAPM_PGA("Stereo4 ADC MIXL", SND_SOC_NOPM, 0, 0, NULL, 0),
2969 SND_SOC_DAPM_PGA("Stereo4 ADC MIXR", SND_SOC_NOPM, 0, 0, NULL, 0),
2970 SND_SOC_DAPM_PGA("Stereo4 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2971 SND_SOC_DAPM_PGA("Sto2 ADC LR MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2972 SND_SOC_DAPM_PGA("Mono ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2973 SND_SOC_DAPM_PGA("IF1 ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
2974 SND_SOC_DAPM_PGA("IF2 ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
2977 SND_SOC_DAPM_MUX("IB9 Mux", SND_SOC_NOPM, 0, 0,
2979 SND_SOC_DAPM_MUX("IB8 Mux", SND_SOC_NOPM, 0, 0,
2981 SND_SOC_DAPM_MUX("IB7 Mux", SND_SOC_NOPM, 0, 0,
2983 SND_SOC_DAPM_MUX("IB6 Mux", SND_SOC_NOPM, 0, 0,
2985 SND_SOC_DAPM_MUX("IB45 Mux", SND_SOC_NOPM, 0, 0,
2987 SND_SOC_DAPM_MUX("IB23 Mux", SND_SOC_NOPM, 0, 0,
2989 SND_SOC_DAPM_MUX("IB01 Mux", SND_SOC_NOPM, 0, 0,
2991 SND_SOC_DAPM_MUX("IB45 Bypass Mux", SND_SOC_NOPM, 0, 0,
2993 SND_SOC_DAPM_MUX("IB23 Bypass Mux", SND_SOC_NOPM, 0, 0,
2995 SND_SOC_DAPM_MUX("IB01 Bypass Mux", SND_SOC_NOPM, 0, 0,
2997 SND_SOC_DAPM_MUX("OB23 Bypass Mux", SND_SOC_NOPM, 0, 0,
2999 SND_SOC_DAPM_MUX("OB01 Bypass Mux", SND_SOC_NOPM, 0, 0,
3002 SND_SOC_DAPM_PGA("OB45", SND_SOC_NOPM, 0, 0, NULL, 0),
3003 SND_SOC_DAPM_PGA("OB67", SND_SOC_NOPM, 0, 0, NULL, 0),
3005 SND_SOC_DAPM_PGA("OutBound2", SND_SOC_NOPM, 0, 0, NULL, 0),
3006 SND_SOC_DAPM_PGA("OutBound3", SND_SOC_NOPM, 0, 0, NULL, 0),
3007 SND_SOC_DAPM_PGA("OutBound4", SND_SOC_NOPM, 0, 0, NULL, 0),
3008 SND_SOC_DAPM_PGA("OutBound5", SND_SOC_NOPM, 0, 0, NULL, 0),
3009 SND_SOC_DAPM_PGA("OutBound6", SND_SOC_NOPM, 0, 0, NULL, 0),
3010 SND_SOC_DAPM_PGA("OutBound7", SND_SOC_NOPM, 0, 0, NULL, 0),
3014 RT5677_PWR_I2S1_BIT, 0, NULL, 0),
3015 SND_SOC_DAPM_PGA("IF1 DAC0", SND_SOC_NOPM, 0, 0, NULL, 0),
3016 SND_SOC_DAPM_PGA("IF1 DAC1", SND_SOC_NOPM, 0, 0, NULL, 0),
3017 SND_SOC_DAPM_PGA("IF1 DAC2", SND_SOC_NOPM, 0, 0, NULL, 0),
3018 SND_SOC_DAPM_PGA("IF1 DAC3", SND_SOC_NOPM, 0, 0, NULL, 0),
3019 SND_SOC_DAPM_PGA("IF1 DAC4", SND_SOC_NOPM, 0, 0, NULL, 0),
3020 SND_SOC_DAPM_PGA("IF1 DAC5", SND_SOC_NOPM, 0, 0, NULL, 0),
3021 SND_SOC_DAPM_PGA("IF1 DAC6", SND_SOC_NOPM, 0, 0, NULL, 0),
3022 SND_SOC_DAPM_PGA("IF1 DAC7", SND_SOC_NOPM, 0, 0, NULL, 0),
3023 SND_SOC_DAPM_PGA("IF1 DAC01", SND_SOC_NOPM, 0, 0, NULL, 0),
3024 SND_SOC_DAPM_PGA("IF1 DAC23", SND_SOC_NOPM, 0, 0, NULL, 0),
3025 SND_SOC_DAPM_PGA("IF1 DAC45", SND_SOC_NOPM, 0, 0, NULL, 0),
3026 SND_SOC_DAPM_PGA("IF1 DAC67", SND_SOC_NOPM, 0, 0, NULL, 0),
3027 SND_SOC_DAPM_PGA("IF1 ADC1", SND_SOC_NOPM, 0, 0, NULL, 0),
3028 SND_SOC_DAPM_PGA("IF1 ADC2", SND_SOC_NOPM, 0, 0, NULL, 0),
3029 SND_SOC_DAPM_PGA("IF1 ADC3", SND_SOC_NOPM, 0, 0, NULL, 0),
3030 SND_SOC_DAPM_PGA("IF1 ADC4", SND_SOC_NOPM, 0, 0, NULL, 0),
3033 RT5677_PWR_I2S2_BIT, 0, NULL, 0),
3034 SND_SOC_DAPM_PGA("IF2 DAC0", SND_SOC_NOPM, 0, 0, NULL, 0),
3035 SND_SOC_DAPM_PGA("IF2 DAC1", SND_SOC_NOPM, 0, 0, NULL, 0),
3036 SND_SOC_DAPM_PGA("IF2 DAC2", SND_SOC_NOPM, 0, 0, NULL, 0),
3037 SND_SOC_DAPM_PGA("IF2 DAC3", SND_SOC_NOPM, 0, 0, NULL, 0),
3038 SND_SOC_DAPM_PGA("IF2 DAC4", SND_SOC_NOPM, 0, 0, NULL, 0),
3039 SND_SOC_DAPM_PGA("IF2 DAC5", SND_SOC_NOPM, 0, 0, NULL, 0),
3040 SND_SOC_DAPM_PGA("IF2 DAC6", SND_SOC_NOPM, 0, 0, NULL, 0),
3041 SND_SOC_DAPM_PGA("IF2 DAC7", SND_SOC_NOPM, 0, 0, NULL, 0),
3042 SND_SOC_DAPM_PGA("IF2 DAC01", SND_SOC_NOPM, 0, 0, NULL, 0),
3043 SND_SOC_DAPM_PGA("IF2 DAC23", SND_SOC_NOPM, 0, 0, NULL, 0),
3044 SND_SOC_DAPM_PGA("IF2 DAC45", SND_SOC_NOPM, 0, 0, NULL, 0),
3045 SND_SOC_DAPM_PGA("IF2 DAC67", SND_SOC_NOPM, 0, 0, NULL, 0),
3046 SND_SOC_DAPM_PGA("IF2 ADC1", SND_SOC_NOPM, 0, 0, NULL, 0),
3047 SND_SOC_DAPM_PGA("IF2 ADC2", SND_SOC_NOPM, 0, 0, NULL, 0),
3048 SND_SOC_DAPM_PGA("IF2 ADC3", SND_SOC_NOPM, 0, 0, NULL, 0),
3049 SND_SOC_DAPM_PGA("IF2 ADC4", SND_SOC_NOPM, 0, 0, NULL, 0),
3052 RT5677_PWR_I2S3_BIT, 0, NULL, 0),
3053 SND_SOC_DAPM_PGA("IF3 DAC", SND_SOC_NOPM, 0, 0, NULL, 0),
3054 SND_SOC_DAPM_PGA("IF3 DAC L", SND_SOC_NOPM, 0, 0, NULL, 0),
3055 SND_SOC_DAPM_PGA("IF3 DAC R", SND_SOC_NOPM, 0, 0, NULL, 0),
3056 SND_SOC_DAPM_PGA("IF3 ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
3057 SND_SOC_DAPM_PGA("IF3 ADC L", SND_SOC_NOPM, 0, 0, NULL, 0),
3058 SND_SOC_DAPM_PGA("IF3 ADC R", SND_SOC_NOPM, 0, 0, NULL, 0),
3061 RT5677_PWR_I2S4_BIT, 0, NULL, 0),
3062 SND_SOC_DAPM_PGA("IF4 DAC", SND_SOC_NOPM, 0, 0, NULL, 0),
3063 SND_SOC_DAPM_PGA("IF4 DAC L", SND_SOC_NOPM, 0, 0, NULL, 0),
3064 SND_SOC_DAPM_PGA("IF4 DAC R", SND_SOC_NOPM, 0, 0, NULL, 0),
3065 SND_SOC_DAPM_PGA("IF4 ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
3066 SND_SOC_DAPM_PGA("IF4 ADC L", SND_SOC_NOPM, 0, 0, NULL, 0),
3067 SND_SOC_DAPM_PGA("IF4 ADC R", SND_SOC_NOPM, 0, 0, NULL, 0),
3070 RT5677_PWR_SLB_BIT, 0, NULL, 0),
3071 SND_SOC_DAPM_PGA("SLB DAC0", SND_SOC_NOPM, 0, 0, NULL, 0),
3072 SND_SOC_DAPM_PGA("SLB DAC1", SND_SOC_NOPM, 0, 0, NULL, 0),
3073 SND_SOC_DAPM_PGA("SLB DAC2", SND_SOC_NOPM, 0, 0, NULL, 0),
3074 SND_SOC_DAPM_PGA("SLB DAC3", SND_SOC_NOPM, 0, 0, NULL, 0),
3075 SND_SOC_DAPM_PGA("SLB DAC4", SND_SOC_NOPM, 0, 0, NULL, 0),
3076 SND_SOC_DAPM_PGA("SLB DAC5", SND_SOC_NOPM, 0, 0, NULL, 0),
3077 SND_SOC_DAPM_PGA("SLB DAC6", SND_SOC_NOPM, 0, 0, NULL, 0),
3078 SND_SOC_DAPM_PGA("SLB DAC7", SND_SOC_NOPM, 0, 0, NULL, 0),
3079 SND_SOC_DAPM_PGA("SLB DAC01", SND_SOC_NOPM, 0, 0, NULL, 0),
3080 SND_SOC_DAPM_PGA("SLB DAC23", SND_SOC_NOPM, 0, 0, NULL, 0),
3081 SND_SOC_DAPM_PGA("SLB DAC45", SND_SOC_NOPM, 0, 0, NULL, 0),
3082 SND_SOC_DAPM_PGA("SLB DAC67", SND_SOC_NOPM, 0, 0, NULL, 0),
3083 SND_SOC_DAPM_PGA("SLB ADC1", SND_SOC_NOPM, 0, 0, NULL, 0),
3084 SND_SOC_DAPM_PGA("SLB ADC2", SND_SOC_NOPM, 0, 0, NULL, 0),
3085 SND_SOC_DAPM_PGA("SLB ADC3", SND_SOC_NOPM, 0, 0, NULL, 0),
3086 SND_SOC_DAPM_PGA("SLB ADC4", SND_SOC_NOPM, 0, 0, NULL, 0),
3089 SND_SOC_DAPM_MUX("IF1 ADC1 Mux", SND_SOC_NOPM, 0, 0,
3091 SND_SOC_DAPM_MUX("IF1 ADC2 Mux", SND_SOC_NOPM, 0, 0,
3093 SND_SOC_DAPM_MUX("IF1 ADC3 Mux", SND_SOC_NOPM, 0, 0,
3095 SND_SOC_DAPM_MUX("IF1 ADC4 Mux", SND_SOC_NOPM, 0, 0,
3097 SND_SOC_DAPM_MUX("IF1 ADC1 Swap Mux", SND_SOC_NOPM, 0, 0,
3099 SND_SOC_DAPM_MUX("IF1 ADC2 Swap Mux", SND_SOC_NOPM, 0, 0,
3101 SND_SOC_DAPM_MUX("IF1 ADC3 Swap Mux", SND_SOC_NOPM, 0, 0,
3103 SND_SOC_DAPM_MUX("IF1 ADC4 Swap Mux", SND_SOC_NOPM, 0, 0,
3105 SND_SOC_DAPM_MUX_E("IF1 ADC TDM Swap Mux", SND_SOC_NOPM, 0, 0,
3108 SND_SOC_DAPM_MUX("IF2 ADC1 Mux", SND_SOC_NOPM, 0, 0,
3110 SND_SOC_DAPM_MUX("IF2 ADC2 Mux", SND_SOC_NOPM, 0, 0,
3112 SND_SOC_DAPM_MUX("IF2 ADC3 Mux", SND_SOC_NOPM, 0, 0,
3114 SND_SOC_DAPM_MUX("IF2 ADC4 Mux", SND_SOC_NOPM, 0, 0,
3116 SND_SOC_DAPM_MUX("IF2 ADC1 Swap Mux", SND_SOC_NOPM, 0, 0,
3118 SND_SOC_DAPM_MUX("IF2 ADC2 Swap Mux", SND_SOC_NOPM, 0, 0,
3120 SND_SOC_DAPM_MUX("IF2 ADC3 Swap Mux", SND_SOC_NOPM, 0, 0,
3122 SND_SOC_DAPM_MUX("IF2 ADC4 Swap Mux", SND_SOC_NOPM, 0, 0,
3124 SND_SOC_DAPM_MUX_E("IF2 ADC TDM Swap Mux", SND_SOC_NOPM, 0, 0,
3127 SND_SOC_DAPM_MUX("IF3 ADC Mux", SND_SOC_NOPM, 0, 0,
3129 SND_SOC_DAPM_MUX("IF4 ADC Mux", SND_SOC_NOPM, 0, 0,
3131 SND_SOC_DAPM_MUX("SLB ADC1 Mux", SND_SOC_NOPM, 0, 0,
3133 SND_SOC_DAPM_MUX("SLB ADC2 Mux", SND_SOC_NOPM, 0, 0,
3135 SND_SOC_DAPM_MUX("SLB ADC3 Mux", SND_SOC_NOPM, 0, 0,
3137 SND_SOC_DAPM_MUX("SLB ADC4 Mux", SND_SOC_NOPM, 0, 0,
3140 SND_SOC_DAPM_MUX("IF1 DAC0 Mux", SND_SOC_NOPM, 0, 0,
3142 SND_SOC_DAPM_MUX("IF1 DAC1 Mux", SND_SOC_NOPM, 0, 0,
3144 SND_SOC_DAPM_MUX("IF1 DAC2 Mux", SND_SOC_NOPM, 0, 0,
3146 SND_SOC_DAPM_MUX("IF1 DAC3 Mux", SND_SOC_NOPM, 0, 0,
3148 SND_SOC_DAPM_MUX("IF1 DAC4 Mux", SND_SOC_NOPM, 0, 0,
3150 SND_SOC_DAPM_MUX("IF1 DAC5 Mux", SND_SOC_NOPM, 0, 0,
3152 SND_SOC_DAPM_MUX("IF1 DAC6 Mux", SND_SOC_NOPM, 0, 0,
3154 SND_SOC_DAPM_MUX("IF1 DAC7 Mux", SND_SOC_NOPM, 0, 0,
3157 SND_SOC_DAPM_MUX("IF2 DAC0 Mux", SND_SOC_NOPM, 0, 0,
3159 SND_SOC_DAPM_MUX("IF2 DAC1 Mux", SND_SOC_NOPM, 0, 0,
3161 SND_SOC_DAPM_MUX("IF2 DAC2 Mux", SND_SOC_NOPM, 0, 0,
3163 SND_SOC_DAPM_MUX("IF2 DAC3 Mux", SND_SOC_NOPM, 0, 0,
3165 SND_SOC_DAPM_MUX("IF2 DAC4 Mux", SND_SOC_NOPM, 0, 0,
3167 SND_SOC_DAPM_MUX("IF2 DAC5 Mux", SND_SOC_NOPM, 0, 0,
3169 SND_SOC_DAPM_MUX("IF2 DAC6 Mux", SND_SOC_NOPM, 0, 0,
3171 SND_SOC_DAPM_MUX("IF2 DAC7 Mux", SND_SOC_NOPM, 0, 0,
3175 SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
3176 SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0),
3177 SND_SOC_DAPM_AIF_IN("AIF2RX", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0),
3178 SND_SOC_DAPM_AIF_OUT("AIF2TX", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0),
3179 SND_SOC_DAPM_AIF_IN("AIF3RX", "AIF3 Playback", 0, SND_SOC_NOPM, 0, 0),
3180 SND_SOC_DAPM_AIF_OUT("AIF3TX", "AIF3 Capture", 0, SND_SOC_NOPM, 0, 0),
3181 SND_SOC_DAPM_AIF_IN("AIF4RX", "AIF4 Playback", 0, SND_SOC_NOPM, 0, 0),
3182 SND_SOC_DAPM_AIF_OUT("AIF4TX", "AIF4 Capture", 0, SND_SOC_NOPM, 0, 0),
3183 SND_SOC_DAPM_AIF_IN("SLBRX", "SLIMBus Playback", 0, SND_SOC_NOPM, 0, 0),
3184 SND_SOC_DAPM_AIF_OUT("SLBTX", "SLIMBus Capture", 0, SND_SOC_NOPM, 0, 0),
3185 SND_SOC_DAPM_AIF_OUT("DSPTX", "DSP Buffer", 0, SND_SOC_NOPM, 0, 0),
3188 SND_SOC_DAPM_MUX("Sidetone Mux", SND_SOC_NOPM, 0, 0,
3191 RT5677_ST_EN_SFT, 0, NULL, 0),
3194 SND_SOC_DAPM_MUX("VAD ADC Mux", SND_SOC_NOPM, 0, 0,
3198 SND_SOC_DAPM_PGA("Tensilica DSP", SND_SOC_NOPM, 0, 0, NULL, 0),
3199 SND_SOC_DAPM_MIXER("OB01 MIX", SND_SOC_NOPM, 0, 0,
3201 SND_SOC_DAPM_MIXER("OB23 MIX", SND_SOC_NOPM, 0, 0,
3203 SND_SOC_DAPM_MIXER("OB4 MIX", SND_SOC_NOPM, 0, 0,
3205 SND_SOC_DAPM_MIXER("OB5 MIX", SND_SOC_NOPM, 0, 0,
3207 SND_SOC_DAPM_MIXER("OB6 MIX", SND_SOC_NOPM, 0, 0,
3209 SND_SOC_DAPM_MIXER("OB7 MIX", SND_SOC_NOPM, 0, 0,
3214 SND_SOC_DAPM_MIXER("DAC1 MIXL", SND_SOC_NOPM, 0, 0,
3216 SND_SOC_DAPM_MIXER("DAC1 MIXR", SND_SOC_NOPM, 0, 0,
3218 SND_SOC_DAPM_PGA("DAC1 FS", SND_SOC_NOPM, 0, 0, NULL, 0),
3221 SND_SOC_DAPM_MUX("DAC1 Mux", SND_SOC_NOPM, 0, 0,
3223 SND_SOC_DAPM_MUX("ADDA1 Mux", SND_SOC_NOPM, 0, 0,
3225 SND_SOC_DAPM_MUX("DAC12 SRC Mux", SND_SOC_NOPM, 0, 0,
3227 SND_SOC_DAPM_MUX("DAC3 SRC Mux", SND_SOC_NOPM, 0, 0,
3231 SND_SOC_DAPM_MUX("DAC2 L Mux", SND_SOC_NOPM, 0, 0,
3233 SND_SOC_DAPM_MUX("DAC2 R Mux", SND_SOC_NOPM, 0, 0,
3237 SND_SOC_DAPM_MUX("DAC3 L Mux", SND_SOC_NOPM, 0, 0,
3239 SND_SOC_DAPM_MUX("DAC3 R Mux", SND_SOC_NOPM, 0, 0,
3243 SND_SOC_DAPM_MUX("DAC4 L Mux", SND_SOC_NOPM, 0, 0,
3245 SND_SOC_DAPM_MUX("DAC4 R Mux", SND_SOC_NOPM, 0, 0,
3250 RT5677_PWR_DAC_S1F_BIT, 0, rt5677_filter_power_event,
3253 RT5677_PWR_DAC_M2F_L_BIT, 0, rt5677_filter_power_event,
3256 RT5677_PWR_DAC_M2F_R_BIT, 0, rt5677_filter_power_event,
3259 RT5677_PWR_DAC_M3F_L_BIT, 0, rt5677_filter_power_event,
3262 RT5677_PWR_DAC_M3F_R_BIT, 0, rt5677_filter_power_event,
3265 RT5677_PWR_DAC_M4F_L_BIT, 0, rt5677_filter_power_event,
3268 RT5677_PWR_DAC_M4F_R_BIT, 0, rt5677_filter_power_event,
3271 SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0,
3273 SND_SOC_DAPM_MIXER("Stereo DAC MIXR", SND_SOC_NOPM, 0, 0,
3275 SND_SOC_DAPM_MIXER("Mono DAC MIXL", SND_SOC_NOPM, 0, 0,
3277 SND_SOC_DAPM_MIXER("Mono DAC MIXR", SND_SOC_NOPM, 0, 0,
3279 SND_SOC_DAPM_MIXER("DD1 MIXL", SND_SOC_NOPM, 0, 0,
3281 SND_SOC_DAPM_MIXER("DD1 MIXR", SND_SOC_NOPM, 0, 0,
3283 SND_SOC_DAPM_MIXER("DD2 MIXL", SND_SOC_NOPM, 0, 0,
3285 SND_SOC_DAPM_MIXER("DD2 MIXR", SND_SOC_NOPM, 0, 0,
3287 SND_SOC_DAPM_PGA("Stereo DAC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
3288 SND_SOC_DAPM_PGA("Mono DAC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
3289 SND_SOC_DAPM_PGA("DD1 MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
3290 SND_SOC_DAPM_PGA("DD2 MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
3294 RT5677_PWR_DAC1_BIT, 0),
3296 RT5677_PWR_DAC2_BIT, 0),
3298 RT5677_PWR_DAC3_BIT, 0),
3302 RT5677_PWR_PDM1_BIT, 0, NULL, 0),
3304 RT5677_PWR_PDM2_BIT, 0, NULL, 0),
3315 SND_SOC_DAPM_PGA_S("LOUT1 amp", 0, RT5677_PWR_ANLG1, RT5677_PWR_LO1_BIT,
3316 0, NULL, 0),
3317 SND_SOC_DAPM_PGA_S("LOUT2 amp", 0, RT5677_PWR_ANLG1, RT5677_PWR_LO2_BIT,
3318 0, NULL, 0),
3319 SND_SOC_DAPM_PGA_S("LOUT3 amp", 0, RT5677_PWR_ANLG1, RT5677_PWR_LO3_BIT,
3320 0, NULL, 0),
3322 SND_SOC_DAPM_PGA_S("LOUT1 vref", 1, SND_SOC_NOPM, 0, 0,
3324 SND_SOC_DAPM_PGA_S("LOUT2 vref", 1, SND_SOC_NOPM, 0, 0,
3326 SND_SOC_DAPM_PGA_S("LOUT3 vref", 1, SND_SOC_NOPM, 0, 0,
4292 unsigned int val_len = 0, val_clk, mask_clk; in rt5677_hw_params()
4297 if (pre_div < 0) { in rt5677_hw_params()
4303 if (frame_size < 0) { in rt5677_hw_params()
4370 return 0; in rt5677_hw_params()
4377 unsigned int reg_val = 0; in rt5677_set_dai_fmt()
4385 rt5677->master[dai->id] = 0; in rt5677_set_dai_fmt()
4443 return 0; in rt5677_set_dai_fmt()
4451 unsigned int reg_val = 0; in rt5677_set_dai_sysclk()
4454 return 0; in rt5677_set_dai_sysclk()
4477 return 0; in rt5677_set_dai_sysclk()
4488 * Returns 0 for success or negative error code.
4509 return 0; in rt5677_set_dai_pll()
4514 rt5677->pll_in = 0; in rt5677_set_dai_pll()
4515 rt5677->pll_out = 0; in rt5677_set_dai_pll()
4518 return 0; in rt5677_set_dai_pll()
4557 if (ret < 0) { in rt5677_set_dai_pll()
4563 pll_code.m_bp, (pll_code.m_bp ? 0 : pll_code.m_code), in rt5677_set_dai_pll()
4569 ((pll_code.m_bp ? 0 : pll_code.m_code) << RT5677_PLL_M_SFT) | in rt5677_set_dai_pll()
4576 return 0; in rt5677_set_dai_pll()
4584 unsigned int val = 0, slot_width_25 = 0; in rt5677_set_tdm_slot()
4609 slot_width_25 = 0x8080; in rt5677_set_tdm_slot()
4624 regmap_update_bits(rt5677->regmap, RT5677_TDM1_CTRL1, 0x1f00, in rt5677_set_tdm_slot()
4626 regmap_update_bits(rt5677->regmap, RT5677_DIG_MISC, 0x8000, in rt5677_set_tdm_slot()
4630 regmap_update_bits(rt5677->regmap, RT5677_TDM2_CTRL1, 0x1f00, in rt5677_set_tdm_slot()
4632 regmap_update_bits(rt5677->regmap, RT5677_DIG_MISC, 0x80, in rt5677_set_tdm_slot()
4639 return 0; in rt5677_set_tdm_slot()
4662 0x0f00, 0x0f00); in rt5677_set_bias_level()
4673 0x1, 0x1); in rt5677_set_bias_level()
4693 schedule_delayed_work(&rt5677->dsp_work, 0); in rt5677_set_bias_level()
4697 regmap_update_bits(rt5677->regmap, RT5677_DIG_MISC, 0x1, 0x0); in rt5677_set_bias_level()
4698 regmap_write(rt5677->regmap, RT5677_PWR_DIG1, 0x0000); in rt5677_set_bias_level()
4703 RT5677_PWR_CORE, 0); in rt5677_set_bias_level()
4705 RT5677_PR_BASE + RT5677_BIAS_CUR4, 0x0f00, 0x0000); in rt5677_set_bias_level()
4715 return 0; in rt5677_set_bias_level()
4754 if (ret < 0) in rt5677_gpio_get()
4757 return (value & (0x1 << offset)) >> offset; in rt5677_gpio_get()
4771 * 0 - floating
4785 0x3 << shift, in rt5677_gpio_config()
4786 (value & 0x3) << shift); in rt5677_gpio_config()
4793 0x3 << shift, in rt5677_gpio_config()
4794 (value & 0x3) << shift); in rt5677_gpio_config()
4855 if (ret != 0) in rt5677_init_gpio()
4901 ~RT5677_IRQ_DEBOUNCE_SEL_MASK, 0x0020); in rt5677_probe()
4905 for (i = 0; i < RT5677_GPIO_NUM; i++) in rt5677_probe()
4911 return 0; in rt5677_probe()
4920 regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec); in rt5677_remove()
4921 gpiod_set_value_cansleep(rt5677->pow_ldo2, 0); in rt5677_remove()
4939 gpiod_set_value_cansleep(rt5677->pow_ldo2, 0); in rt5677_suspend()
4943 return 0; in rt5677_suspend()
4951 rt5677->pll_src = 0; in rt5677_resume()
4952 rt5677->pll_in = 0; in rt5677_resume()
4953 rt5677->pll_out = 0; in rt5677_resume()
4955 gpiod_set_value_cansleep(rt5677->reset_pin, 0); in rt5677_resume()
4965 schedule_delayed_work(&rt5677->resume_irq_check, 0); in rt5677_resume()
4968 return 0; in rt5677_resume()
4981 if (reg > 0xff) { in rt5677_read()
4984 reg & 0xff); in rt5677_read()
4994 return 0; in rt5677_read()
5003 if (reg > 0xff) { in rt5677_write()
5006 reg & 0xff); in rt5677_write()
5017 return 0; in rt5677_write()
5323 for (loop = 0; loop < 20; loop++) { in rt5677_irq()
5333 for (i = 0; i < RT5677_IRQ_NUM; i++) { in rt5677_irq()
5382 rt5677_irq(0, rt5677); in rt5677_resume_irq_check()
5394 for (i = 0; i < RT5677_IRQ_NUM; i++) { in rt5677_resume_irq_check()
5453 return 0; in rt5677_irq_map()
5466 unsigned int jd_mask = 0, jd_val = 0; in rt5677_init_irq()
5471 return 0; in rt5677_init_irq()
5490 regmap_update_bits(rt5677->regmap, RT5677_GEN_CTRL1, 0xff, 0xff); in rt5677_init_irq()
5548 if (rt5677->type == 0) in rt5677_i2c_probe()
5604 regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec); in rt5677_i2c_probe()
5608 if (ret != 0) in rt5677_i2c_probe()