Lines Matching refs:component

299 static int wcd937x_rx_clk_enable(struct snd_soc_component *component)  in wcd937x_rx_clk_enable()  argument
301 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_clk_enable()
306 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_DIG_CLK_CTL, BIT(3), BIT(3)); in wcd937x_rx_clk_enable()
307 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(0), BIT(0)); in wcd937x_rx_clk_enable()
308 snd_soc_component_update_bits(component, WCD937X_ANA_RX_SUPPLIES, BIT(0), BIT(0)); in wcd937x_rx_clk_enable()
309 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX0_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
310 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX1_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
311 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX2_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
312 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(1), BIT(1)); in wcd937x_rx_clk_enable()
319 static int wcd937x_rx_clk_disable(struct snd_soc_component *component) in wcd937x_rx_clk_disable() argument
321 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_clk_disable()
324 dev_err(component->dev, "clk already disabled\n"); in wcd937x_rx_clk_disable()
330 snd_soc_component_update_bits(component, WCD937X_ANA_RX_SUPPLIES, BIT(0), 0x00); in wcd937x_rx_clk_disable()
331 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(1), 0x00); in wcd937x_rx_clk_disable()
332 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(0), 0x00); in wcd937x_rx_clk_disable()
341 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_hphl_dac_event() local
342 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_hphl_dac_event()
347 wcd937x_rx_clk_enable(component); in wcd937x_codec_hphl_dac_event()
348 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
351 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
354 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
361 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
365 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
370 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
373 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
378 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
381 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
390 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
393 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
398 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
403 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
416 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_hphr_dac_event() local
417 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_hphr_dac_event()
422 wcd937x_rx_clk_enable(component); in wcd937x_codec_hphr_dac_event()
423 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
425 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
427 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
433 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
437 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
441 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
444 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
447 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
450 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
460 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
463 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
467 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
472 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
485 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_ear_dac_event() local
486 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_ear_dac_event()
491 wcd937x_rx_clk_enable(component); in wcd937x_codec_ear_dac_event()
492 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
495 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
500 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
504 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
508 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
513 snd_soc_component_update_bits(component, WCD937X_FLYBACK_EN, BIT(2), 0x00); in wcd937x_codec_ear_dac_event()
523 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
527 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
540 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_aux_dac_event() local
541 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_aux_dac_event()
546 wcd937x_rx_clk_enable(component); in wcd937x_codec_aux_dac_event()
547 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
550 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
553 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
563 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
576 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_hphr_pa() local
577 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_hphr_pa()
586 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphr_pa()
590 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
603 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
607 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
627 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
629 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphr_pa()
645 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_hphl_pa() local
646 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_hphl_pa()
655 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphl_pa()
659 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
671 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
675 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
695 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
697 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
713 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_aux_pa() local
714 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_aux_pa()
723 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
731 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
745 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
759 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_ear_pa() local
760 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_ear_pa()
766 wcd937x->ear_rx_path = snd_soc_component_read(component, in wcd937x_codec_enable_ear_pa()
770 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
774 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
778 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
785 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
802 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
810 snd_soc_component_update_bits(component, WCD937X_FLYBACK_EN, in wcd937x_codec_enable_ear_pa()
814 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
818 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
831 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx1() local
834 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx1()
835 snd_soc_component_update_bits(component, in wcd937x_enable_rx1()
846 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx2() local
849 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx2()
850 snd_soc_component_update_bits(component, in wcd937x_enable_rx2()
862 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx3() local
866 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx3()
867 snd_soc_component_update_bits(component, in wcd937x_enable_rx3()
888 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_tx_swr_ctrl() local
889 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_tx_swr_ctrl()
890 bool use_amic3 = snd_soc_component_read(component, WCD937X_TX_NEW_TX_CH2_SEL) & BIT(7); in wcd937x_tx_swr_ctrl()
903 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_adc() local
904 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_adc()
909 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
911 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
913 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
920 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
931 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_req() local
932 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_enable_req()
936 snd_soc_component_update_bits(component, in wcd937x_enable_req()
938 snd_soc_component_update_bits(component, in wcd937x_enable_req()
940 snd_soc_component_update_bits(component, in wcd937x_enable_req()
942 snd_soc_component_update_bits(component, in wcd937x_enable_req()
944 snd_soc_component_update_bits(component, in wcd937x_enable_req()
946 snd_soc_component_update_bits(component, in wcd937x_enable_req()
948 snd_soc_component_update_bits(component, in wcd937x_enable_req()
950 snd_soc_component_update_bits(component, in wcd937x_enable_req()
952 snd_soc_component_update_bits(component, in wcd937x_enable_req()
956 snd_soc_component_update_bits(component, in wcd937x_enable_req()
958 snd_soc_component_update_bits(component, in wcd937x_enable_req()
960 snd_soc_component_update_bits(component, in wcd937x_enable_req()
962 snd_soc_component_update_bits(component, in wcd937x_enable_req()
967 snd_soc_component_update_bits(component, in wcd937x_enable_req()
973 snd_soc_component_update_bits(component, in wcd937x_enable_req()
986 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_dmic() local
1003 dev_err(component->dev, "Invalid DMIC Selection\n"); in wcd937x_codec_enable_dmic()
1009 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1012 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1014 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1016 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1024 static int wcd937x_micbias_control(struct snd_soc_component *component, in wcd937x_micbias_control() argument
1027 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_micbias_control()
1032 dev_err(component->dev, "Invalid micbias index, micb_ind:%d\n", micb_index); in wcd937x_micbias_control()
1046 dev_err(component->dev, "Invalid micbias number: %d\n", micb_num); in wcd937x_micbias_control()
1056 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1064 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1071 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1074 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1077 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1080 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1083 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1086 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1104 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1112 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1123 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1138 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in __wcd937x_codec_enable_micbias() local
1143 wcd937x_micbias_control(component, micb_num, in __wcd937x_codec_enable_micbias()
1150 wcd937x_micbias_control(component, micb_num, in __wcd937x_codec_enable_micbias()
1168 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in __wcd937x_codec_enable_micbias_pullup() local
1173 wcd937x_micbias_control(component, micb_num, MICB_PULLUP_ENABLE, true); in __wcd937x_codec_enable_micbias_pullup()
1179 wcd937x_micbias_control(component, micb_num, MICB_PULLUP_DISABLE, true); in __wcd937x_codec_enable_micbias_pullup()
1221 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_rx_hph_mode_get() local
1222 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_hph_mode_get()
1231 struct snd_soc_component *component = in wcd937x_rx_hph_mode_put() local
1233 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_hph_mode_put()
1257 dev_dbg(component->dev, "%s: Invalid HPH Mode\n", __func__); in wcd937x_rx_hph_mode_put()
1264 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_get_compander() local
1265 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_get_compander()
1280 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_set_compander() local
1281 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_set_compander()
1370 static void wcd937x_mbhc_clk_setup(struct snd_soc_component *component, in wcd937x_mbhc_clk_setup() argument
1373 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_1, in wcd937x_mbhc_clk_setup()
1377 static void wcd937x_mbhc_mbhc_bias_control(struct snd_soc_component *component, in wcd937x_mbhc_mbhc_bias_control() argument
1380 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_ELECT, in wcd937x_mbhc_mbhc_bias_control()
1384 static void wcd937x_mbhc_program_btn_thr(struct snd_soc_component *component, in wcd937x_mbhc_program_btn_thr() argument
1391 dev_err(component->dev, "%s: invalid number of buttons: %d\n", in wcd937x_mbhc_program_btn_thr()
1398 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_BTN0 + i, in wcd937x_mbhc_program_btn_thr()
1403 static bool wcd937x_mbhc_micb_en_status(struct snd_soc_component *component, int micb_num) in wcd937x_mbhc_micb_en_status() argument
1408 val = snd_soc_component_read_field(component, in wcd937x_mbhc_micb_en_status()
1417 static void wcd937x_mbhc_hph_l_pull_up_control(struct snd_soc_component *component, in wcd937x_mbhc_hph_l_pull_up_control() argument
1424 snd_soc_component_write_field(component, in wcd937x_mbhc_hph_l_pull_up_control()
1429 static int wcd937x_mbhc_request_micbias(struct snd_soc_component *component, in wcd937x_mbhc_request_micbias() argument
1432 return wcd937x_micbias_control(component, micb_num, req, false); in wcd937x_mbhc_request_micbias()
1435 static void wcd937x_mbhc_micb_ramp_control(struct snd_soc_component *component, in wcd937x_mbhc_micb_ramp_control() argument
1439 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1441 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1444 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1446 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1451 static int wcd937x_mbhc_micb_adjust_voltage(struct snd_soc_component *component, in wcd937x_mbhc_micb_adjust_voltage() argument
1454 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_micb_adjust_voltage()
1479 micb_en = snd_soc_component_read_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1481 cur_vout_ctl = snd_soc_component_read_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1496 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1500 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1505 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1519 static int wcd937x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *component, in wcd937x_mbhc_micb_ctrl_threshold_mic() argument
1522 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_micb_ctrl_threshold_mic()
1537 return wcd937x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2); in wcd937x_mbhc_micb_ctrl_threshold_mic()
1540 static void wcd937x_mbhc_get_result_params(struct snd_soc_component *component, in wcd937x_mbhc_get_result_params() argument
1544 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_get_result_params()
1571 dev_err(component->dev, "Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd937x_mbhc_get_result_params()
1582 dev_err(component->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d (milliohm)\n", in wcd937x_mbhc_get_result_params()
1600 static void wcd937x_mbhc_zdet_ramp(struct snd_soc_component *component, in wcd937x_mbhc_zdet_ramp() argument
1604 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_zdet_ramp()
1607 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, in wcd937x_mbhc_zdet_ramp()
1609 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN5, in wcd937x_mbhc_zdet_ramp()
1611 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN6, in wcd937x_mbhc_zdet_ramp()
1613 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN7, in wcd937x_mbhc_zdet_ramp()
1615 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, in wcd937x_mbhc_zdet_ramp()
1617 snd_soc_component_update_bits(component, WCD937X_MBHC_NEW_ZDET_RAMP_CTL, in wcd937x_mbhc_zdet_ramp()
1625 wcd937x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd937x_mbhc_zdet_ramp()
1637 wcd937x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd937x_mbhc_zdet_ramp()
1644 static void wcd937x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component, in wcd937x_wcd_mbhc_qfuse_cal() argument
1651 q1 = snd_soc_component_read(component, in wcd937x_wcd_mbhc_qfuse_cal()
1654 q1 = snd_soc_component_read(component, in wcd937x_wcd_mbhc_qfuse_cal()
1664 static void wcd937x_wcd_mbhc_calc_impedance(struct snd_soc_component *component, in wcd937x_wcd_mbhc_calc_impedance() argument
1667 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_wcd_mbhc_calc_impedance()
1687 reg0 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN5); in wcd937x_wcd_mbhc_calc_impedance()
1688 reg1 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN6); in wcd937x_wcd_mbhc_calc_impedance()
1689 reg2 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN7); in wcd937x_wcd_mbhc_calc_impedance()
1690 reg3 = snd_soc_component_read(component, WCD937X_MBHC_CTL_CLK); in wcd937x_wcd_mbhc_calc_impedance()
1691 reg4 = snd_soc_component_read(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL); in wcd937x_wcd_mbhc_calc_impedance()
1693 if (snd_soc_component_read(component, WCD937X_ANA_MBHC_ELECT) & 0x80) { in wcd937x_wcd_mbhc_calc_impedance()
1719 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1l, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1736 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1l, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1746 wcd937x_wcd_mbhc_qfuse_cal(component, zl, 0); in wcd937x_wcd_mbhc_calc_impedance()
1750 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1r, d1); in wcd937x_wcd_mbhc_calc_impedance()
1768 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1r, d1); in wcd937x_wcd_mbhc_calc_impedance()
1776 wcd937x_wcd_mbhc_qfuse_cal(component, zr, 1); in wcd937x_wcd_mbhc_calc_impedance()
1782 dev_err(component->dev, in wcd937x_wcd_mbhc_calc_impedance()
1794 snd_soc_component_write_field(component, WCD937X_HPH_R_ATEST, in wcd937x_wcd_mbhc_calc_impedance()
1796 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_wcd_mbhc_calc_impedance()
1799 wcd937x_mbhc_zdet_ramp(component, &zdet_param[0], &z1ls, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1801 wcd937x_mbhc_zdet_ramp(component, &zdet_param[1], &z1ls, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1802 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_wcd_mbhc_calc_impedance()
1804 snd_soc_component_write_field(component, WCD937X_HPH_R_ATEST, in wcd937x_wcd_mbhc_calc_impedance()
1807 wcd937x_wcd_mbhc_qfuse_cal(component, &z1ls, 0); in wcd937x_wcd_mbhc_calc_impedance()
1821 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN5, reg0); in wcd937x_wcd_mbhc_calc_impedance()
1822 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN6, reg1); in wcd937x_wcd_mbhc_calc_impedance()
1823 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN7, reg2); in wcd937x_wcd_mbhc_calc_impedance()
1833 snd_soc_component_write(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, reg4); in wcd937x_wcd_mbhc_calc_impedance()
1834 snd_soc_component_write(component, WCD937X_MBHC_CTL_CLK, reg3); in wcd937x_wcd_mbhc_calc_impedance()
1840 static void wcd937x_mbhc_gnd_det_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_gnd_det_ctrl() argument
1844 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1846 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1849 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1851 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1856 static void wcd937x_mbhc_hph_pull_down_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_hph_pull_down_ctrl() argument
1859 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_mbhc_hph_pull_down_ctrl()
1861 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_mbhc_hph_pull_down_ctrl()
1865 static void wcd937x_mbhc_moisture_config(struct snd_soc_component *component) in wcd937x_mbhc_moisture_config() argument
1867 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_moisture_config()
1870 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1877 dev_err(component->dev, "%s: disable moisture detection for NC\n", in wcd937x_mbhc_moisture_config()
1879 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1884 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1888 static void wcd937x_mbhc_moisture_detect_en(struct snd_soc_component *component, bool enable) in wcd937x_mbhc_moisture_detect_en() argument
1890 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_moisture_detect_en()
1893 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_detect_en()
1896 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_detect_en()
1900 static bool wcd937x_mbhc_get_moisture_status(struct snd_soc_component *component) in wcd937x_mbhc_get_moisture_status() argument
1902 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_get_moisture_status()
1906 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_get_moisture_status()
1913 dev_err(component->dev, "%s: disable moisture detection for NC\n", in wcd937x_mbhc_get_moisture_status()
1915 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_get_moisture_status()
1924 if (snd_soc_component_read_field(component, WCD937X_MBHC_NEW_CTL_2, WCD937X_M_RTH_CTL_MASK)) in wcd937x_mbhc_get_moisture_status()
1927 wcd937x_mbhc_moisture_detect_en(component, true); in wcd937x_mbhc_get_moisture_status()
1929 ret = ((snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS) in wcd937x_mbhc_get_moisture_status()
1935 static void wcd937x_mbhc_moisture_polling_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_moisture_polling_ctrl() argument
1938 snd_soc_component_write_field(component, in wcd937x_mbhc_moisture_polling_ctrl()
1964 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_get_hph_type() local
1965 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_get_hph_type()
1978 struct snd_soc_component *component = in wcd937x_hph_impedance_get() local
1980 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_hph_impedance_get()
2002 static int wcd937x_mbhc_init(struct snd_soc_component *component) in wcd937x_mbhc_init() argument
2004 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_init()
2022 wcd937x->wcd_mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd937x_mbhc_init()
2026 snd_soc_add_component_controls(component, impedance_detect_controls, in wcd937x_mbhc_init()
2028 snd_soc_add_component_controls(component, hph_type_detect_controls, in wcd937x_mbhc_init()
2034 static void wcd937x_mbhc_deinit(struct snd_soc_component *component) in wcd937x_mbhc_deinit() argument
2036 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_deinit()
2494 static int wcd937x_soc_codec_probe(struct snd_soc_component *component) in wcd937x_soc_codec_probe() argument
2496 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wcd937x_soc_codec_probe()
2497 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_soc_codec_probe()
2499 struct device *dev = component->dev; in wcd937x_soc_codec_probe()
2511 snd_soc_component_init_regmap(component, wcd937x->regmap); in wcd937x_soc_codec_probe()
2516 chipid = (snd_soc_component_read(component, in wcd937x_soc_codec_probe()
2524 wcd937x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD937X); in wcd937x_soc_codec_probe()
2572 dev_err(component->dev, "Failed to add snd_ctls\n"); in wcd937x_soc_codec_probe()
2580 dev_err(component->dev, "Failed to add routes\n"); in wcd937x_soc_codec_probe()
2586 ret = wcd937x_mbhc_init(component); in wcd937x_soc_codec_probe()
2588 dev_err(component->dev, "mbhc initialization failed\n"); in wcd937x_soc_codec_probe()
2593 static void wcd937x_soc_codec_remove(struct snd_soc_component *component) in wcd937x_soc_codec_remove() argument
2595 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_soc_codec_remove()
2597 wcd937x_mbhc_deinit(component); in wcd937x_soc_codec_remove()
2658 static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component) in wcd937x_swap_gnd_mic() argument
2663 wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_swap_gnd_mic()