Lines Matching +full:0 +full:x2184

48 #define RT5645_DEVICE_ID 0x6308
49 #define RT5650_DEVICE_ID 0x6419
51 #define RT5645_PR_RANGE_BASE (0xff + 1)
52 #define RT5645_PR_SPACING 0x100
54 #define RT5645_PR_BASE (RT5645_PR_RANGE_BASE + (0 * RT5645_PR_SPACING))
64 .range_max = RT5645_PR_BASE + 0xf8,
66 .selector_mask = 0xff,
67 .selector_shift = 0x0,
69 .window_len = 0x1,
74 {RT5645_PR_BASE + 0x3d, 0x3600},
75 {RT5645_PR_BASE + 0x1c, 0xfd70},
76 {RT5645_PR_BASE + 0x20, 0x611f},
77 {RT5645_PR_BASE + 0x21, 0x4040},
78 {RT5645_PR_BASE + 0x23, 0x0004},
79 {RT5645_ASRC_4, 0x0120},
83 {0xf6, 0x0100},
87 { 0x00, 0x0000 },
88 { 0x01, 0xc8c8 },
89 { 0x02, 0xc8c8 },
90 { 0x03, 0xc8c8 },
91 { 0x0a, 0x0002 },
92 { 0x0b, 0x2827 },
93 { 0x0c, 0xe000 },
94 { 0x0d, 0x0000 },
95 { 0x0e, 0x0000 },
96 { 0x0f, 0x0808 },
97 { 0x14, 0x3333 },
98 { 0x16, 0x4b00 },
99 { 0x18, 0x018b },
100 { 0x19, 0xafaf },
101 { 0x1a, 0xafaf },
102 { 0x1b, 0x0001 },
103 { 0x1c, 0x2f2f },
104 { 0x1d, 0x2f2f },
105 { 0x1e, 0x0000 },
106 { 0x20, 0x0000 },
107 { 0x27, 0x7060 },
108 { 0x28, 0x7070 },
109 { 0x29, 0x8080 },
110 { 0x2a, 0x5656 },
111 { 0x2b, 0x5454 },
112 { 0x2c, 0xaaa0 },
113 { 0x2d, 0x0000 },
114 { 0x2f, 0x1002 },
115 { 0x31, 0x5000 },
116 { 0x32, 0x0000 },
117 { 0x33, 0x0000 },
118 { 0x34, 0x0000 },
119 { 0x35, 0x0000 },
120 { 0x3b, 0x0000 },
121 { 0x3c, 0x007f },
122 { 0x3d, 0x0000 },
123 { 0x3e, 0x007f },
124 { 0x3f, 0x0000 },
125 { 0x40, 0x001f },
126 { 0x41, 0x0000 },
127 { 0x42, 0x001f },
128 { 0x45, 0x6000 },
129 { 0x46, 0x003e },
130 { 0x47, 0x003e },
131 { 0x48, 0xf807 },
132 { 0x4a, 0x0004 },
133 { 0x4d, 0x0000 },
134 { 0x4e, 0x0000 },
135 { 0x4f, 0x01ff },
136 { 0x50, 0x0000 },
137 { 0x51, 0x0000 },
138 { 0x52, 0x01ff },
139 { 0x53, 0xf000 },
140 { 0x56, 0x0111 },
141 { 0x57, 0x0064 },
142 { 0x58, 0xef0e },
143 { 0x59, 0xf0f0 },
144 { 0x5a, 0xef0e },
145 { 0x5b, 0xf0f0 },
146 { 0x5c, 0xef0e },
147 { 0x5d, 0xf0f0 },
148 { 0x5e, 0xf000 },
149 { 0x5f, 0x0000 },
150 { 0x61, 0x0300 },
151 { 0x62, 0x0000 },
152 { 0x63, 0x00c2 },
153 { 0x64, 0x0000 },
154 { 0x65, 0x0000 },
155 { 0x66, 0x0000 },
156 { 0x6a, 0x0000 },
157 { 0x6c, 0x0aaa },
158 { 0x70, 0x8000 },
159 { 0x71, 0x8000 },
160 { 0x72, 0x8000 },
161 { 0x73, 0x7770 },
162 { 0x74, 0x3e00 },
163 { 0x75, 0x2409 },
164 { 0x76, 0x000a },
165 { 0x77, 0x0c00 },
166 { 0x78, 0x0000 },
167 { 0x79, 0x0123 },
168 { 0x80, 0x0000 },
169 { 0x81, 0x0000 },
170 { 0x82, 0x0000 },
171 { 0x83, 0x0000 },
172 { 0x84, 0x0000 },
173 { 0x85, 0x0000 },
174 { 0x8a, 0x0120 },
175 { 0x8e, 0x0004 },
176 { 0x8f, 0x1100 },
177 { 0x90, 0x0646 },
178 { 0x91, 0x0c06 },
179 { 0x93, 0x0000 },
180 { 0x94, 0x0200 },
181 { 0x95, 0x0000 },
182 { 0x9a, 0x2184 },
183 { 0x9b, 0x010a },
184 { 0x9c, 0x0aea },
185 { 0x9d, 0x000c },
186 { 0x9e, 0x0400 },
187 { 0xa0, 0xa0a8 },
188 { 0xa1, 0x0059 },
189 { 0xa2, 0x0001 },
190 { 0xae, 0x6000 },
191 { 0xaf, 0x0000 },
192 { 0xb0, 0x6000 },
193 { 0xb1, 0x0000 },
194 { 0xb2, 0x0000 },
195 { 0xb3, 0x001f },
196 { 0xb4, 0x020c },
197 { 0xb5, 0x1f00 },
198 { 0xb6, 0x0000 },
199 { 0xbb, 0x0000 },
200 { 0xbc, 0x0000 },
201 { 0xbd, 0x0000 },
202 { 0xbe, 0x0000 },
203 { 0xbf, 0x3100 },
204 { 0xc0, 0x0000 },
205 { 0xc1, 0x0000 },
206 { 0xc2, 0x0000 },
207 { 0xc3, 0x2000 },
208 { 0xcd, 0x0000 },
209 { 0xce, 0x0000 },
210 { 0xcf, 0x1813 },
211 { 0xd0, 0x0690 },
212 { 0xd1, 0x1c17 },
213 { 0xd3, 0xb320 },
214 { 0xd4, 0x0000 },
215 { 0xd6, 0x0400 },
216 { 0xd9, 0x0809 },
217 { 0xda, 0x0000 },
218 { 0xdb, 0x0003 },
219 { 0xdc, 0x0049 },
220 { 0xdd, 0x001b },
221 { 0xdf, 0x0008 },
222 { 0xe0, 0x4000 },
223 { 0xe6, 0x8000 },
224 { 0xe7, 0x0200 },
225 { 0xec, 0xb300 },
226 { 0xed, 0x0000 },
227 { 0xf0, 0x001f },
228 { 0xf1, 0x020c },
229 { 0xf2, 0x1f00 },
230 { 0xf3, 0x0000 },
231 { 0xf4, 0x4000 },
232 { 0xf8, 0x0000 },
233 { 0xf9, 0x0000 },
234 { 0xfa, 0x2060 },
235 { 0xfb, 0x4040 },
236 { 0xfc, 0x0000 },
237 { 0xfd, 0x0002 },
238 { 0xfe, 0x10ec },
239 { 0xff, 0x6308 },
243 { 0x00, 0x0000 },
244 { 0x01, 0xc8c8 },
245 { 0x02, 0xc8c8 },
246 { 0x03, 0xc8c8 },
247 { 0x0a, 0x0002 },
248 { 0x0b, 0x2827 },
249 { 0x0c, 0xe000 },
250 { 0x0d, 0x0000 },
251 { 0x0e, 0x0000 },
252 { 0x0f, 0x0808 },
253 { 0x14, 0x3333 },
254 { 0x16, 0x4b00 },
255 { 0x18, 0x018b },
256 { 0x19, 0xafaf },
257 { 0x1a, 0xafaf },
258 { 0x1b, 0x0001 },
259 { 0x1c, 0x2f2f },
260 { 0x1d, 0x2f2f },
261 { 0x1e, 0x0000 },
262 { 0x20, 0x0000 },
263 { 0x27, 0x7060 },
264 { 0x28, 0x7070 },
265 { 0x29, 0x8080 },
266 { 0x2a, 0x5656 },
267 { 0x2b, 0x5454 },
268 { 0x2c, 0xaaa0 },
269 { 0x2d, 0x0000 },
270 { 0x2f, 0x5002 },
271 { 0x31, 0x5000 },
272 { 0x32, 0x0000 },
273 { 0x33, 0x0000 },
274 { 0x34, 0x0000 },
275 { 0x35, 0x0000 },
276 { 0x3b, 0x0000 },
277 { 0x3c, 0x007f },
278 { 0x3d, 0x0000 },
279 { 0x3e, 0x007f },
280 { 0x3f, 0x0000 },
281 { 0x40, 0x001f },
282 { 0x41, 0x0000 },
283 { 0x42, 0x001f },
284 { 0x45, 0x6000 },
285 { 0x46, 0x003e },
286 { 0x47, 0x003e },
287 { 0x48, 0xf807 },
288 { 0x4a, 0x0004 },
289 { 0x4d, 0x0000 },
290 { 0x4e, 0x0000 },
291 { 0x4f, 0x01ff },
292 { 0x50, 0x0000 },
293 { 0x51, 0x0000 },
294 { 0x52, 0x01ff },
295 { 0x53, 0xf000 },
296 { 0x56, 0x0111 },
297 { 0x57, 0x0064 },
298 { 0x58, 0xef0e },
299 { 0x59, 0xf0f0 },
300 { 0x5a, 0xef0e },
301 { 0x5b, 0xf0f0 },
302 { 0x5c, 0xef0e },
303 { 0x5d, 0xf0f0 },
304 { 0x5e, 0xf000 },
305 { 0x5f, 0x0000 },
306 { 0x61, 0x0300 },
307 { 0x62, 0x0000 },
308 { 0x63, 0x00c2 },
309 { 0x64, 0x0000 },
310 { 0x65, 0x0000 },
311 { 0x66, 0x0000 },
312 { 0x6a, 0x0000 },
313 { 0x6c, 0x0aaa },
314 { 0x70, 0x8000 },
315 { 0x71, 0x8000 },
316 { 0x72, 0x8000 },
317 { 0x73, 0x7770 },
318 { 0x74, 0x3e00 },
319 { 0x75, 0x2409 },
320 { 0x76, 0x000a },
321 { 0x77, 0x0c00 },
322 { 0x78, 0x0000 },
323 { 0x79, 0x0123 },
324 { 0x7a, 0x0123 },
325 { 0x80, 0x0000 },
326 { 0x81, 0x0000 },
327 { 0x82, 0x0000 },
328 { 0x83, 0x0000 },
329 { 0x84, 0x0000 },
330 { 0x85, 0x0000 },
331 { 0x8a, 0x0120 },
332 { 0x8e, 0x0004 },
333 { 0x8f, 0x1100 },
334 { 0x90, 0x0646 },
335 { 0x91, 0x0c06 },
336 { 0x93, 0x0000 },
337 { 0x94, 0x0200 },
338 { 0x95, 0x0000 },
339 { 0x9a, 0x2184 },
340 { 0x9b, 0x010a },
341 { 0x9c, 0x0aea },
342 { 0x9d, 0x000c },
343 { 0x9e, 0x0400 },
344 { 0xa0, 0xa0a8 },
345 { 0xa1, 0x0059 },
346 { 0xa2, 0x0001 },
347 { 0xae, 0x6000 },
348 { 0xaf, 0x0000 },
349 { 0xb0, 0x6000 },
350 { 0xb1, 0x0000 },
351 { 0xb2, 0x0000 },
352 { 0xb3, 0x001f },
353 { 0xb4, 0x020c },
354 { 0xb5, 0x1f00 },
355 { 0xb6, 0x0000 },
356 { 0xbb, 0x0000 },
357 { 0xbc, 0x0000 },
358 { 0xbd, 0x0000 },
359 { 0xbe, 0x0000 },
360 { 0xbf, 0x3100 },
361 { 0xc0, 0x0000 },
362 { 0xc1, 0x0000 },
363 { 0xc2, 0x0000 },
364 { 0xc3, 0x2000 },
365 { 0xcd, 0x0000 },
366 { 0xce, 0x0000 },
367 { 0xcf, 0x1813 },
368 { 0xd0, 0x0690 },
369 { 0xd1, 0x1c17 },
370 { 0xd3, 0xb320 },
371 { 0xd4, 0x0000 },
372 { 0xd6, 0x0400 },
373 { 0xd9, 0x0809 },
374 { 0xda, 0x0000 },
375 { 0xdb, 0x0003 },
376 { 0xdc, 0x0049 },
377 { 0xdd, 0x001b },
378 { 0xdf, 0x0008 },
379 { 0xe0, 0x4000 },
380 { 0xe6, 0x8000 },
381 { 0xe7, 0x0200 },
382 { 0xec, 0xb300 },
383 { 0xed, 0x0000 },
384 { 0xf0, 0x001f },
385 { 0xf1, 0x020c },
386 { 0xf2, 0x1f00 },
387 { 0xf3, 0x0000 },
388 { 0xf4, 0x4000 },
389 { 0xf8, 0x0000 },
390 { 0xf9, 0x0000 },
391 { 0xfa, 0x2060 },
392 { 0xfb, 0x4040 },
393 { 0xfc, 0x0000 },
394 { 0xfd, 0x0002 },
395 { 0xfe, 0x10ec },
396 { 0xff, 0x6308 },
419 /* 0 = IN2N; 1 = GPIO5; 2 = GPIO11 */
421 /* 0 = IN2P; 1 = GPIO6; 2 = GPIO10; 3 = GPIO12 */
470 return snd_soc_component_write(component, RT5645_RESET, 0); in rt5645_reset()
477 for (i = 0; i < ARRAY_SIZE(rt5645_ranges); i++) { in rt5645_volatile_register()
513 for (i = 0; i < ARRAY_SIZE(rt5645_ranges); i++) { in rt5645_readable_register()
664 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
665 static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0);
666 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
667 static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0);
668 static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
670 /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
672 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
673 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0),
674 2, 2, TLV_DB_SCALE_ITEM(2400, 0, 0),
675 3, 5, TLV_DB_SCALE_ITEM(3000, 500, 0),
676 6, 6, TLV_DB_SCALE_ITEM(4400, 0, 0),
677 7, 7, TLV_DB_SCALE_ITEM(5000, 0, 0),
678 8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0)
681 /* {-6, -4.5, -3, -1.5, 0, 0.82, 1.58, 2.28} dB */
683 0, 4, TLV_DB_SCALE_ITEM(-600, 150, 0),
684 5, 5, TLV_DB_SCALE_ITEM(82, 0, 0),
685 6, 6, TLV_DB_SCALE_ITEM(158, 0, 0),
686 7, 7, TLV_DB_SCALE_ITEM(228, 0, 0)
695 return 0; in rt5645_hweq_info()
707 for (i = 0; i < RT5645_HWEQ_NUM; i++) { in rt5645_hweq_get()
712 return 0; in rt5645_hweq_get()
717 if ((reg >= 0x1a4 && reg <= 0x1cd) || (reg >= 0x1e5 && reg <= 0x1f8) || in rt5645_validate_hweq()
733 for (i = 0; i < RT5645_HWEQ_NUM; i++) { in rt5645_hweq_put()
739 for (i = RT5645_HWEQ_NUM - 1; i >= 0; i--) { in rt5645_hweq_put()
740 if (rt5645->eq_param[i].reg == 0) in rt5645_hweq_put()
743 return 0; in rt5645_hweq_put()
748 for (i = 0; i < RT5645_HWEQ_NUM; i++) { in rt5645_hweq_put()
750 rt5645->eq_param[i].reg != 0) in rt5645_hweq_put()
751 return 0; in rt5645_hweq_put()
752 else if (rt5645->eq_param[i].reg == 0) in rt5645_hweq_put()
756 return 0; in rt5645_hweq_put()
802 RT5645_SPK_G_CLSD_SFT, 7, 0, spk_clsd_tlv),
822 RT5645_L_VOL_SFT + 1, RT5645_R_VOL_SFT + 1, 87, 0, dac_vol_tlv),
824 RT5645_L_VOL_SFT + 1, RT5645_R_VOL_SFT + 1, 87, 0, dac_vol_tlv),
828 RT5645_BST_SFT1, 12, 0, bst_tlv),
830 RT5645_BST_SFT2, 8, 0, bst_tlv),
840 RT5645_L_VOL_SFT + 1, RT5645_R_VOL_SFT + 1, 63, 0, adc_vol_tlv),
844 RT5645_L_VOL_SFT + 1, RT5645_R_VOL_SFT + 1, 63, 0, adc_vol_tlv),
848 RT5645_STO1_ADC_L_BST_SFT, RT5645_STO1_ADC_R_BST_SFT, 3, 0,
851 RT5645_MONO_ADC_L_BST_SFT, RT5645_MONO_ADC_R_BST_SFT, 3, 0,
881 if (idx < 0) in set_dmic_clk()
900 return 0; in is_sys_clk_from_pll()
910 case 0: in is_using_asrc()
912 shift = 0; in is_using_asrc()
920 shift = 0; in is_using_asrc()
935 return 0; in is_using_asrc()
938 val = (snd_soc_component_read(component, reg) >> shift) & 0xf; in is_using_asrc()
946 return 0; in is_using_asrc()
956 for (i = 0; i < RT5645_HWEQ_NUM; i++) { in rt5645_enable_hweq()
964 return 0; in rt5645_enable_hweq()
984 unsigned int asrc2_mask = 0; in rt5645_sel_asrc_clk_src()
985 unsigned int asrc2_value = 0; in rt5645_sel_asrc_clk_src()
986 unsigned int asrc3_mask = 0; in rt5645_sel_asrc_clk_src()
987 unsigned int asrc3_value = 0; in rt5645_sel_asrc_clk_src()
1044 return 0; in rt5645_sel_asrc_clk_src()
1293 /*DAC2 L/R source*/ /* MX-1B [6:4] [2:0] */
1388 /* MX-28 [1:0] */
1431 /* MX-78 [4:0] */
1464 0, rt5650_if1_adc_in_src);
1511 /* MX-79 [14:12][10:8][6:4][2:0] */
1535 RT5645_TDM_CTRL_3, 0, rt5645_tdm_dac_swap_select);
1540 /* MX-7a [14:12][10:8][6:4][2:0] */
1560 RT5650_TDM_CTRL_4, 0, rt5645_tdm_dac_swap_select);
1584 /* MX-2d [1] [0] */
1677 if (hp_amp_power_count <= 0) { in hp_amp_power()
1679 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x3100); in hp_amp_power()
1681 0x0e06); in hp_amp_power()
1682 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x000d); in hp_amp_power()
1684 RT5645_HP_DCC_INT1, 0x9f01); in hp_amp_power()
1685 for (i = 0; i < 20; i++) { in hp_amp_power()
1689 if (!(val & 0x8000)) in hp_amp_power()
1695 0x3e, 0x7400); in hp_amp_power()
1696 snd_soc_component_write(component, RT5645_DEPOP_M3, 0x0737); in hp_amp_power()
1698 RT5645_MAMP_INT_REG2, 0xfc00); in hp_amp_power()
1699 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); in hp_amp_power()
1705 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x000d); in hp_amp_power()
1707 RT5645_HP_DCC_INT1, 0x9f01); in hp_amp_power()
1711 RT5645_PWR_FV1 | RT5645_PWR_FV2, 0); in hp_amp_power()
1729 0x14, 0x1aaa); in hp_amp_power()
1731 0x24, 0x0430); in hp_amp_power()
1737 if (hp_amp_power_count <= 0) { in hp_amp_power()
1740 0x3e, 0x7400); in hp_amp_power()
1741 snd_soc_component_write(component, RT5645_DEPOP_M3, 0x0737); in hp_amp_power()
1743 RT5645_MAMP_INT_REG2, 0xfc00); in hp_amp_power()
1744 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); in hp_amp_power()
1746 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x0001); in hp_amp_power()
1757 snd_soc_component_write(component, RT5645_DEPOP_M1, 0x0000); in hp_amp_power()
1760 RT5645_PWR_HA, 0); in hp_amp_power()
1762 RT5645_DEPOP_MASK, 0); in hp_amp_power()
1786 RT5645_MAMP_INT_REG2, 0xfc00); in rt5645_hp_event()
1813 RT5645_MAMP_INT_REG2, 0xfc00); in rt5645_hp_event()
1824 hp_amp_power(component, 0); in rt5645_hp_event()
1828 return 0; in rt5645_hp_event()
1831 return 0; in rt5645_hp_event()
1854 snd_soc_component_write(component, RT5645_EQ_CTRL2, 0); in rt5645_spk_event()
1857 RT5645_PWR_CLS_D_L, 0); in rt5645_spk_event()
1861 return 0; in rt5645_spk_event()
1864 return 0; in rt5645_spk_event()
1878 RT5645_L_MUTE | RT5645_R_MUTE, 0); in rt5645_lout_event()
1886 RT5645_PWR_LM, 0); in rt5645_lout_event()
1887 hp_amp_power(component, 0); in rt5645_lout_event()
1891 return 0; in rt5645_lout_event()
1894 return 0; in rt5645_lout_event()
1910 RT5645_PWR_BST2_P, 0); in rt5645_bst2_event()
1914 return 0; in rt5645_bst2_event()
1917 return 0; in rt5645_bst2_event()
1939 return 0; in rt5645_set_micbias1_event()
1942 return 0; in rt5645_set_micbias1_event()
1964 return 0; in rt5645_set_micbias2_event()
1967 return 0; in rt5645_set_micbias2_event()
1972 RT5645_PWR_LDO2_BIT, 0, NULL, 0),
1974 RT5645_PWR_PLL_BIT, 0, NULL, 0),
1977 RT5645_PWR_JD1_BIT, 0, NULL, 0),
1979 RT5645_PWR_MIC_DET_BIT, 0, NULL, 0),
1983 11, 0, NULL, 0),
1985 12, 0, NULL, 0),
1987 10, 0, NULL, 0),
1989 9, 0, NULL, 0),
1991 8, 0, NULL, 0),
1993 7, 0, NULL, 0),
1995 5, 0, NULL, 0),
1997 4, 0, NULL, 0),
1999 3, 0, NULL, 0),
2001 1, 0, NULL, 0),
2003 0, 0, NULL, 0),
2008 RT5645_PWR_MB1_BIT, 0, rt5645_set_micbias1_event,
2011 RT5645_PWR_MB2_BIT, 0, rt5645_set_micbias2_event,
2026 SND_SOC_DAPM_PGA("DMIC1", SND_SOC_NOPM, 0, 0, NULL, 0),
2027 SND_SOC_DAPM_PGA("DMIC2", SND_SOC_NOPM, 0, 0, NULL, 0),
2028 SND_SOC_DAPM_SUPPLY("DMIC CLK", SND_SOC_NOPM, 0, 0,
2031 RT5645_DMIC_1_EN_SFT, 0, NULL, 0),
2033 RT5645_DMIC_2_EN_SFT, 0, NULL, 0),
2036 RT5645_PWR_BST1_BIT, 0, NULL, 0),
2038 RT5645_PWR_BST2_BIT, 0, NULL, 0, rt5645_bst2_event,
2042 RT5645_PWR_IN_L_BIT, 0, NULL, 0),
2044 RT5645_PWR_IN_R_BIT, 0, NULL, 0),
2047 0, rt5645_rec_l_mix, ARRAY_SIZE(rt5645_rec_l_mix)),
2049 0, rt5645_rec_r_mix, ARRAY_SIZE(rt5645_rec_r_mix)),
2051 SND_SOC_DAPM_ADC("ADC L", NULL, SND_SOC_NOPM, 0, 0),
2052 SND_SOC_DAPM_ADC("ADC R", NULL, SND_SOC_NOPM, 0, 0),
2055 RT5645_PWR_ADC_L_BIT, 0, NULL, 0),
2057 RT5645_PWR_ADC_R_BIT, 0, NULL, 0),
2060 SND_SOC_DAPM_MUX("Stereo1 DMIC Mux", SND_SOC_NOPM, 0, 0,
2062 SND_SOC_DAPM_MUX("Stereo1 ADC L2 Mux", SND_SOC_NOPM, 0, 0,
2064 SND_SOC_DAPM_MUX("Stereo1 ADC R2 Mux", SND_SOC_NOPM, 0, 0,
2066 SND_SOC_DAPM_MUX("Stereo1 ADC L1 Mux", SND_SOC_NOPM, 0, 0,
2068 SND_SOC_DAPM_MUX("Stereo1 ADC R1 Mux", SND_SOC_NOPM, 0, 0,
2070 SND_SOC_DAPM_MUX("Mono DMIC L Mux", SND_SOC_NOPM, 0, 0,
2072 SND_SOC_DAPM_MUX("Mono DMIC R Mux", SND_SOC_NOPM, 0, 0,
2074 SND_SOC_DAPM_MUX("Mono ADC L2 Mux", SND_SOC_NOPM, 0, 0,
2076 SND_SOC_DAPM_MUX("Mono ADC L1 Mux", SND_SOC_NOPM, 0, 0,
2078 SND_SOC_DAPM_MUX("Mono ADC R1 Mux", SND_SOC_NOPM, 0, 0,
2080 SND_SOC_DAPM_MUX("Mono ADC R2 Mux", SND_SOC_NOPM, 0, 0,
2085 RT5645_PWR_ADC_S1F_BIT, 0, NULL, 0),
2086 SND_SOC_DAPM_MIXER_E("Sto1 ADC MIXL", SND_SOC_NOPM, 0, 0,
2088 NULL, 0),
2089 SND_SOC_DAPM_MIXER_E("Sto1 ADC MIXR", SND_SOC_NOPM, 0, 0,
2091 NULL, 0),
2093 RT5645_PWR_ADC_MF_L_BIT, 0, NULL, 0),
2094 SND_SOC_DAPM_MIXER_E("Mono ADC MIXL", SND_SOC_NOPM, 0, 0,
2096 NULL, 0),
2098 RT5645_PWR_ADC_MF_R_BIT, 0, NULL, 0),
2099 SND_SOC_DAPM_MIXER_E("Mono ADC MIXR", SND_SOC_NOPM, 0, 0,
2101 NULL, 0),
2104 SND_SOC_DAPM_PGA("Stereo1 ADC MIXL", SND_SOC_NOPM, 0, 0, NULL, 0),
2105 SND_SOC_DAPM_PGA("Stereo1 ADC MIXR", SND_SOC_NOPM, 0, 0, NULL, 0),
2106 SND_SOC_DAPM_PGA("Sto2 ADC LR MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
2107 SND_SOC_DAPM_PGA("VAD_ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
2108 SND_SOC_DAPM_PGA("IF_ADC1", SND_SOC_NOPM, 0, 0, NULL, 0),
2109 SND_SOC_DAPM_PGA("IF_ADC2", SND_SOC_NOPM, 0, 0, NULL, 0),
2110 SND_SOC_DAPM_PGA("IF1_ADC1", SND_SOC_NOPM, 0, 0, NULL, 0),
2111 SND_SOC_DAPM_PGA("IF1_ADC2", SND_SOC_NOPM, 0, 0, NULL, 0),
2112 SND_SOC_DAPM_PGA("IF1_ADC3", SND_SOC_NOPM, 0, 0, NULL, 0),
2113 SND_SOC_DAPM_PGA("IF1_ADC4", SND_SOC_NOPM, 0, 0, NULL, 0),
2117 0, 0, &rt5645_if2_adc_in_mux),
2121 RT5645_PWR_I2S1_BIT, 0, NULL, 0),
2122 SND_SOC_DAPM_PGA("IF1 DAC0", SND_SOC_NOPM, 0, 0, NULL, 0),
2123 SND_SOC_DAPM_PGA("IF1 DAC1", SND_SOC_NOPM, 0, 0, NULL, 0),
2124 SND_SOC_DAPM_PGA("IF1 DAC2", SND_SOC_NOPM, 0, 0, NULL, 0),
2125 SND_SOC_DAPM_PGA("IF1 DAC3", SND_SOC_NOPM, 0, 0, NULL, 0),
2126 SND_SOC_DAPM_PGA("IF1 ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
2127 SND_SOC_DAPM_PGA("IF1 ADC L", SND_SOC_NOPM, 0, 0, NULL, 0),
2128 SND_SOC_DAPM_PGA("IF1 ADC R", SND_SOC_NOPM, 0, 0, NULL, 0),
2130 RT5645_PWR_I2S2_BIT, 0, NULL, 0),
2131 SND_SOC_DAPM_PGA("IF2 DAC", SND_SOC_NOPM, 0, 0, NULL, 0),
2132 SND_SOC_DAPM_PGA("IF2 DAC L", SND_SOC_NOPM, 0, 0, NULL, 0),
2133 SND_SOC_DAPM_PGA("IF2 DAC R", SND_SOC_NOPM, 0, 0, NULL, 0),
2134 SND_SOC_DAPM_PGA("IF2 ADC", SND_SOC_NOPM, 0, 0, NULL, 0),
2138 0, 0, &rt5645_vad_adc_mux),
2141 SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
2142 SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0),
2143 SND_SOC_DAPM_AIF_IN("AIF2RX", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0),
2144 SND_SOC_DAPM_AIF_OUT("AIF2TX", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0),
2148 SND_SOC_DAPM_MIXER("DAC1 MIXL", SND_SOC_NOPM, 0, 0,
2150 SND_SOC_DAPM_MIXER("DAC1 MIXR", SND_SOC_NOPM, 0, 0,
2154 SND_SOC_DAPM_MUX("DAC L2 Mux", SND_SOC_NOPM, 0, 0, &rt5645_dac_l2_mux),
2155 SND_SOC_DAPM_MUX("DAC R2 Mux", SND_SOC_NOPM, 0, 0, &rt5645_dac_r2_mux),
2157 RT5645_PWR_DAC_L2_BIT, 0, NULL, 0),
2159 RT5645_PWR_DAC_R2_BIT, 0, NULL, 0),
2161 SND_SOC_DAPM_MUX("DAC1 L Mux", SND_SOC_NOPM, 0, 0, &rt5645_dac1l_mux),
2162 SND_SOC_DAPM_MUX("DAC1 R Mux", SND_SOC_NOPM, 0, 0, &rt5645_dac1r_mux),
2166 RT5645_PWR_DAC_S1F_BIT, 0, NULL, 0),
2168 RT5645_PWR_DAC_MF_L_BIT, 0, NULL, 0),
2170 RT5645_PWR_DAC_MF_R_BIT, 0, NULL, 0),
2171 SND_SOC_DAPM_MIXER("Stereo DAC MIXL", SND_SOC_NOPM, 0, 0,
2173 SND_SOC_DAPM_MIXER("Stereo DAC MIXR", SND_SOC_NOPM, 0, 0,
2175 SND_SOC_DAPM_MIXER("Mono DAC MIXL", SND_SOC_NOPM, 0, 0,
2177 SND_SOC_DAPM_MIXER("Mono DAC MIXR", SND_SOC_NOPM, 0, 0,
2179 SND_SOC_DAPM_MIXER("DAC MIXL", SND_SOC_NOPM, 0, 0,
2181 SND_SOC_DAPM_MIXER("DAC MIXR", SND_SOC_NOPM, 0, 0,
2186 0),
2188 0),
2190 0),
2192 0),
2195 0, rt5645_spk_l_mix, ARRAY_SIZE(rt5645_spk_l_mix)),
2197 0, rt5645_spk_r_mix, ARRAY_SIZE(rt5645_spk_r_mix)),
2199 0, rt5645_out_l_mix, ARRAY_SIZE(rt5645_out_l_mix)),
2201 0, rt5645_out_r_mix, ARRAY_SIZE(rt5645_out_r_mix)),
2203 SND_SOC_DAPM_SWITCH("SPKVOL L", RT5645_PWR_VOL, RT5645_PWR_SV_L_BIT, 0,
2205 SND_SOC_DAPM_SWITCH("SPKVOL R", RT5645_PWR_VOL, RT5645_PWR_SV_R_BIT, 0,
2208 0, rt5645_hpvoll_mix, ARRAY_SIZE(rt5645_hpvoll_mix)),
2210 0, rt5645_hpvolr_mix, ARRAY_SIZE(rt5645_hpvolr_mix)),
2212 RT5645_PWR_HM_L_BIT, 0, NULL, 0),
2214 RT5645_PWR_HM_R_BIT, 0, NULL, 0),
2215 SND_SOC_DAPM_PGA("DAC 1", SND_SOC_NOPM, 0, 0, NULL, 0),
2216 SND_SOC_DAPM_PGA("DAC 2", SND_SOC_NOPM, 0, 0, NULL, 0),
2217 SND_SOC_DAPM_PGA("HPOVOL", SND_SOC_NOPM, 0, 0, NULL, 0),
2218 SND_SOC_DAPM_SWITCH("HPOVOL L", SND_SOC_NOPM, 0, 0, &hp_l_vol_control),
2219 SND_SOC_DAPM_SWITCH("HPOVOL R", SND_SOC_NOPM, 0, 0, &hp_r_vol_control),
2222 SND_SOC_DAPM_MIXER("SPOL MIX", SND_SOC_NOPM, 0, 0, rt5645_spo_l_mix,
2224 SND_SOC_DAPM_MIXER("SPOR MIX", SND_SOC_NOPM, 0, 0, rt5645_spo_r_mix,
2226 SND_SOC_DAPM_MIXER("HPO MIX", SND_SOC_NOPM, 0, 0, rt5645_hpo_mix,
2228 SND_SOC_DAPM_MIXER("LOUT MIX", SND_SOC_NOPM, 0, 0, rt5645_lout_mix,
2231 SND_SOC_DAPM_PGA_S("HP amp", 1, SND_SOC_NOPM, 0, 0, rt5645_hp_event,
2233 SND_SOC_DAPM_PGA_S("LOUT amp", 1, SND_SOC_NOPM, 0, 0, rt5645_lout_event,
2235 SND_SOC_DAPM_PGA_S("SPK amp", 2, SND_SOC_NOPM, 0, 0, rt5645_spk_event,
2240 0, NULL, 0),
2241 SND_SOC_DAPM_MUX("PDM1 L Mux", SND_SOC_NOPM, 0, 0, &rt5645_pdm1_l_mux),
2242 SND_SOC_DAPM_MUX("PDM1 R Mux", SND_SOC_NOPM, 0, 0, &rt5645_pdm1_r_mux),
2244 SND_SOC_DAPM_SWITCH("PDM1 L", SND_SOC_NOPM, 0, 0, &pdm1_l_vol_control),
2245 SND_SOC_DAPM_SWITCH("PDM1 R", SND_SOC_NOPM, 0, 0, &pdm1_r_vol_control),
2259 SND_SOC_DAPM_MUX("RT5645 IF1 DAC1 L Mux", SND_SOC_NOPM, 0, 0,
2261 SND_SOC_DAPM_MUX("RT5645 IF1 DAC1 R Mux", SND_SOC_NOPM, 0, 0,
2263 SND_SOC_DAPM_MUX("RT5645 IF1 DAC2 L Mux", SND_SOC_NOPM, 0, 0,
2265 SND_SOC_DAPM_MUX("RT5645 IF1 DAC2 R Mux", SND_SOC_NOPM, 0, 0,
2268 0, 0, &rt5645_if1_adc_in_mux),
2270 0, 0, &rt5645_if1_adc1_in_mux),
2272 0, 0, &rt5645_if1_adc2_in_mux),
2274 0, 0, &rt5645_if1_adc3_in_mux),
2279 0, 0, &rt5650_a_dac1_l_mux),
2281 0, 0, &rt5650_a_dac1_r_mux),
2283 0, 0, &rt5650_a_dac2_l_mux),
2285 0, 0, &rt5650_a_dac2_r_mux),
2288 0, 0, &rt5650_if1_adc1_in_mux),
2290 0, 0, &rt5650_if1_adc2_in_mux),
2292 0, 0, &rt5650_if1_adc3_in_mux),
2294 0, 0, &rt5650_if1_adc_in_mux),
2296 SND_SOC_DAPM_MUX("RT5650 IF1 DAC1 L Mux", SND_SOC_NOPM, 0, 0,
2298 SND_SOC_DAPM_MUX("RT5650 IF1 DAC1 R Mux", SND_SOC_NOPM, 0, 0,
2300 SND_SOC_DAPM_MUX("RT5650 IF1 DAC2 L Mux", SND_SOC_NOPM, 0, 0,
2302 SND_SOC_DAPM_MUX("RT5650 IF1 DAC2 R Mux", SND_SOC_NOPM, 0, 0,
2746 unsigned int val_len = 0, val_clk, mask_clk, dl_sft; in rt5645_hw_params()
2751 if (pre_div < 0) { in rt5645_hw_params()
2756 if (frame_size < 0) { in rt5645_hw_params()
2782 val_len = 0x1; in rt5645_hw_params()
2785 val_len = 0x2; in rt5645_hw_params()
2788 val_len = 0x3; in rt5645_hw_params()
2799 (0x3 << dl_sft), (val_len << dl_sft)); in rt5645_hw_params()
2807 (0x3 << dl_sft), (val_len << dl_sft)); in rt5645_hw_params()
2815 return 0; in rt5645_hw_params()
2822 unsigned int reg_val = 0, pol_sft; in rt5645_set_dai_fmt()
2839 rt5645->master[dai->id] = 0; in rt5645_set_dai_fmt()
2885 return 0; in rt5645_set_dai_fmt()
2893 unsigned int reg_val = 0; in rt5645_set_dai_sysclk()
2896 return 0; in rt5645_set_dai_sysclk()
2919 return 0; in rt5645_set_dai_sysclk()
2932 return 0; in rt5645_set_dai_pll()
2937 rt5645->pll_in = 0; in rt5645_set_dai_pll()
2938 rt5645->pll_out = 0; in rt5645_set_dai_pll()
2941 return 0; in rt5645_set_dai_pll()
2971 if (ret < 0) { in rt5645_set_dai_pll()
2977 pll_code.m_bp, (pll_code.m_bp ? 0 : pll_code.m_code), in rt5645_set_dai_pll()
2983 ((pll_code.m_bp ? 0 : pll_code.m_code) << RT5645_PLL_M_SFT) | in rt5645_set_dai_pll()
2990 return 0; in rt5645_set_dai_pll()
2999 unsigned int mask, val = 0; in rt5645_set_tdm_slot()
3008 mask = 0x8ff0; in rt5645_set_tdm_slot()
3014 mask = 0x7c00; in rt5645_set_tdm_slot()
3056 return 0; in rt5645_set_tdm_slot()
3092 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1140); in rt5645_set_bias_level()
3097 msecs_to_jiffies(0)); in rt5645_set_bias_level()
3102 snd_soc_component_write(component, RT5645_DEPOP_M2, 0x1100); in rt5645_set_bias_level()
3105 RT5645_DIG_GATE_CTRL, 0); in rt5645_set_bias_level()
3109 RT5645_PWR_FV1 | RT5645_PWR_FV2, 0x0); in rt5645_set_bias_level()
3116 return 0; in rt5645_set_bias_level()
3129 snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD1, 0x3, 0x3); in rt5645_enable_push_button_irq()
3131 RT5645_INT_IRQ_ST, 0x8, 0x8); in rt5645_enable_push_button_irq()
3133 RT5650_4BTN_IL_CMD2, 0x8000, 0x8000); in rt5645_enable_push_button_irq()
3138 snd_soc_component_update_bits(component, RT5650_4BTN_IL_CMD2, 0x8000, 0x0); in rt5645_enable_push_button_irq()
3139 snd_soc_component_update_bits(component, RT5645_INT_IRQ_ST, 0x8, 0x0); in rt5645_enable_push_button_irq()
3154 regmap_write(rt5645->regmap, RT5645_CHARGE_PUMP, 0x0e06); in rt5645_jack_detect()
3172 regmap_write(rt5645->regmap, RT5645_JD_CTRL3, 0x00f0); in rt5645_jack_detect()
3179 RT5645_CBJ_MN_JD, 0); in rt5645_jack_detect()
3183 val &= 0x7; in rt5645_jack_detect()
3200 rt5645->jack_type = 0; in rt5645_jack_detect()
3208 RT5645_CBJ_BST1_EN, 0); in rt5645_jack_detect()
3213 if (rt5645->pdata.jd_mode == 0) in rt5645_jack_detect()
3230 pr_debug("val=0x%x\n", val); in rt5645_button_detect()
3231 btn_type = val & 0xfff0; in rt5645_button_detect()
3255 rt5645_irq(0, rt5645); in rt5645_set_jack_detect()
3257 return 0; in rt5645_set_jack_detect()
3265 int val, btn_type, gpio_state = 0, report = 0; in rt5645_jack_detect_work()
3271 case 0: /* Not using rt5645 JD */ in rt5645_jack_detect_work()
3286 val = snd_soc_component_read(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020; in rt5645_jack_detect_work()
3289 val = snd_soc_component_read(rt5645->component, RT5645_INT_IRQ_ST) & 0x1000; in rt5645_jack_detect_work()
3294 if (!val && (rt5645->jack_type == 0)) { /* jack in */ in rt5645_jack_detect_work()
3296 } else if (!val && rt5645->jack_type != 0) { in rt5645_jack_detect_work()
3298 btn_type = 0; in rt5645_jack_detect_work()
3299 if (snd_soc_component_read(rt5645->component, RT5645_INT_IRQ_ST) & 0x4) { in rt5645_jack_detect_work()
3309 case 0x8000: in rt5645_jack_detect_work()
3310 case 0x4000: in rt5645_jack_detect_work()
3311 case 0x2000: in rt5645_jack_detect_work()
3314 case 0x1000: in rt5645_jack_detect_work()
3315 case 0x0800: in rt5645_jack_detect_work()
3316 case 0x0400: in rt5645_jack_detect_work()
3319 case 0x0200: in rt5645_jack_detect_work()
3320 case 0x0100: in rt5645_jack_detect_work()
3321 case 0x0080: in rt5645_jack_detect_work()
3324 case 0x0040: in rt5645_jack_detect_work()
3325 case 0x0020: in rt5645_jack_detect_work()
3326 case 0x0010: in rt5645_jack_detect_work()
3329 case 0x0000: /* unpressed */ in rt5645_jack_detect_work()
3333 "Unexpected button code 0x%04x\n", in rt5645_jack_detect_work()
3338 if (btn_type == 0)/* button release */ in rt5645_jack_detect_work()
3346 report = 0; in rt5645_jack_detect_work()
3348 RT5645_INT_IRQ_ST, 0x1, 0x0); in rt5645_jack_detect_work()
3349 rt5645_jack_detect(rt5645->component, 0); in rt5645_jack_detect_work()
3437 return 0; in rt5645_probe()
3453 return 0; in rt5645_suspend()
3463 return 0; in rt5645_resume()
3584 { "rt5645", 0 },
3585 { "rt5650", 0 },
3601 { "10EC5645", 0 },
3602 { "10EC5648", 0 },
3603 { "10EC5650", 0 },
3604 { "10EC5640", 0 },
3605 { "10EC3270", 0 },
3671 static const struct acpi_gpio_params ef20_hp_detect = { 1, 0, false };
3854 return 0; in rt5645_parse_dt()
3922 for (i = 0; i < ARRAY_SIZE(rt5645->supplies); i++) in rt5645_i2c_probe()
3979 regmap_write(rt5645->regmap, RT5645_RESET, 0); in rt5645_i2c_probe()
3982 rt5645->v_id = val & 0xff; in rt5645_i2c_probe()
3984 regmap_write(rt5645->regmap, RT5645_AD_DA_MIXER, 0x8080); in rt5645_i2c_probe()
3988 if (ret != 0) in rt5645_i2c_probe()
3994 if (ret != 0) in rt5645_i2c_probe()
3999 regmap_update_bits(rt5645->regmap, RT5645_CLSD_OUT_CTRL, 0xc0, 0xc0); in rt5645_i2c_probe()
4118 timer_setup(&rt5645->btn_check_timer, rt5645_btn_check_callback, 0); in rt5645_i2c_probe()
4138 return 0; in rt5645_i2c_probe()
4176 0); in rt5645_i2c_shutdown()
4178 regmap_write(rt5645->regmap, RT5645_RESET, 0); in rt5645_i2c_shutdown()