Lines Matching +full:0 +full:x3b00

34 #define DEVICE_ID 0x6749
50 {RT5682S_I2C_CTRL, 0x0007},
51 {RT5682S_DIG_IN_CTRL_1, 0x0000},
52 {RT5682S_CHOP_DAC_2, 0x2020},
53 {RT5682S_VREF_REC_OP_FB_CAP_CTRL_2, 0x0101},
54 {RT5682S_VREF_REC_OP_FB_CAP_CTRL_1, 0x80c0},
55 {RT5682S_HP_CALIB_CTRL_9, 0x0002},
56 {RT5682S_DEPOP_1, 0x0000},
57 {RT5682S_HP_CHARGE_PUMP_2, 0x3c15},
58 {RT5682S_DAC1_DIG_VOL, 0xfefe},
59 {RT5682S_SAR_IL_CMD_2, 0xac00},
60 {RT5682S_SAR_IL_CMD_3, 0x024c},
61 {RT5682S_CBJ_CTRL_6, 0x0804},
75 {0x0002, 0x8080},
76 {0x0003, 0x0001},
77 {0x0005, 0x0000},
78 {0x0006, 0x0000},
79 {0x0008, 0x8007},
80 {0x000b, 0x0000},
81 {0x000f, 0x4000},
82 {0x0010, 0x4040},
83 {0x0011, 0x0000},
84 {0x0012, 0x0000},
85 {0x0013, 0x1200},
86 {0x0014, 0x200a},
87 {0x0015, 0x0404},
88 {0x0016, 0x0404},
89 {0x0017, 0x05a4},
90 {0x0019, 0xffff},
91 {0x001c, 0x2f2f},
92 {0x001f, 0x0000},
93 {0x0022, 0x5757},
94 {0x0023, 0x0039},
95 {0x0024, 0x000b},
96 {0x0026, 0xc0c4},
97 {0x0029, 0x8080},
98 {0x002a, 0xa0a0},
99 {0x002b, 0x0300},
100 {0x0030, 0x0000},
101 {0x003c, 0x08c0},
102 {0x0044, 0x1818},
103 {0x004b, 0x00c0},
104 {0x004c, 0x0000},
105 {0x004d, 0x0000},
106 {0x0061, 0x00c0},
107 {0x0062, 0x008a},
108 {0x0063, 0x0800},
109 {0x0064, 0x0000},
110 {0x0065, 0x0000},
111 {0x0066, 0x0030},
112 {0x0067, 0x000c},
113 {0x0068, 0x0000},
114 {0x0069, 0x0000},
115 {0x006a, 0x0000},
116 {0x006b, 0x0000},
117 {0x006c, 0x0000},
118 {0x006d, 0x2200},
119 {0x006e, 0x0810},
120 {0x006f, 0xe4de},
121 {0x0070, 0x3320},
122 {0x0071, 0x0000},
123 {0x0073, 0x0000},
124 {0x0074, 0x0000},
125 {0x0075, 0x0002},
126 {0x0076, 0x0001},
127 {0x0079, 0x0000},
128 {0x007a, 0x0000},
129 {0x007b, 0x0000},
130 {0x007c, 0x0100},
131 {0x007e, 0x0000},
132 {0x007f, 0x0000},
133 {0x0080, 0x0000},
134 {0x0083, 0x0000},
135 {0x0084, 0x0000},
136 {0x0085, 0x0000},
137 {0x0086, 0x0005},
138 {0x0087, 0x0000},
139 {0x0088, 0x0000},
140 {0x008c, 0x0003},
141 {0x008e, 0x0060},
142 {0x008f, 0x4da1},
143 {0x0091, 0x1c15},
144 {0x0092, 0x0425},
145 {0x0093, 0x0000},
146 {0x0094, 0x0080},
147 {0x0095, 0x008f},
148 {0x0096, 0x0000},
149 {0x0097, 0x0000},
150 {0x0098, 0x0000},
151 {0x0099, 0x0000},
152 {0x009a, 0x0000},
153 {0x009b, 0x0000},
154 {0x009c, 0x0000},
155 {0x009d, 0x0000},
156 {0x009e, 0x0000},
157 {0x009f, 0x0009},
158 {0x00a0, 0x0000},
159 {0x00a3, 0x0002},
160 {0x00a4, 0x0001},
161 {0x00b6, 0x0000},
162 {0x00b7, 0x0000},
163 {0x00b8, 0x0000},
164 {0x00b9, 0x0002},
165 {0x00be, 0x0000},
166 {0x00c0, 0x0160},
167 {0x00c1, 0x82a0},
168 {0x00c2, 0x0000},
169 {0x00d0, 0x0000},
170 {0x00d2, 0x3300},
171 {0x00d3, 0x2200},
172 {0x00d4, 0x0000},
173 {0x00d9, 0x0000},
174 {0x00da, 0x0000},
175 {0x00db, 0x0000},
176 {0x00dc, 0x00c0},
177 {0x00dd, 0x2220},
178 {0x00de, 0x3131},
179 {0x00df, 0x3131},
180 {0x00e0, 0x3131},
181 {0x00e2, 0x0000},
182 {0x00e3, 0x4000},
183 {0x00e4, 0x0aa0},
184 {0x00e5, 0x3131},
185 {0x00e6, 0x3131},
186 {0x00e7, 0x3131},
187 {0x00e8, 0x3131},
188 {0x00ea, 0xb320},
189 {0x00eb, 0x0000},
190 {0x00f0, 0x0000},
191 {0x00f6, 0x0000},
192 {0x00fa, 0x0000},
193 {0x00fb, 0x0000},
194 {0x00fc, 0x0000},
195 {0x00fd, 0x0000},
196 {0x00fe, 0x10ec},
197 {0x00ff, 0x6749},
198 {0x0100, 0xa000},
199 {0x010b, 0x0066},
200 {0x010c, 0x6666},
201 {0x010d, 0x2202},
202 {0x010e, 0x6666},
203 {0x010f, 0xa800},
204 {0x0110, 0x0006},
205 {0x0111, 0x0460},
206 {0x0112, 0x2000},
207 {0x0113, 0x0200},
208 {0x0117, 0x8000},
209 {0x0118, 0x0303},
210 {0x0125, 0x0020},
211 {0x0132, 0x5026},
212 {0x0136, 0x8000},
213 {0x0139, 0x0005},
214 {0x013a, 0x3030},
215 {0x013b, 0xa000},
216 {0x013c, 0x4110},
217 {0x013f, 0x0000},
218 {0x0145, 0x0022},
219 {0x0146, 0x0000},
220 {0x0147, 0x0000},
221 {0x0148, 0x0000},
222 {0x0156, 0x0022},
223 {0x0157, 0x0303},
224 {0x0158, 0x2222},
225 {0x0159, 0x0000},
226 {0x0160, 0x4ec0},
227 {0x0161, 0x0080},
228 {0x0162, 0x0200},
229 {0x0163, 0x0800},
230 {0x0164, 0x0000},
231 {0x0165, 0x0000},
232 {0x0166, 0x0000},
233 {0x0167, 0x000f},
234 {0x0168, 0x000f},
235 {0x0169, 0x0001},
236 {0x0190, 0x4131},
237 {0x0194, 0x0000},
238 {0x0195, 0x0000},
239 {0x0197, 0x0022},
240 {0x0198, 0x0000},
241 {0x0199, 0x0000},
242 {0x01ac, 0x0000},
243 {0x01ad, 0x0000},
244 {0x01ae, 0x0000},
245 {0x01af, 0x2000},
246 {0x01b0, 0x0000},
247 {0x01b1, 0x0000},
248 {0x01b2, 0x0000},
249 {0x01b3, 0x0017},
250 {0x01b4, 0x004b},
251 {0x01b5, 0x0000},
252 {0x01b6, 0x03e8},
253 {0x01b7, 0x0000},
254 {0x01b8, 0x0000},
255 {0x01b9, 0x0400},
256 {0x01ba, 0xb5b6},
257 {0x01bb, 0x9124},
258 {0x01bc, 0x4924},
259 {0x01bd, 0x0009},
260 {0x01be, 0x0018},
261 {0x01bf, 0x002a},
262 {0x01c0, 0x004c},
263 {0x01c1, 0x0097},
264 {0x01c2, 0x01c3},
265 {0x01c3, 0x03e9},
266 {0x01c4, 0x1389},
267 {0x01c5, 0xc351},
268 {0x01c6, 0x02a0},
269 {0x01c7, 0x0b0f},
270 {0x01c8, 0x402f},
271 {0x01c9, 0x0702},
272 {0x01ca, 0x0000},
273 {0x01cb, 0x0000},
274 {0x01cc, 0x5757},
275 {0x01cd, 0x5757},
276 {0x01ce, 0x5757},
277 {0x01cf, 0x5757},
278 {0x01d0, 0x5757},
279 {0x01d1, 0x5757},
280 {0x01d2, 0x5757},
281 {0x01d3, 0x5757},
282 {0x01d4, 0x5757},
283 {0x01d5, 0x5757},
284 {0x01d6, 0x0000},
285 {0x01d7, 0x0000},
286 {0x01d8, 0x0162},
287 {0x01d9, 0x0007},
288 {0x01da, 0x0000},
289 {0x01db, 0x0004},
290 {0x01dc, 0x0000},
291 {0x01de, 0x7c00},
292 {0x01df, 0x0020},
293 {0x01e0, 0x04c1},
294 {0x01e1, 0x0000},
295 {0x01e2, 0x0000},
296 {0x01e3, 0x0000},
297 {0x01e4, 0x0000},
298 {0x01e5, 0x0000},
299 {0x01e6, 0x0001},
300 {0x01e7, 0x0000},
301 {0x01e8, 0x0000},
302 {0x01eb, 0x0000},
303 {0x01ec, 0x0000},
304 {0x01ed, 0x0000},
305 {0x01ee, 0x0000},
306 {0x01ef, 0x0000},
307 {0x01f0, 0x0000},
308 {0x01f1, 0x0000},
309 {0x01f2, 0x0000},
310 {0x01f3, 0x0000},
311 {0x01f4, 0x0000},
312 {0x0210, 0x6297},
313 {0x0211, 0xa004},
314 {0x0212, 0x0365},
315 {0x0213, 0xf7ff},
316 {0x0214, 0xf24c},
317 {0x0215, 0x0102},
318 {0x0216, 0x00a3},
319 {0x0217, 0x0048},
320 {0x0218, 0xa2c0},
321 {0x0219, 0x0400},
322 {0x021a, 0x00c8},
323 {0x021b, 0x00c0},
324 {0x021c, 0x0000},
325 {0x021d, 0x024c},
326 {0x02fa, 0x0000},
327 {0x02fb, 0x0000},
328 {0x02fc, 0x0000},
329 {0x03fe, 0x0000},
330 {0x03ff, 0x0000},
331 {0x0500, 0x0000},
332 {0x0600, 0x0000},
333 {0x0610, 0x6666},
334 {0x0611, 0xa9aa},
335 {0x0620, 0x6666},
336 {0x0621, 0xa9aa},
337 {0x0630, 0x6666},
338 {0x0631, 0xa9aa},
339 {0x0640, 0x6666},
340 {0x0641, 0xa9aa},
341 {0x07fa, 0x0000},
342 {0x08fa, 0x0000},
343 {0x08fb, 0x0000},
344 {0x0d00, 0x0000},
345 {0x1100, 0x0000},
346 {0x1101, 0x0000},
347 {0x1102, 0x0000},
348 {0x1103, 0x0000},
349 {0x1104, 0x0000},
350 {0x1105, 0x0000},
351 {0x1106, 0x0000},
352 {0x1107, 0x0000},
353 {0x1108, 0x0000},
354 {0x1109, 0x0000},
355 {0x110a, 0x0000},
356 {0x110b, 0x0000},
357 {0x110c, 0x0000},
358 {0x1111, 0x0000},
359 {0x1112, 0x0000},
360 {0x1113, 0x0000},
361 {0x1114, 0x0000},
362 {0x1115, 0x0000},
363 {0x1116, 0x0000},
364 {0x1117, 0x0000},
365 {0x1118, 0x0000},
366 {0x1119, 0x0000},
367 {0x111a, 0x0000},
368 {0x111b, 0x0000},
369 {0x111c, 0x0000},
370 {0x1401, 0x0404},
371 {0x1402, 0x0007},
372 {0x1403, 0x0365},
373 {0x1404, 0x0210},
374 {0x1405, 0x0365},
375 {0x1406, 0x0210},
376 {0x1407, 0x0000},
377 {0x1408, 0x0000},
378 {0x1409, 0x0000},
379 {0x140a, 0x0000},
380 {0x140b, 0x0000},
381 {0x140c, 0x0000},
382 {0x140d, 0x0000},
383 {0x140e, 0x0000},
384 {0x140f, 0x0000},
385 {0x1410, 0x0000},
386 {0x1411, 0x0000},
387 {0x1801, 0x0004},
388 {0x1802, 0x0000},
389 {0x1803, 0x0000},
390 {0x1804, 0x0000},
391 {0x1805, 0x00ff},
392 {0x2c00, 0x0000},
393 {0x3400, 0x0200},
394 {0x3404, 0x0000},
395 {0x3405, 0x0000},
396 {0x3406, 0x0000},
397 {0x3407, 0x0000},
398 {0x3408, 0x0000},
399 {0x3409, 0x0000},
400 {0x340a, 0x0000},
401 {0x340b, 0x0000},
402 {0x340c, 0x0000},
403 {0x340d, 0x0000},
404 {0x340e, 0x0000},
405 {0x340f, 0x0000},
406 {0x3410, 0x0000},
407 {0x3411, 0x0000},
408 {0x3412, 0x0000},
409 {0x3413, 0x0000},
410 {0x3414, 0x0000},
411 {0x3415, 0x0000},
412 {0x3424, 0x0000},
413 {0x3425, 0x0000},
414 {0x3426, 0x0000},
415 {0x3427, 0x0000},
416 {0x3428, 0x0000},
417 {0x3429, 0x0000},
418 {0x342a, 0x0000},
419 {0x342b, 0x0000},
420 {0x342c, 0x0000},
421 {0x342d, 0x0000},
422 {0x342e, 0x0000},
423 {0x342f, 0x0000},
424 {0x3430, 0x0000},
425 {0x3431, 0x0000},
426 {0x3432, 0x0000},
427 {0x3433, 0x0000},
428 {0x3434, 0x0000},
429 {0x3435, 0x0000},
430 {0x3440, 0x6319},
431 {0x3441, 0x3771},
432 {0x3500, 0x0002},
433 {0x3501, 0x5728},
434 {0x3b00, 0x3010},
435 {0x3b01, 0x3300},
436 {0x3b02, 0x2200},
437 {0x3b03, 0x0100},
624 regmap_write(rt5682s->regmap, RT5682S_RESET, 0); in rt5682s_reset()
632 btn_type = val & 0xfff0; in rt5682s_button_detect()
709 snd_soc_component_write(component, RT5682S_IL_CMD_1, 0x0040); in rt5682s_enable_push_button_irq()
744 int jack_type = 0; in rt5682s_headset_detect()
752 RT5682S_PWR_FV1 | RT5682S_PWR_FV2, 0); in rt5682s_headset_detect()
759 snd_soc_component_write(component, RT5682S_SAR_IL_CMD_3, 0x0365); in rt5682s_headset_detect()
773 count = 0; in rt5682s_headset_detect()
779 } while (val == 0 && count < 50); in rt5682s_headset_detect()
784 case 0x1: in rt5682s_headset_detect()
785 case 0x2: in rt5682s_headset_detect()
787 snd_soc_component_write(component, RT5682S_SAR_IL_CMD_3, 0x024c); in rt5682s_headset_detect()
811 RT5682S_PWR_ANLG_1, RT5682S_PWR_VREF2 | RT5682S_PWR_MB, 0); in rt5682s_headset_detect()
815 RT5682S_PWR_CBJ, 0); in rt5682s_headset_detect()
820 jack_type = 0; in rt5682s_headset_detect()
853 if (rt5682s->jack_type == 0) { in rt5682s_jack_detect_handler()
856 rt5682s->irq_work_delay_time = 0; in rt5682s_jack_detect_handler()
869 case 0x8000: in rt5682s_jack_detect_handler()
870 case 0x4000: in rt5682s_jack_detect_handler()
871 case 0x2000: in rt5682s_jack_detect_handler()
874 case 0x1000: in rt5682s_jack_detect_handler()
875 case 0x0800: in rt5682s_jack_detect_handler()
876 case 0x0400: in rt5682s_jack_detect_handler()
879 case 0x0200: in rt5682s_jack_detect_handler()
880 case 0x0100: in rt5682s_jack_detect_handler()
881 case 0x0080: in rt5682s_jack_detect_handler()
884 case 0x0040: in rt5682s_jack_detect_handler()
885 case 0x0020: in rt5682s_jack_detect_handler()
886 case 0x0010: in rt5682s_jack_detect_handler()
889 case 0x0000: /* unpressed */ in rt5682s_jack_detect_handler()
893 "Unexpected button code 0x%04x\n", btn_type); in rt5682s_jack_detect_handler()
899 rt5682s->jack_type = rt5682s_headset_detect(rt5682s->component, 0); in rt5682s_jack_detect_handler()
913 schedule_delayed_work(&rt5682s->jd_check_work, 0); in rt5682s_jack_detect_handler()
925 schedule_delayed_work(&rt5682s->jack_detect_work, 0); in rt5682s_jd_check_handler()
953 RT5682S_POW_JDH, 0); in rt5682s_set_jack_detect()
956 return 0; in rt5682s_set_jack_detect()
1004 RT5682S_POW_JDH, 0); in rt5682s_set_jack_detect()
1012 return 0; in rt5682s_set_jack_detect()
1015 static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -9562, 75, 0);
1016 static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0);
1017 static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
1018 static const DECLARE_TLV_DB_SCALE(cbj_bst_tlv, -1200, 150, 0);
1023 RT5682S_L_VOL_SFT + 1, RT5682S_R_VOL_SFT + 1, 127, 0, dac_vol_tlv),
1027 RT5682S_BST_CBJ_SFT, 35, 0, cbj_bst_tlv),
1033 RT5682S_L_VOL_SFT + 1, RT5682S_R_VOL_SFT + 1, 63, 0, adc_vol_tlv),
1037 RT5682S_STO1_ADC_L_BST_SFT, RT5682S_STO1_ADC_R_BST_SFT, 3, 0, adc_bst_tlv),
1080 return 0; in rt5682s_sel_asrc_clk_src()
1092 return 0; in rt5682s_div_sel()
1095 for (i = 0; i < size - 1; i++) { in rt5682s_div_sel()
1118 if (sclk <= 0 || rate <= 0) in get_clk_info()
1122 for (i = 0; i < ARRAY_SIZE(pd); i++) in get_clk_info()
1155 return 0; in set_dmic_clk()
1172 RT5682S_RSTB_PLLB | RT5682S_PWR_PLLB, 0); in rt5682s_set_pllb_power()
1175 return 0; in rt5682s_set_pllb_power()
1183 int on = 0; in set_pllb_event()
1186 return 0; in set_pllb_event()
1193 return 0; in set_pllb_event()
1209 for (idx = 0; idx < ARRAY_SIZE(div_o); idx++) { in rt5682s_set_filter_clk()
1241 return 0; in set_filter_clk()
1270 RT5682S_PWR_VREF2 | RT5682S_PWR_MB, 0); in set_dmic_power()
1275 return 0; in set_dmic_power()
1303 if (pre_div < 0) { in rt5682s_set_i2s()
1321 int on = 0; in set_i2s_event()
1331 return 0; in set_i2s_event()
1344 return 0; in is_sys_clk_from_plla()
1356 return 0; in is_sys_clk_from_pllb()
1375 return 0; in is_using_asrc()
1378 val = (snd_soc_component_read(component, reg) >> sft) & 0xf; in is_using_asrc()
1384 return 0; in is_using_asrc()
1404 snd_soc_component_write(component, RT5682S_BIAS_CUR_CTRL_11, 0x6666); in rt5682s_hp_amp_event()
1405 snd_soc_component_write(component, RT5682S_BIAS_CUR_CTRL_12, 0xa82a); in rt5682s_hp_amp_event()
1419 RT5682S_HPO_SEL_IP_EN_SW, 0); in rt5682s_hp_amp_event()
1424 RT5682S_CAPLESS_L_EN | RT5682S_CAPLESS_R_EN, 0); in rt5682s_hp_amp_event()
1426 RT5682S_OUT_HP_L_EN | RT5682S_OUT_HP_R_EN, 0); in rt5682s_hp_amp_event()
1430 return 0; in rt5682s_hp_amp_event()
1438 unsigned int delay = 0; in rt5682s_stereo1_adc_mixl_event()
1447 RT5682S_L_MUTE, 0); in rt5682s_stereo1_adc_mixl_event()
1455 return 0; in rt5682s_stereo1_adc_mixl_event()
1465 return 0; in sar_power_event()
1476 return 0; in sar_power_event()
1624 0, 2, 4, 6,
1628 "Slot 0", "Slot 2", "Slot 4", "Slot 6"
1639 /* MX-2B [4], MX-2B [0]*/
1673 RT5682S_PWR_LDO_MB1_BIT, 0, NULL, 0),
1675 RT5682S_PWR_LDO_MB2_BIT, 0, NULL, 0),
1677 RT5682S_PWR_LDO_BIT, 0, NULL, 0),
1680 SND_SOC_DAPM_SUPPLY_S("PLLA_LDO", 0, RT5682S_PWR_ANLG_3,
1681 RT5682S_PWR_LDO_PLLA_BIT, 0, NULL, 0),
1682 SND_SOC_DAPM_SUPPLY_S("PLLA_BIAS", 0, RT5682S_PWR_ANLG_3,
1683 RT5682S_PWR_BIAS_PLLA_BIT, 0, NULL, 0),
1684 SND_SOC_DAPM_SUPPLY_S("PLLA", 0, RT5682S_PWR_ANLG_3,
1685 RT5682S_PWR_PLLA_BIT, 0, NULL, 0),
1687 RT5682S_RSTB_PLLA_BIT, 0, NULL, 0),
1688 SND_SOC_DAPM_SUPPLY("PLLB", SND_SOC_NOPM, 0, 0,
1693 RT5682S_DAC_STO1_ASRC_SFT, 0, NULL, 0),
1695 RT5682S_ADC_STO1_ASRC_SFT, 0, NULL, 0),
1697 RT5682S_AD_ASRC_SFT, 0, NULL, 0),
1699 RT5682S_DA_ASRC_SFT, 0, NULL, 0),
1701 RT5682S_DMIC_ASRC_SFT, 0, NULL, 0),
1705 RT5682S_PWR_MB1_BIT, 0, NULL, 0),
1707 RT5682S_PWR_MB2_BIT, 0, NULL, 0),
1715 SND_SOC_DAPM_SUPPLY("DMIC CLK", SND_SOC_NOPM, 0, 0,
1717 SND_SOC_DAPM_SUPPLY("DMIC1 Power", RT5682S_DMIC_CTRL_1, RT5682S_DMIC_1_EN_SFT, 0,
1721 SND_SOC_DAPM_PGA("BST1 CBJ", SND_SOC_NOPM, 0, 0, NULL, 0),
1724 SND_SOC_DAPM_MIXER("RECMIX1L", SND_SOC_NOPM, 0, 0, rt5682s_rec1_l_mix,
1726 SND_SOC_DAPM_MIXER("RECMIX1R", SND_SOC_NOPM, 0, 0, rt5682s_rec1_r_mix,
1729 RT5682S_PWR_RM1_L_BIT, 0, NULL, 0),
1731 RT5682S_PWR_RM1_R_BIT, 0, NULL, 0),
1734 SND_SOC_DAPM_ADC("ADC1 L", NULL, SND_SOC_NOPM, 0, 0),
1735 SND_SOC_DAPM_ADC("ADC1 R", NULL, SND_SOC_NOPM, 0, 0),
1738 RT5682S_PWR_ADC_L1_BIT, 0, NULL, 0),
1740 RT5682S_PWR_ADC_R1_BIT, 0, NULL, 0),
1742 RT5682S_CKGEN_ADC1_SFT, 0, NULL, 0),
1745 SND_SOC_DAPM_MUX("Stereo1 ADC L1 Mux", SND_SOC_NOPM, 0, 0,
1747 SND_SOC_DAPM_MUX("Stereo1 ADC R1 Mux", SND_SOC_NOPM, 0, 0,
1749 SND_SOC_DAPM_MUX("Stereo1 ADC L2 Mux", SND_SOC_NOPM, 0, 0,
1751 SND_SOC_DAPM_MUX("Stereo1 ADC R2 Mux", SND_SOC_NOPM, 0, 0,
1753 SND_SOC_DAPM_MUX("Stereo1 ADC L Mux", SND_SOC_NOPM, 0, 0,
1755 SND_SOC_DAPM_MUX("Stereo1 ADC R Mux", SND_SOC_NOPM, 0, 0,
1757 SND_SOC_DAPM_MUX("IF1_ADC Mux", SND_SOC_NOPM, 0, 0,
1762 RT5682S_PWR_ADC_S1F_BIT, 0, set_filter_clk, SND_SOC_DAPM_PRE_PMU),
1763 SND_SOC_DAPM_MIXER_E("Stereo1 ADC MIXL", SND_SOC_NOPM, 0, 0,
1772 SND_SOC_DAPM_PGA("Stereo1 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0),
1775 SND_SOC_DAPM_SUPPLY("I2S1", SND_SOC_NOPM, 0, 0,
1777 SND_SOC_DAPM_SUPPLY("I2S2", SND_SOC_NOPM, 0, 0,
1779 SND_SOC_DAPM_PGA("IF1 DAC1 L", SND_SOC_NOPM, 0, 0, NULL, 0),
1780 SND_SOC_DAPM_PGA("IF1 DAC1 R", SND_SOC_NOPM, 0, 0, NULL, 0),
1783 SND_SOC_DAPM_MUX("IF1 01 ADC Swap Mux", SND_SOC_NOPM, 0, 0,
1785 SND_SOC_DAPM_MUX("IF1 23 ADC Swap Mux", SND_SOC_NOPM, 0, 0,
1787 SND_SOC_DAPM_MUX("IF1 45 ADC Swap Mux", SND_SOC_NOPM, 0, 0,
1789 SND_SOC_DAPM_MUX("IF1 67 ADC Swap Mux", SND_SOC_NOPM, 0, 0,
1791 SND_SOC_DAPM_MUX("IF2 ADC Swap Mux", SND_SOC_NOPM, 0, 0,
1794 SND_SOC_DAPM_MUX("ADCDAT Mux", SND_SOC_NOPM, 0, 0, &rt5682s_adcdat_pin_ctrl),
1797 SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, RT5682S_I2S1_SDP,
1799 SND_SOC_DAPM_AIF_OUT("AIF2TX", "AIF2 Capture", 0, RT5682S_I2S2_SDP,
1801 SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0),
1805 SND_SOC_DAPM_MIXER("DAC1 MIXL", SND_SOC_NOPM, 0, 0,
1807 SND_SOC_DAPM_MIXER("DAC1 MIXR", SND_SOC_NOPM, 0, 0,
1811 SND_SOC_DAPM_MUX("DAC L1 Source", SND_SOC_NOPM, 0, 0, &rt5682s_alg_dac_l1_mux),
1812 SND_SOC_DAPM_MUX("DAC R1 Source", SND_SOC_NOPM, 0, 0, &rt5682s_alg_dac_r1_mux),
1816 RT5682S_PWR_DAC_S1F_BIT, 0, set_filter_clk, SND_SOC_DAPM_PRE_PMU),
1817 SND_SOC_DAPM_MIXER("Stereo1 DAC MIXL", SND_SOC_NOPM, 0, 0,
1819 SND_SOC_DAPM_MIXER("Stereo1 DAC MIXR", SND_SOC_NOPM, 0, 0,
1823 SND_SOC_DAPM_DAC("DAC L1", NULL, RT5682S_PWR_DIG_1, RT5682S_PWR_DAC_L1_BIT, 0),
1824 SND_SOC_DAPM_DAC("DAC R1", NULL, RT5682S_PWR_DIG_1, RT5682S_PWR_DAC_R1_BIT, 0),
1827 SND_SOC_DAPM_PGA_S("HP Amp", 1, SND_SOC_NOPM, 0, 0, rt5682s_hp_amp_event,
1832 RT5682S_SYS_CLK_DET_SFT, 0, NULL, 0),
1834 RT5682S_PLL1_CLK_DET_SFT, 0, NULL, 0),
1836 RT5682S_PWR_MCLK0_WD_BIT, 0, NULL, 0),
1839 SND_SOC_DAPM_SUPPLY("SAR", SND_SOC_NOPM, 0, 0, sar_power_event,
1931 {"IF1_ADC Mux", "Slot 0", "IF1 01 ADC Swap Mux"},
1984 unsigned int cl, val = 0, tx_slotnum; in rt5682s_set_tdm_slot()
1991 RT5682S_TDM_ADDA_CTRL_2, RT5682S_TDM_EN, 0); in rt5682s_set_tdm_slot()
2057 return 0; in rt5682s_set_tdm_slot()
2065 unsigned int len_1 = 0, len_2 = 0; in rt5682s_hw_params()
2071 if (frame_size < 0) { in rt5682s_hw_params()
2125 return 0; in rt5682s_hw_params()
2132 unsigned int reg_val = 0, tdm_ctrl = 0; in rt5682s_set_dai_fmt()
2139 rt5682s->master[dai->id] = 0; in rt5682s_set_dai_fmt()
2199 if (rt5682s->master[dai->id] == 0) in rt5682s_set_dai_fmt()
2209 return 0; in rt5682s_set_dai_fmt()
2216 unsigned int src = 0; in rt5682s_set_component_sysclk()
2219 return 0; in rt5682s_set_component_sysclk()
2252 return 0; in rt5682s_set_component_sysclk()
2256 {2048000, 24576000, 0, 46, 2, true, false, false, false},
2257 {256000, 24576000, 0, 382, 2, true, false, false, false},
2258 {512000, 24576000, 0, 190, 2, true, false, false, false},
2259 {4096000, 24576000, 0, 22, 2, true, false, false, false},
2260 {1024000, 24576000, 0, 94, 2, true, false, false, false},
2262 {1411200, 22579200, 0, 62, 2, true, false, false, false},
2263 {2822400, 22579200, 0, 30, 2, true, false, false, false},
2265 {1536000, 24576000, 0, 62, 2, true, false, false, false},
2266 {3072000, 24576000, 0, 30, 2, true, false, false, false},
2267 {24576000, 49152000, 4, 22, 0, false, false, false, false},
2268 {3072000, 49152000, 0, 30, 0, true, false, false, false},
2269 {6144000, 49152000, 0, 30, 0, false, false, false, false},
2270 {49152000, 98304000, 10, 22, 0, false, true, false, false},
2271 {6144000, 98304000, 0, 30, 0, false, true, false, false},
2272 {12288000, 98304000, 1, 22, 0, false, true, false, false},
2288 {3840000, 49152000, 0, 6, 0, true, false, false, false},
2297 for (i = 0; i < ARRAY_SIZE(plla_table); i++) { in find_pll_inter_combination()
2305 for (i = 0; i < ARRAY_SIZE(pllb_table); i++) { in find_pll_inter_combination()
2313 for (i = ARRAY_SIZE(plla_table) - 1; i >= 0; i--) { in find_pll_inter_combination()
2315 for (j = ARRAY_SIZE(pllb_table) - 1; j >= 0; j--) { in find_pll_inter_combination()
2338 return 0; in rt5682s_set_component_pll()
2342 rt5682s->pll_in[pll_id] = 0; in rt5682s_set_component_pll()
2343 rt5682s->pll_out[pll_id] = 0; in rt5682s_set_component_pll()
2346 return 0; in rt5682s_set_component_pll()
2383 (a_map.m_bp ? 0 : a_map.m), a_map.n, (a_map.k_bp ? 0 : a_map.k)); in rt5682s_set_component_pll()
2399 (b_map.m_bp ? 0 : b_map.m), b_map.n, (b_map.k_bp ? 0 : b_map.k), in rt5682s_set_component_pll()
2423 return 0; in rt5682s_set_component_pll()
2456 return 0; in rt5682s_set_bclk1_ratio()
2480 return 0; in rt5682s_set_bclk2_ratio()
2499 regmap_update_bits(rt5682s->regmap, RT5682S_PWR_DIG_1, RT5682S_PWR_LDO, 0); in rt5682s_set_bias_level()
2502 RT5682S_DIG_GATE_CTRL, 0); in rt5682s_set_bias_level()
2508 return 0; in rt5682s_set_bias_level()
2559 return 0; in rt5682s_wclk_prepare()
2575 RT5682S_PWR_VREF2 | RT5682S_PWR_FV2 | RT5682S_PWR_MB, 0); in rt5682s_wclk_unprepare()
2578 rt5682s_set_i2s(rt5682s, RT5682S_AIF1, 0); in rt5682s_wclk_unprepare()
2580 RT5682S_DIG_GATE_CTRL, 0); in rt5682s_wclk_unprepare()
2583 rt5682s_set_pllb_power(rt5682s, 0); in rt5682s_wclk_unprepare()
2585 rt5682s->wclk_enabled = 0; in rt5682s_wclk_unprepare()
2599 return 0; in rt5682s_wclk_recalc_rate()
2607 return 0; in rt5682s_wclk_recalc_rate()
2674 rt5682s_set_component_sysclk(component, RT5682S_SCLK_S_PLL2, 0, in rt5682s_wclk_set_rate()
2679 return 0; in rt5682s_wclk_set_rate()
2702 return 0; in rt5682s_bclk_recalc_rate()
2790 for (i = 0; i < RT5682S_DAI_NUM_CLKS; ++i) { in rt5682s_register_dai_clks()
2840 return 0; in rt5682s_register_dai_clks()
2866 return 0; in rt5682s_dai_probe_clks()
2871 return 0; in rt5682s_dai_probe_clks()
2900 rt5682s->jack_type = rt5682s_headset_detect(component, 0); in rt5682s_suspend()
2905 return 0; in rt5682s_suspend()
2917 &rt5682s->jack_detect_work, msecs_to_jiffies(0)); in rt5682s_resume()
2920 return 0; in rt5682s_resume()
2975 "realtek,ldo1-en-gpios", 0); in rt5682s_parse_dt()
2979 RT5682S_DAI_NUM_CLKS) < 0) in rt5682s_parse_dt()
2987 return 0; in rt5682s_parse_dt()
2996 regmap_write(rt5682s->regmap, RT5682S_PWR_ANLG_1, 0xaa80); in rt5682s_calibrate()
2998 regmap_write(rt5682s->regmap, RT5682S_PWR_ANLG_1, 0xfa80); in rt5682s_calibrate()
2999 regmap_write(rt5682s->regmap, RT5682S_PWR_DIG_1, 0x01c0); in rt5682s_calibrate()
3000 regmap_write(rt5682s->regmap, RT5682S_MICBIAS_2, 0x0380); in rt5682s_calibrate()
3001 regmap_write(rt5682s->regmap, RT5682S_GLB_CLK, 0x8000); in rt5682s_calibrate()
3002 regmap_write(rt5682s->regmap, RT5682S_ADDA_CLK_1, 0x1001); in rt5682s_calibrate()
3003 regmap_write(rt5682s->regmap, RT5682S_CHOP_DAC_2, 0x3030); in rt5682s_calibrate()
3004 regmap_write(rt5682s->regmap, RT5682S_CHOP_ADC, 0xb000); in rt5682s_calibrate()
3005 regmap_write(rt5682s->regmap, RT5682S_STO1_ADC_MIXER, 0x686c); in rt5682s_calibrate()
3006 regmap_write(rt5682s->regmap, RT5682S_CAL_REC, 0x5151); in rt5682s_calibrate()
3007 regmap_write(rt5682s->regmap, RT5682S_HP_CALIB_CTRL_2, 0x0321); in rt5682s_calibrate()
3008 regmap_write(rt5682s->regmap, RT5682S_HP_LOGIC_CTRL_2, 0x0004); in rt5682s_calibrate()
3009 regmap_write(rt5682s->regmap, RT5682S_HP_CALIB_CTRL_1, 0x7c00); in rt5682s_calibrate()
3010 regmap_write(rt5682s->regmap, RT5682S_HP_CALIB_CTRL_1, 0xfc00); in rt5682s_calibrate()
3012 for (count = 0; count < 60; count++) { in rt5682s_calibrate()
3014 if (!(value & 0x8000)) in rt5682s_calibrate()
3024 regmap_write(rt5682s->regmap, RT5682S_MICBIAS_2, 0x0180); in rt5682s_calibrate()
3025 regmap_write(rt5682s->regmap, RT5682S_CAL_REC, 0x5858); in rt5682s_calibrate()
3026 regmap_write(rt5682s->regmap, RT5682S_STO1_ADC_MIXER, 0xc0c4); in rt5682s_calibrate()
3027 regmap_write(rt5682s->regmap, RT5682S_HP_CALIB_CTRL_2, 0x0320); in rt5682s_calibrate()
3028 regmap_write(rt5682s->regmap, RT5682S_PWR_DIG_1, 0x00c0); in rt5682s_calibrate()
3029 regmap_write(rt5682s->regmap, RT5682S_PWR_ANLG_1, 0x0800); in rt5682s_calibrate()
3030 regmap_write(rt5682s->regmap, RT5682S_GLB_CLK, 0x0000); in rt5682s_calibrate()
3126 for (i = 0; i < ARRAY_SIZE(rt5682s->supplies); i++) in rt5682s_i2c_probe()
3271 {"RTL5682", 0,},
3277 {"rt5682s", 0},