Lines Matching +full:0 +full:xf01
39 if (ret < 0) in rt711_index_write()
52 *value = 0; in rt711_index_read()
54 if (ret < 0) in rt711_index_read()
68 if (ret < 0) in rt711_index_update_bits()
79 regmap_write(regmap, RT711_FUNC_RESET, 0); in rt711_reset()
87 unsigned int val, loop = 0; in rt711_calibration()
90 int ret = 0; in rt711_calibration()
100 0xf, 0x0); in rt711_calibration()
127 RT711_FSM_CTL, 0xf, RT711_DEPOP_CTL); in rt711_calibration()
139 unsigned int btn_type = 0, val80, val81; in rt711_button_detect()
144 if (ret < 0) in rt711_button_detect()
148 if (ret < 0) in rt711_button_detect()
151 val80 &= 0x0381; in rt711_button_detect()
152 val81 &= 0xff00; in rt711_button_detect()
155 case 0x0200: in rt711_button_detect()
156 case 0x0100: in rt711_button_detect()
157 case 0x0080: in rt711_button_detect()
160 case 0x0001: in rt711_button_detect()
165 case 0x8000: in rt711_button_detect()
166 case 0x4000: in rt711_button_detect()
167 case 0x2000: in rt711_button_detect()
170 case 0x1000: in rt711_button_detect()
171 case 0x0800: in rt711_button_detect()
172 case 0x0400: in rt711_button_detect()
175 case 0x0200: in rt711_button_detect()
176 case 0x0100: in rt711_button_detect()
186 unsigned int buf, loop = 0; in rt711_headset_detect()
188 unsigned int jack_status = 0, reg; in rt711_headset_detect()
192 if (ret < 0) in rt711_headset_detect()
196 (buf & RT711_COMBOJACK_AUTO_DET_STATUS) == 0) { in rt711_headset_detect()
202 if (ret < 0) in rt711_headset_detect()
207 if (ret < 0) in rt711_headset_detect()
209 if ((jack_status & (1 << 31)) == 0) in rt711_headset_detect()
222 return 0; in rt711_headset_detect()
240 int btn_type = 0, ret; in rt711_jack_detect_handler()
241 unsigned int jack_status = 0, reg; in rt711_jack_detect_handler()
258 if (ret < 0) in rt711_jack_detect_handler()
264 if (rt711->jack_type == 0) { in rt711_jack_detect_handler()
266 if (ret < 0) in rt711_jack_detect_handler()
276 rt711->jack_type = 0; in rt711_jack_detect_handler()
280 "in %s, jack_type=0x%x\n", __func__, rt711->jack_type); in rt711_jack_detect_handler()
282 "in %s, btn_type=0x%x\n", __func__, btn_type); in rt711_jack_detect_handler()
310 int btn_type = 0, ret; in rt711_btn_check_handler()
311 unsigned int jack_status = 0, reg; in rt711_btn_check_handler()
315 if (ret < 0) in rt711_btn_check_handler()
325 rt711->jack_type = 0; in rt711_btn_check_handler()
331 if (ret < 0) in rt711_btn_check_handler()
334 if ((reg & 0xf0) == 0xf0) in rt711_btn_check_handler()
335 btn_type = 0; in rt711_btn_check_handler()
338 "%s, btn_type=0x%x\n", __func__, btn_type); in rt711_btn_check_handler()
375 RT711_SET_MIC2_UNSOLICITED_ENABLE, 0x82); in rt711_jack_init()
377 RT711_SET_HP_UNSOLICITED_ENABLE, 0x81); in rt711_jack_init()
379 RT711_SET_INLINE_UNSOLICITED_ENABLE, 0x83); in rt711_jack_init()
381 0x10, 0x2420); in rt711_jack_init()
383 0x19, 0x2e11); in rt711_jack_init()
441 RT711_SET_MIC2_UNSOLICITED_ENABLE, 0x00); in rt711_jack_init()
443 RT711_SET_HP_UNSOLICITED_ENABLE, 0x00); in rt711_jack_init()
445 RT711_SET_INLINE_UNSOLICITED_ENABLE, 0x00); in rt711_jack_init()
467 return 0; in rt711_set_jack_detect()
470 if (ret < 0) { in rt711_set_jack_detect()
478 return 0; in rt711_set_jack_detect()
486 return 0; in rt711_set_jack_detect()
498 val_h |= 0x20; in rt711_get_gain()
523 val_h = 0x80; in rt711_set_amp_gain_put()
525 val_h = 0x0; in rt711_set_amp_gain_put()
532 val_ll = (mc->max - ucontrol->value.integer.value[0]) in rt711_set_amp_gain_put()
535 read_ll = read_ll & 0x7f; in rt711_set_amp_gain_put()
539 val_ll = ((ucontrol->value.integer.value[0]) & 0x7f); in rt711_set_amp_gain_put()
557 read_rl = read_rl & 0x7f; in rt711_set_amp_gain_put()
561 val_lr = ((ucontrol->value.integer.value[1]) & 0x7f); in rt711_set_amp_gain_put()
569 for (i = 0; i < 3; i++) { /* retry 3 times at most */ in rt711_set_amp_gain_put()
591 val_h = 0x80; in rt711_set_amp_gain_put()
593 val_h = 0x0; in rt711_set_amp_gain_put()
606 return 0; in rt711_set_amp_gain_put()
623 val_h = 0x80; in rt711_set_amp_gain_get()
625 val_h = 0x0; in rt711_set_amp_gain_get()
631 read_ll = !((read_ll & 0x80) >> RT711_MUTE_SFT); in rt711_set_amp_gain_get()
632 read_rl = !((read_rl & 0x80) >> RT711_MUTE_SFT); in rt711_set_amp_gain_get()
635 read_ll = read_ll & 0x7f; in rt711_set_amp_gain_get()
636 read_rl = read_rl & 0x7f; in rt711_set_amp_gain_get()
638 ucontrol->value.integer.value[0] = read_ll; in rt711_set_amp_gain_get()
641 return 0; in rt711_set_amp_gain_get()
644 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6525, 75, 0);
645 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1725, 75, 0);
646 static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);
651 RT711_DIR_OUT_SFT, 0x57, 0,
663 RT711_DIR_IN_SFT, 0x3f, 0,
667 RT711_DIR_IN_SFT, 0x3f, 0,
671 RT711_DIR_IN_SFT, 3, 0,
675 RT711_DIR_IN_SFT, 3, 0,
679 RT711_DIR_IN_SFT, 3, 0,
689 unsigned int reg, val = 0, nid; in rt711_mux_get()
699 /* vid = 0xf01 */ in rt711_mux_get()
702 if (ret < 0) { in rt711_mux_get()
708 ucontrol->value.enumerated.item[0] = val; in rt711_mux_get()
710 return 0; in rt711_mux_get()
723 unsigned int val, val2 = 0, change, reg, nid; in rt711_mux_put()
726 if (item[0] >= e->items) in rt711_mux_put()
736 /* Verb ID = 0x701h */ in rt711_mux_put()
737 val = snd_soc_enum_item_to_val(e, item[0]) << e->shift_l; in rt711_mux_put()
741 if (ret < 0) { in rt711_mux_put()
748 change = 0; in rt711_mux_put()
758 item[0], e, NULL); in rt711_mux_put()
771 rt711_adc22_enum, SND_SOC_NOPM, 0, adc_mux_text);
774 rt711_adc23_enum, SND_SOC_NOPM, 0, adc_mux_text);
790 unsigned int val_h = (1 << RT711_DIR_OUT_SFT) | (0x3 << 4); in rt711_dac_surround_event()
796 RT711_SET_STREAMID_DAC2, 0x10); in rt711_dac_surround_event()
798 val_l = 0x00; in rt711_dac_surround_event()
809 RT711_SET_STREAMID_DAC2, 0x00); in rt711_dac_surround_event()
812 return 0; in rt711_dac_surround_event()
825 RT711_SET_STREAMID_ADC1, 0x10); in rt711_adc_09_event()
829 RT711_SET_STREAMID_ADC1, 0x00); in rt711_adc_09_event()
832 return 0; in rt711_adc_09_event()
845 RT711_SET_STREAMID_ADC2, 0x10); in rt711_adc_08_event()
849 RT711_SET_STREAMID_ADC2, 0x00); in rt711_adc_08_event()
852 return 0; in rt711_adc_08_event()
863 SND_SOC_DAPM_DAC_E("DAC Surround", NULL, SND_SOC_NOPM, 0, 0,
866 SND_SOC_DAPM_ADC_E("ADC 09", NULL, SND_SOC_NOPM, 0, 0,
869 SND_SOC_DAPM_ADC_E("ADC 08", NULL, SND_SOC_NOPM, 0, 0,
872 SND_SOC_DAPM_MUX("ADC 22 Mux", SND_SOC_NOPM, 0, 0,
874 SND_SOC_DAPM_MUX("ADC 23 Mux", SND_SOC_NOPM, 0, 0,
877 SND_SOC_DAPM_AIF_IN("DP3RX", "DP3 Playback", 0, SND_SOC_NOPM, 0, 0),
878 SND_SOC_DAPM_AIF_OUT("DP2TX", "DP2 Capture", 0, SND_SOC_NOPM, 0, 0),
879 SND_SOC_DAPM_AIF_OUT("DP4TX", "DP4 Capture", 0, SND_SOC_NOPM, 0, 0),
929 return 0; in rt711_set_bias_level()
937 return 0; in rt711_parse_dt()
949 return 0; in rt711_probe()
952 if (ret < 0 && ret != -EACCES) in rt711_probe()
955 return 0; in rt711_probe()
976 return 0; in rt711_set_sdw_stream()
991 struct sdw_stream_config stream_config = {0}; in rt711_pcm_hw_params()
992 struct sdw_port_config port_config = {0}; in rt711_pcm_hw_params()
995 unsigned int val = 0; in rt711_pcm_hw_params()
1028 /* bit 3:0 Number of Channel */ in rt711_pcm_hw_params()
1041 val |= (0x1 << 4); in rt711_pcm_hw_params()
1044 val |= (0x2 << 4); in rt711_pcm_hw_params()
1047 val |= (0x3 << 4); in rt711_pcm_hw_params()
1050 val |= (0x4 << 4); in rt711_pcm_hw_params()
1076 return 0; in rt711_pcm_hw_free()
1141 value = 0x0; in rt711_clock_config()
1144 value = 0x1; in rt711_clock_config()
1147 value = 0x2; in rt711_clock_config()
1150 value = 0x3; in rt711_clock_config()
1153 value = 0x4; in rt711_clock_config()
1156 value = 0x5; in rt711_clock_config()
1162 regmap_write(rt711->regmap, 0xe0, value); in rt711_clock_config()
1163 regmap_write(rt711->regmap, 0xf0, value); in rt711_clock_config()
1167 return 0; in rt711_clock_config()
1216 if (ret < 0) in rt711_init()
1246 return 0; in rt711_io_init()
1267 regmap_write(rt711->regmap, RT711_SET_PIN_MIC2, 0x25); in rt711_io_init()
1268 regmap_write(rt711->regmap, RT711_SET_PIN_HP, 0xc0); in rt711_io_init()
1269 regmap_write(rt711->regmap, RT711_SET_PIN_DMIC1, 0x20); in rt711_io_init()
1270 regmap_write(rt711->regmap, RT711_SET_PIN_DMIC2, 0x20); in rt711_io_init()
1271 regmap_write(rt711->regmap, RT711_SET_PIN_LINE1, 0x20); in rt711_io_init()
1272 regmap_write(rt711->regmap, RT711_SET_PIN_LINE2, 0x20); in rt711_io_init()
1275 regmap_write(rt711->regmap, RT711_SET_GAIN_HP_H, 0xa080); in rt711_io_init()
1276 regmap_write(rt711->regmap, RT711_SET_GAIN_HP_H, 0x9080); in rt711_io_init()
1277 regmap_write(rt711->regmap, RT711_SET_GAIN_ADC2_H, 0x6080); in rt711_io_init()
1278 regmap_write(rt711->regmap, RT711_SET_GAIN_ADC2_H, 0x5080); in rt711_io_init()
1279 regmap_write(rt711->regmap, RT711_SET_GAIN_ADC1_H, 0x6080); in rt711_io_init()
1280 regmap_write(rt711->regmap, RT711_SET_GAIN_ADC1_H, 0x5080); in rt711_io_init()
1283 regmap_write(rt711->regmap, 0x4f12, 0x91); in rt711_io_init()
1284 regmap_write(rt711->regmap, 0x4e12, 0xd6); in rt711_io_init()
1285 regmap_write(rt711->regmap, 0x4d12, 0x11); in rt711_io_init()
1286 regmap_write(rt711->regmap, 0x4c12, 0x20); in rt711_io_init()
1287 regmap_write(rt711->regmap, 0x4f13, 0x91); in rt711_io_init()
1288 regmap_write(rt711->regmap, 0x4e13, 0xd6); in rt711_io_init()
1289 regmap_write(rt711->regmap, 0x4d13, 0x11); in rt711_io_init()
1290 regmap_write(rt711->regmap, 0x4c13, 0x21); in rt711_io_init()
1291 regmap_write(rt711->regmap, 0x4c21, 0xf0); in rt711_io_init()
1292 regmap_write(rt711->regmap, 0x4d21, 0x11); in rt711_io_init()
1293 regmap_write(rt711->regmap, 0x4e21, 0x11); in rt711_io_init()
1294 regmap_write(rt711->regmap, 0x4f21, 0x01); in rt711_io_init()
1298 RT711_TX_RX_MUX_CTL, 0x0154); in rt711_io_init()
1302 RT711_DIGITAL_MISC_CTRL4, 0x201b); in rt711_io_init()
1304 RT711_COMBO_JACK_AUTO_CTL1, 0x5089); in rt711_io_init()
1306 RT711_VREFOUT_CTL, 0x5064); in rt711_io_init()
1308 RT711_INLINE_CMD_CTL, 0xd249); in rt711_io_init()
1338 return 0; in rt711_io_init()