Lines Matching +full:open +full:- +full:circuit

1 // SPDX-License-Identifier: GPL-2.0
9 #include <linux/dma-mapping.h>
19 regmap_write(priv->regmap, MT6357_GPIO_MODE2_CLR, MT6357_GPIO_MODE2_CLEAR_ALL); in set_playback_gpio()
22 regmap_write(priv->regmap, MT6357_GPIO_MODE2_SET, in set_playback_gpio()
32 regmap_update_bits(priv->regmap, MT6357_GPIO_DIR0, in set_playback_gpio()
46 regmap_write(priv->regmap, MT6357_GPIO_MODE3_CLR, MT6357_GPIO_MODE3_CLEAR_ALL); in set_capture_gpio()
49 regmap_write(priv->regmap, MT6357_GPIO_MODE3_SET, in set_capture_gpio()
61 regmap_update_bits(priv->regmap, MT6357_GPIO_DIR0, in set_capture_gpio()
79 stage = up ? i : MT6357_HPLOUT_STG_CTRL_VAUDP15_MAX - i; in hp_main_output_ramp()
80 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_output_ramp()
83 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_output_ramp()
96 stage = up ? i : MT6357_HP_AUX_LOOP_GAIN_MAX - i; in hp_aux_feedback_loop_gain_ramp()
97 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_aux_feedback_loop_gain_ramp()
107 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON2, in hp_pull_down()
111 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON2, in hp_pull_down()
137 lcount = -1; in volume_ramp()
142 rcount = -1; in volume_ramp()
148 regmap_update_bits(priv->regmap, reg_addr, in volume_ramp()
157 regmap_update_bits(priv->regmap, reg_addr, in volume_ramp()
184 static const DECLARE_TLV_DB_SCALE(playback_tlv, -1000, 100, 0);
186 static const DECLARE_TLV_DB_SCALE(hp_degain_tlv, -1200, 1200, 0);
267 "Open", "DACR", "Playback", "Test mode"
287 "Open", "Line Out", "DAC", "Handset"
322 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON7, in mt6357_set_dmic()
326 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_dmic()
330 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_H, in mt6357_set_dmic()
334 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_dmic()
338 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_dmic()
345 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_dmic()
349 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_dmic()
353 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_dmic()
357 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_H, in mt6357_set_dmic()
361 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON7, in mt6357_set_dmic()
372 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG0, in mt6357_set_amic()
374 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG0, in mt6357_set_amic()
376 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG0, in mt6357_set_amic()
378 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG1, in mt6357_set_amic()
385 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON8, in mt6357_set_amic()
390 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON8, in mt6357_set_amic()
395 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON8, in mt6357_set_amic()
403 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON9, in mt6357_set_amic()
408 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt6357_set_amic()
411 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt6357_set_amic()
415 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt6357_set_amic()
419 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt6357_set_amic()
424 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt6357_set_amic()
428 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt6357_set_amic()
432 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt6357_set_amic()
436 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt6357_set_amic()
442 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON8, in mt6357_set_amic()
446 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON9, in mt6357_set_amic()
450 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG0, in mt6357_set_amic()
452 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG0, in mt6357_set_amic()
454 regmap_update_bits(priv->regmap, MT6357_AFE_DCCLK_CFG0, in mt6357_set_amic()
466 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_loopback()
470 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_loopback()
474 regmap_update_bits(priv->regmap, MT6357_AFE_ADDA_MTKAIF_CFG0, in mt6357_set_loopback()
478 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_loopback()
483 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_loopback()
487 regmap_update_bits(priv->regmap, MT6357_AFE_ADDA_MTKAIF_CFG0, in mt6357_set_loopback()
491 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_loopback()
495 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_loopback()
507 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_ul_sine_gen()
511 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_ul_sine_gen()
516 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in mt6357_set_ul_sine_gen()
520 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in mt6357_set_ul_sine_gen()
532 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in mt_aif_out_event()
553 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in mt_adc_supply_event()
559 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON11, in mt_adc_supply_event()
562 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON12, in mt_adc_supply_event()
565 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON12, in mt_adc_supply_event()
573 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON12, in mt_adc_supply_event()
579 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON12, in mt_adc_supply_event()
583 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON11, in mt_adc_supply_event()
598 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in mt_mic_type_event()
600 unsigned int mic_type = dapm_kcontrol_get_value(w->kcontrols[0]); in mt_mic_type_event()
646 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in mt_pga_left_event()
652 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
656 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
659 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
663 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
669 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
672 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
676 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
680 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
684 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_left_event()
699 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in mt_pga_right_event()
705 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
708 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
711 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
714 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
720 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
722 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in mt_pga_right_event()
725 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
728 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
731 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in mt_pga_right_event()
746 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in adc_enable_event()
752 regmap_read(priv->regmap, MT6357_AUDENC_ANA_CON0, &lgain); in adc_enable_event()
753 regmap_read(priv->regmap, MT6357_AUDENC_ANA_CON1, &rgain); in adc_enable_event()
755 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in adc_enable_event()
759 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in adc_enable_event()
763 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in adc_enable_event()
767 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in adc_enable_event()
772 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON0, in adc_enable_event()
774 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON1, in adc_enable_event()
779 regmap_update_bits(priv->regmap, MT6357_AFE_UL_SRC_CON0_L, in adc_enable_event()
782 regmap_update_bits(priv->regmap, MT6357_AFE_AUD_PAD_TOP, in adc_enable_event()
796 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ELR_0, in configure_downlinks()
799 /* Disable headphone short-circuit protection */ in configure_downlinks()
800 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in configure_downlinks()
804 /* Disable handset short-circuit protection */ in configure_downlinks()
805 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in configure_downlinks()
808 /* Disable lineout short-circuit protection */ in configure_downlinks()
809 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in configure_downlinks()
813 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON2, in configure_downlinks()
817 regmap_write(priv->regmap, MT6357_AUDNCP_CLKDIV_CON1, MT6357_DIVCKS_ON); in configure_downlinks()
819 regmap_write(priv->regmap, MT6357_AUDNCP_CLKDIV_CON2, 0x002c); in configure_downlinks()
821 regmap_write(priv->regmap, MT6357_AUDNCP_CLKDIV_CON0, MT6357_DIVCKS_CHG); in configure_downlinks()
823 regmap_write(priv->regmap, MT6357_AUDNCP_CLKDIV_CON4, in configure_downlinks()
826 regmap_write(priv->regmap, MT6357_AUDNCP_CLKDIV_CON3, in configure_downlinks()
829 /* Enable cap-less LDOs (1.5V) */ in configure_downlinks()
830 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON12, in configure_downlinks()
841 /* Enable NV regulator (-1.2V) */ in configure_downlinks()
842 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON13, in configure_downlinks()
846 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON10, in configure_downlinks()
850 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON11, in configure_downlinks()
853 /* Enable low-noise mode of DAC */ in configure_downlinks()
854 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in configure_downlinks()
859 /* Disable low-noise mode of DAC */ in configure_downlinks()
860 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in configure_downlinks()
864 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON11, in configure_downlinks()
867 /* Enable linout short-circuit protection */ in configure_downlinks()
868 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in configure_downlinks()
871 /* Enable handset short-circuit protection */ in configure_downlinks()
872 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in configure_downlinks()
875 /* Enable headphone short-circuit protection */ in configure_downlinks()
876 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in configure_downlinks()
882 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON10, in configure_downlinks()
885 /* Disable NV regulator (-1.2V) */ in configure_downlinks()
886 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON13, in configure_downlinks()
889 /* Disable cap-less LDOs (1.5V) */ in configure_downlinks()
890 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON12, in configure_downlinks()
902 regmap_update_bits(priv->regmap, MT6357_AUDNCP_CLKDIV_CON3, in configure_downlinks()
911 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in mt_audio_in_event()
918 /* Pull-down HPL/R to AVSS28_AUD */ in mt_audio_in_event()
919 if (priv->pull_down_needed) in mt_audio_in_event()
923 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in mt_audio_in_event()
927 regmap_write(priv->regmap, MT6357_AFUNC_AUD_CON2, in mt_audio_in_event()
933 regmap_write(priv->regmap, MT6357_AFUNC_AUD_CON0, in mt_audio_in_event()
943 regmap_write(priv->regmap, MT6357_AFUNC_AUD_CON2, in mt_audio_in_event()
949 regmap_write(priv->regmap, MT6357_AFUNC_AUD_CON2, in mt_audio_in_event()
960 regmap_write(priv->regmap, MT6357_AFUNC_AUD_CON2, in mt_audio_in_event()
965 regmap_write(priv->regmap, MT6357_AFUNC_AUD_CON0, in mt_audio_in_event()
977 /* disable Pull-down HPL/R to AVSS28_AUD */ in mt_audio_in_event()
978 if (priv->pull_down_needed) in mt_audio_in_event()
1010 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in lo_mux_event()
1015 regmap_read(priv->regmap, MT6357_ZCD_CON1, &lgain); in lo_mux_event()
1020 /* Set -40dB before enable HS to avoid POP noise */ in lo_mux_event()
1021 regmap_update_bits(priv->regmap, MT6357_ZCD_CON1, in lo_mux_event()
1026 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in lo_mux_event()
1030 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in lo_mux_event()
1034 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in lo_mux_event()
1047 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in lo_mux_event()
1051 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in lo_mux_event()
1055 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in lo_mux_event()
1059 regmap_update_bits(priv->regmap, MT6357_ZCD_CON1, in lo_mux_event()
1077 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in hs_mux_event()
1082 regmap_read(priv->regmap, MT6357_ZCD_CON3, &gain); in hs_mux_event()
1085 /* Set -40dB before enable HS to avoid POP noise */ in hs_mux_event()
1086 regmap_update_bits(priv->regmap, MT6357_ZCD_CON3, in hs_mux_event()
1091 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in hs_mux_event()
1095 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in hs_mux_event()
1099 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in hs_mux_event()
1109 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in hs_mux_event()
1113 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in hs_mux_event()
1117 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in hs_mux_event()
1121 regmap_update_bits(priv->regmap, MT6357_ZCD_CON3, in hs_mux_event()
1135 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in hp_main_mux_event()
1140 regmap_read(priv->regmap, MT6357_ZCD_CON2, &lgain); in hp_main_mux_event()
1145 priv->hp_channel_number++; in hp_main_mux_event()
1146 if (priv->hp_channel_number > 1) in hp_main_mux_event()
1148 /* Set -40dB before enable HS to avoid POP noise */ in hp_main_mux_event()
1149 regmap_update_bits(priv->regmap, MT6357_ZCD_CON2, in hp_main_mux_event()
1154 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON2, in hp_main_mux_event()
1160 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1166 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1172 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_main_mux_event()
1180 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in hp_main_mux_event()
1186 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in hp_main_mux_event()
1192 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1198 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_main_mux_event()
1202 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_main_mux_event()
1208 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1219 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1228 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1234 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1242 priv->hp_channel_number--; in hp_main_mux_event()
1243 if (priv->hp_channel_number > 0) in hp_main_mux_event()
1246 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1252 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1261 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1271 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1277 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_main_mux_event()
1285 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_main_mux_event()
1289 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1295 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in hp_main_mux_event()
1301 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in hp_main_mux_event()
1309 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON6, in hp_main_mux_event()
1317 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1323 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON1, in hp_main_mux_event()
1329 regmap_update_bits(priv->regmap, MT6357_ZCD_CON2, in hp_main_mux_event()
1346 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in right_dac_event()
1352 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in right_dac_event()
1359 /* disable Pull-down HPL/R to AVSS28_AUD */ in right_dac_event()
1360 if (priv->pull_down_needed) in right_dac_event()
1364 /* Pull-down HPL/R to AVSS28_AUD */ in right_dac_event()
1365 if (priv->pull_down_needed) in right_dac_event()
1368 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in right_dac_event()
1385 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); in left_dac_event()
1391 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in left_dac_event()
1398 /* disable Pull-down HPL/R to AVSS28_AUD */ in left_dac_event()
1399 if (priv->pull_down_needed) in left_dac_event()
1403 /* Pull-down HPL/R to AVSS28_AUD */ in left_dac_event()
1404 if (priv->pull_down_needed) in left_dac_event()
1407 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in left_dac_event()
1691 .name = "mt6357-snd-codec-aif1",
1713 snd_soc_component_init_regmap(codec, priv->regmap); in mt6357_codec_probe()
1716 regmap_update_bits(priv->regmap, MT6357_DCXO_CW14, in mt6357_codec_probe()
1718 /* Disable HeadphoneL/HeadphoneR short circuit protection */ in mt6357_codec_probe()
1719 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON0, in mt6357_codec_probe()
1724 /* Disable voice short circuit protection */ in mt6357_codec_probe()
1725 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON3, in mt6357_codec_probe()
1728 /* disable LO buffer left short circuit protection */ in mt6357_codec_probe()
1729 regmap_update_bits(priv->regmap, MT6357_AUDDEC_ANA_CON4, in mt6357_codec_probe()
1736 regmap_update_bits(priv->regmap, MT6357_DCXO_CW14, in mt6357_codec_probe()
1779 struct device_node *np = priv->dev->parent->of_node; in mt6357_parse_dt()
1782 return -EINVAL; in mt6357_parse_dt()
1784 priv->pull_down_needed = false; in mt6357_parse_dt()
1785 if (of_property_read_bool(np, "mediatek,hp-pull-down")) in mt6357_parse_dt()
1786 priv->pull_down_needed = true; in mt6357_parse_dt()
1788 micbias_voltage_index = mt6357_get_micbias_idx(np, "mediatek,micbias0-microvolt"); in mt6357_parse_dt()
1789 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON8, in mt6357_parse_dt()
1793 micbias_voltage_index = mt6357_get_micbias_idx(np, "mediatek,micbias1-microvolt"); in mt6357_parse_dt()
1794 regmap_update_bits(priv->regmap, MT6357_AUDENC_ANA_CON9, in mt6357_parse_dt()
1803 struct mt6397_chip *mt6397 = dev_get_drvdata(pdev->dev.parent); in mt6357_platform_driver_probe()
1807 ret = devm_regulator_get_enable(&pdev->dev, "vaud28"); in mt6357_platform_driver_probe()
1809 return dev_err_probe(&pdev->dev, ret, "Failed to enable vaud28 regulator\n"); in mt6357_platform_driver_probe()
1811 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in mt6357_platform_driver_probe()
1813 return -ENOMEM; in mt6357_platform_driver_probe()
1815 dev_set_drvdata(&pdev->dev, priv); in mt6357_platform_driver_probe()
1816 priv->dev = &pdev->dev; in mt6357_platform_driver_probe()
1818 priv->regmap = mt6397->regmap; in mt6357_platform_driver_probe()
1819 if (IS_ERR(priv->regmap)) in mt6357_platform_driver_probe()
1820 return PTR_ERR(priv->regmap); in mt6357_platform_driver_probe()
1824 return dev_err_probe(&pdev->dev, ret, "Failed to parse dts\n"); in mt6357_platform_driver_probe()
1826 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64); in mt6357_platform_driver_probe()
1827 if (!pdev->dev.dma_mask) in mt6357_platform_driver_probe()
1828 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; in mt6357_platform_driver_probe()
1830 return devm_snd_soc_register_component(&pdev->dev, in mt6357_platform_driver_probe()
1837 {"mt6357-sound", 0},
1844 .name = "mt6357-sound",