Lines Matching +full:0 +full:xf01
39 if (ret < 0) in rt700_index_write()
52 *value = 0; in rt700_index_read()
54 if (ret < 0) in rt700_index_read()
63 unsigned int btn_type = 0, val80, val81; in rt700_button_detect()
67 if (ret < 0) in rt700_button_detect()
70 if (ret < 0) in rt700_button_detect()
73 val80 &= 0x0381; in rt700_button_detect()
74 val81 &= 0xff00; in rt700_button_detect()
77 case 0x0200: in rt700_button_detect()
78 case 0x0100: in rt700_button_detect()
79 case 0x0080: in rt700_button_detect()
82 case 0x0001: in rt700_button_detect()
87 case 0x8000: in rt700_button_detect()
88 case 0x4000: in rt700_button_detect()
89 case 0x2000: in rt700_button_detect()
92 case 0x1000: in rt700_button_detect()
93 case 0x0800: in rt700_button_detect()
94 case 0x0400: in rt700_button_detect()
97 case 0x0200: in rt700_button_detect()
98 case 0x0100: in rt700_button_detect()
108 unsigned int buf, loop = 0; in rt700_headset_detect()
110 unsigned int jack_status = 0, reg; in rt700_headset_detect()
114 if (ret < 0) in rt700_headset_detect()
118 (buf & RT700_COMBOJACK_AUTO_DET_STATUS) == 0) { in rt700_headset_detect()
124 if (ret < 0) in rt700_headset_detect()
129 if ((jack_status & (1 << 31)) == 0) in rt700_headset_detect()
142 return 0; in rt700_headset_detect()
160 int btn_type = 0, ret; in rt700_jack_detect_handler()
161 unsigned int jack_status = 0, reg; in rt700_jack_detect_handler()
171 if (ret < 0) in rt700_jack_detect_handler()
177 if (rt700->jack_type == 0) { in rt700_jack_detect_handler()
179 if (ret < 0) in rt700_jack_detect_handler()
189 rt700->jack_type = 0; in rt700_jack_detect_handler()
193 "in %s, jack_type=0x%x\n", __func__, rt700->jack_type); in rt700_jack_detect_handler()
195 "in %s, btn_type=0x%x\n", __func__, btn_type); in rt700_jack_detect_handler()
223 int btn_type = 0, ret; in rt700_btn_check_handler()
224 unsigned int jack_status = 0, reg; in rt700_btn_check_handler()
228 if (ret < 0) in rt700_btn_check_handler()
238 rt700->jack_type = 0; in rt700_btn_check_handler()
243 if (ret < 0) in rt700_btn_check_handler()
246 if ((reg & 0xf0) == 0xf0) in rt700_btn_check_handler()
247 btn_type = 0; in rt700_btn_check_handler()
250 "%s, btn_type=0x%x\n", __func__, btn_type); in rt700_btn_check_handler()
286 RT700_SET_MIC2_UNSOLICITED_ENABLE, 0x82); in rt700_jack_init()
288 RT700_SET_HP_UNSOLICITED_ENABLE, 0x81); in rt700_jack_init()
290 RT700_SET_INLINE_UNSOLICITED_ENABLE, 0x83); in rt700_jack_init()
291 rt700_index_write(rt700->regmap, 0x10, 0x2420); in rt700_jack_init()
292 rt700_index_write(rt700->regmap, 0x19, 0x2e11); in rt700_jack_init()
300 RT700_SET_MIC2_UNSOLICITED_ENABLE, 0x00); in rt700_jack_init()
302 RT700_SET_HP_UNSOLICITED_ENABLE, 0x00); in rt700_jack_init()
304 RT700_SET_INLINE_UNSOLICITED_ENABLE, 0x00); in rt700_jack_init()
325 return 0; in rt700_set_jack_detect()
328 if (ret < 0) { in rt700_set_jack_detect()
336 return 0; in rt700_set_jack_detect()
344 return 0; in rt700_set_jack_detect()
356 val_h |= 0x20; in rt700_get_gain()
379 val_h = 0x80; in rt700_set_amp_gain_put()
381 val_h = 0x0; in rt700_set_amp_gain_put()
388 val_ll = (mc->max - ucontrol->value.integer.value[0]) << 7; in rt700_set_amp_gain_put()
390 read_ll = read_ll & 0x7f; in rt700_set_amp_gain_put()
394 val_ll = ((ucontrol->value.integer.value[0]) & 0x7f); in rt700_set_amp_gain_put()
398 read_ll = read_ll & 0x80; in rt700_set_amp_gain_put()
411 read_rl = read_rl & 0x7f; in rt700_set_amp_gain_put()
415 val_lr = ((ucontrol->value.integer.value[1]) & 0x7f); in rt700_set_amp_gain_put()
419 read_rl = read_rl & 0x80; in rt700_set_amp_gain_put()
423 for (i = 0; i < 3; i++) { /* retry 3 times at most */ in rt700_set_amp_gain_put()
444 val_h = 0x80; in rt700_set_amp_gain_put()
446 val_h = 0x0; in rt700_set_amp_gain_put()
457 return 0; in rt700_set_amp_gain_put()
473 val_h = 0x80; in rt700_set_amp_gain_get()
475 val_h = 0x0; in rt700_set_amp_gain_get()
481 read_ll = !((read_ll & 0x80) >> RT700_MUTE_SFT); in rt700_set_amp_gain_get()
482 read_rl = !((read_rl & 0x80) >> RT700_MUTE_SFT); in rt700_set_amp_gain_get()
485 read_ll = read_ll & 0x7f; in rt700_set_amp_gain_get()
486 read_rl = read_rl & 0x7f; in rt700_set_amp_gain_get()
488 ucontrol->value.integer.value[0] = read_ll; in rt700_set_amp_gain_get()
491 return 0; in rt700_set_amp_gain_get()
494 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6525, 75, 0);
495 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1725, 75, 0);
496 static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);
501 RT700_DIR_OUT_SFT, 0x57, 0,
513 RT700_DIR_IN_SFT, 0x3f, 0,
517 RT700_DIR_IN_SFT, 0x3f, 0,
521 RT700_DIR_IN_SFT, 3, 0,
531 unsigned int reg, val = 0, nid; in rt700_mux_get()
543 /* vid = 0xf01 */ in rt700_mux_get()
546 if (ret < 0) in rt700_mux_get()
549 ucontrol->value.enumerated.item[0] = val; in rt700_mux_get()
551 return 0; in rt700_mux_get()
564 unsigned int val, val2 = 0, change, reg, nid; in rt700_mux_put()
567 if (item[0] >= e->items) in rt700_mux_put()
579 /* Verb ID = 0x701h */ in rt700_mux_put()
580 val = snd_soc_enum_item_to_val(e, item[0]) << e->shift_l; in rt700_mux_put()
584 if (ret < 0) in rt700_mux_put()
588 change = 0; in rt700_mux_put()
598 item[0], e, NULL); in rt700_mux_put()
611 rt700_adc22_enum, SND_SOC_NOPM, 0, adc_mux_text);
614 rt700_adc23_enum, SND_SOC_NOPM, 0, adc_mux_text);
630 rt700_hp_enum, SND_SOC_NOPM, 0, out_mux_text);
646 RT700_SET_STREAMID_DAC1, 0x10); in rt700_dac_front_event()
650 RT700_SET_STREAMID_DAC1, 0x00); in rt700_dac_front_event()
653 return 0; in rt700_dac_front_event()
666 RT700_SET_STREAMID_DAC2, 0x10); in rt700_dac_surround_event()
670 RT700_SET_STREAMID_DAC2, 0x00); in rt700_dac_surround_event()
673 return 0; in rt700_dac_surround_event()
686 RT700_SET_STREAMID_ADC1, 0x10); in rt700_adc_09_event()
690 RT700_SET_STREAMID_ADC1, 0x00); in rt700_adc_09_event()
693 return 0; in rt700_adc_09_event()
706 RT700_SET_STREAMID_ADC2, 0x10); in rt700_adc_08_event()
710 RT700_SET_STREAMID_ADC2, 0x00); in rt700_adc_08_event()
713 return 0; in rt700_adc_08_event()
722 unsigned int val_h = (1 << RT700_DIR_OUT_SFT) | (0x3 << 4); in rt700_hpo_mux_event()
727 val_l = 0x00; in rt700_hpo_mux_event()
738 return 0; in rt700_hpo_mux_event()
747 unsigned int val_h = (1 << RT700_DIR_OUT_SFT) | (0x3 << 4); in rt700_spk_pga_event()
752 val_l = 0x00; in rt700_spk_pga_event()
762 return 0; in rt700_spk_pga_event()
773 SND_SOC_DAPM_DAC_E("DAC Front", NULL, SND_SOC_NOPM, 0, 0,
776 SND_SOC_DAPM_DAC_E("DAC Surround", NULL, SND_SOC_NOPM, 0, 0,
779 SND_SOC_DAPM_MUX_E("HPO Mux", SND_SOC_NOPM, 0, 0, &rt700_hp_mux,
782 SND_SOC_DAPM_PGA_E("SPK PGA", SND_SOC_NOPM, 0, 0, NULL, 0,
785 SND_SOC_DAPM_ADC_E("ADC 09", NULL, SND_SOC_NOPM, 0, 0,
788 SND_SOC_DAPM_ADC_E("ADC 08", NULL, SND_SOC_NOPM, 0, 0,
791 SND_SOC_DAPM_MUX("ADC 22 Mux", SND_SOC_NOPM, 0, 0,
793 SND_SOC_DAPM_MUX("ADC 23 Mux", SND_SOC_NOPM, 0, 0,
795 SND_SOC_DAPM_AIF_IN("DP1RX", "DP1 Playback", 0, SND_SOC_NOPM, 0, 0),
796 SND_SOC_DAPM_AIF_IN("DP3RX", "DP3 Playback", 0, SND_SOC_NOPM, 0, 0),
797 SND_SOC_DAPM_AIF_OUT("DP2TX", "DP2 Capture", 0, SND_SOC_NOPM, 0, 0),
798 SND_SOC_DAPM_AIF_OUT("DP4TX", "DP4 Capture", 0, SND_SOC_NOPM, 0, 0),
831 return 0; in rt700_probe()
834 if (ret < 0 && ret != -EACCES) in rt700_probe()
837 return 0; in rt700_probe()
866 return 0; in rt700_set_bias_level()
887 return 0; in rt700_set_sdw_stream()
902 struct sdw_stream_config stream_config = {0}; in rt700_pcm_hw_params()
903 struct sdw_port_config port_config = {0}; in rt700_pcm_hw_params()
906 unsigned int val = 0; in rt700_pcm_hw_params()
945 /* bit 3:0 Number of Channel */ in rt700_pcm_hw_params()
958 val |= (0x1 << 4); in rt700_pcm_hw_params()
961 val |= (0x2 << 4); in rt700_pcm_hw_params()
964 val |= (0x3 << 4); in rt700_pcm_hw_params()
967 val |= (0x4 << 4); in rt700_pcm_hw_params()
992 return 0; in rt700_pcm_hw_free()
1064 value = 0x0; in rt700_clock_config()
1067 value = 0x1; in rt700_clock_config()
1070 value = 0x2; in rt700_clock_config()
1073 value = 0x3; in rt700_clock_config()
1076 value = 0x4; in rt700_clock_config()
1079 value = 0x5; in rt700_clock_config()
1085 regmap_write(rt700->regmap, 0xe0, value); in rt700_clock_config()
1086 regmap_write(rt700->regmap, 0xf0, value); in rt700_clock_config()
1090 return 0; in rt700_clock_config()
1129 if (ret < 0) in rt700_init()
1148 return 0; in rt700_init()
1158 return 0; in rt700_io_init()
1174 regmap_write(rt700->regmap, 0xff01, 0x0000); in rt700_io_init()
1175 regmap_write(rt700->regmap, 0x7520, 0x001a); in rt700_io_init()
1176 regmap_write(rt700->regmap, 0x7420, 0xc003); in rt700_io_init()
1181 regmap_write(rt700->regmap, RT700_SET_PIN_HP, 0x40); in rt700_io_init()
1182 regmap_write(rt700->regmap, RT700_SET_PIN_SPK, 0x40); in rt700_io_init()
1184 regmap_write(rt700->regmap, RT700_SET_PIN_DMIC1, 0x20); in rt700_io_init()
1185 regmap_write(rt700->regmap, RT700_SET_PIN_DMIC2, 0x20); in rt700_io_init()
1186 regmap_write(rt700->regmap, RT700_SET_PIN_MIC2, 0x20); in rt700_io_init()
1189 regmap_write(rt700->regmap, 0x4f12, 0x91); in rt700_io_init()
1190 regmap_write(rt700->regmap, 0x4e12, 0xd6); in rt700_io_init()
1191 regmap_write(rt700->regmap, 0x4d12, 0x11); in rt700_io_init()
1192 regmap_write(rt700->regmap, 0x4c12, 0x20); in rt700_io_init()
1193 regmap_write(rt700->regmap, 0x4f13, 0x91); in rt700_io_init()
1194 regmap_write(rt700->regmap, 0x4e13, 0xd6); in rt700_io_init()
1195 regmap_write(rt700->regmap, 0x4d13, 0x11); in rt700_io_init()
1196 regmap_write(rt700->regmap, 0x4c13, 0x21); in rt700_io_init()
1198 regmap_write(rt700->regmap, 0x4f19, 0x02); in rt700_io_init()
1199 regmap_write(rt700->regmap, 0x4e19, 0xa1); in rt700_io_init()
1200 regmap_write(rt700->regmap, 0x4d19, 0x90); in rt700_io_init()
1201 regmap_write(rt700->regmap, 0x4c19, 0x80); in rt700_io_init()
1204 regmap_write(rt700->regmap, 0x371b, 0x40); in rt700_io_init()
1205 regmap_write(rt700->regmap, 0x731b, 0xb0); in rt700_io_init()
1206 regmap_write(rt700->regmap, 0x839b, 0x00); in rt700_io_init()
1209 rt700_index_write(rt700->regmap, 0x4a, 0x201b); in rt700_io_init()
1210 rt700_index_write(rt700->regmap, 0x45, 0x5089); in rt700_io_init()
1211 rt700_index_write(rt700->regmap, 0x6b, 0x5064); in rt700_io_init()
1212 rt700_index_write(rt700->regmap, 0x48, 0xd249); in rt700_io_init()
1238 return 0; in rt700_io_init()