Lines Matching full:component

4 #include <linux/component.h>
301 static int wcd937x_rx_clk_enable(struct snd_soc_component *component) in wcd937x_rx_clk_enable() argument
303 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_clk_enable()
308 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_DIG_CLK_CTL, BIT(3), BIT(3)); in wcd937x_rx_clk_enable()
309 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(0), BIT(0)); in wcd937x_rx_clk_enable()
310 snd_soc_component_update_bits(component, WCD937X_ANA_RX_SUPPLIES, BIT(0), BIT(0)); in wcd937x_rx_clk_enable()
311 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX0_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
312 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX1_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
313 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX2_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
314 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(1), BIT(1)); in wcd937x_rx_clk_enable()
321 static int wcd937x_rx_clk_disable(struct snd_soc_component *component) in wcd937x_rx_clk_disable() argument
323 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_clk_disable()
326 dev_err(component->dev, "clk already disabled\n"); in wcd937x_rx_clk_disable()
332 snd_soc_component_update_bits(component, WCD937X_ANA_RX_SUPPLIES, BIT(0), 0x00); in wcd937x_rx_clk_disable()
333 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(1), 0x00); in wcd937x_rx_clk_disable()
334 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(0), 0x00); in wcd937x_rx_clk_disable()
343 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_hphl_dac_event() local
344 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_hphl_dac_event()
349 wcd937x_rx_clk_enable(component); in wcd937x_codec_hphl_dac_event()
350 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
353 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
356 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
363 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
367 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
372 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
375 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
380 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
383 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
392 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
395 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
400 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
405 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
418 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_hphr_dac_event() local
419 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_hphr_dac_event()
424 wcd937x_rx_clk_enable(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()
429 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
435 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
439 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
443 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
446 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
449 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
452 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
462 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
465 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
469 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
474 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
487 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_ear_dac_event() local
488 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_ear_dac_event()
493 wcd937x_rx_clk_enable(component); in wcd937x_codec_ear_dac_event()
494 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
497 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
502 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
506 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
510 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
515 snd_soc_component_update_bits(component, WCD937X_FLYBACK_EN, BIT(2), 0x00); in wcd937x_codec_ear_dac_event()
525 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
529 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
542 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_aux_dac_event() local
543 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_aux_dac_event()
548 wcd937x_rx_clk_enable(component); in wcd937x_codec_aux_dac_event()
549 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
552 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
555 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
565 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
578 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_hphr_pa() local
579 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_hphr_pa()
588 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphr_pa()
592 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
605 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
609 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
629 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
631 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphr_pa()
647 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_hphl_pa() local
648 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_hphl_pa()
657 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphl_pa()
661 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
673 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
677 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()
699 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
715 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_aux_pa() local
716 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_aux_pa()
725 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
733 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
747 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
761 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_ear_pa() local
762 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_ear_pa()
768 wcd937x->ear_rx_path = snd_soc_component_read(component, in wcd937x_codec_enable_ear_pa()
772 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
776 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
780 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
787 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
804 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
812 snd_soc_component_update_bits(component, WCD937X_FLYBACK_EN, in wcd937x_codec_enable_ear_pa()
816 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
820 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
833 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx1() local
836 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx1()
837 snd_soc_component_update_bits(component, in wcd937x_enable_rx1()
848 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx2() local
851 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx2()
852 snd_soc_component_update_bits(component, in wcd937x_enable_rx2()
864 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx3() local
868 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx3()
869 snd_soc_component_update_bits(component, in wcd937x_enable_rx3()
890 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_tx_swr_ctrl() local
891 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_tx_swr_ctrl()
892 bool use_amic3 = snd_soc_component_read(component, WCD937X_TX_NEW_TX_CH2_SEL) & BIT(7); in wcd937x_tx_swr_ctrl()
905 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_adc() local
906 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(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()
915 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
922 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
933 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_req() local
934 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(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()
954 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()
964 snd_soc_component_update_bits(component, in wcd937x_enable_req()
969 snd_soc_component_update_bits(component, in wcd937x_enable_req()
975 snd_soc_component_update_bits(component, in wcd937x_enable_req()
988 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_dmic() local
1005 dev_err(component->dev, "Invalid DMIC Selection\n"); in wcd937x_codec_enable_dmic()
1011 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()
1018 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1026 static int wcd937x_micbias_control(struct snd_soc_component *component, in wcd937x_micbias_control() argument
1029 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_micbias_control()
1034 dev_err(component->dev, "Invalid micbias index, micb_ind:%d\n", micb_index); in wcd937x_micbias_control()
1048 dev_err(component->dev, "Invalid micbias number: %d\n", micb_num); in wcd937x_micbias_control()
1058 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1066 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1073 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1076 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1079 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1082 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1085 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1088 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1106 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1114 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1125 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1140 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in __wcd937x_codec_enable_micbias() local
1145 wcd937x_micbias_control(component, micb_num, in __wcd937x_codec_enable_micbias()
1152 wcd937x_micbias_control(component, micb_num, in __wcd937x_codec_enable_micbias()
1170 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in __wcd937x_codec_enable_micbias_pullup() local
1175 wcd937x_micbias_control(component, micb_num, MICB_PULLUP_ENABLE, true); in __wcd937x_codec_enable_micbias_pullup()
1181 wcd937x_micbias_control(component, micb_num, MICB_PULLUP_DISABLE, true); in __wcd937x_codec_enable_micbias_pullup()
1215 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_rx_hph_mode_get() local
1216 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_hph_mode_get()
1225 struct snd_soc_component *component = in wcd937x_rx_hph_mode_put() local
1227 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_hph_mode_put()
1251 dev_dbg(component->dev, "%s: Invalid HPH Mode\n", __func__); in wcd937x_rx_hph_mode_put()
1258 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_get_compander() local
1259 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_get_compander()
1274 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_set_compander() local
1275 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_set_compander()
1364 static void wcd937x_mbhc_clk_setup(struct snd_soc_component *component, in wcd937x_mbhc_clk_setup() argument
1367 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_1, in wcd937x_mbhc_clk_setup()
1371 static void wcd937x_mbhc_mbhc_bias_control(struct snd_soc_component *component, in wcd937x_mbhc_mbhc_bias_control() argument
1374 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_ELECT, in wcd937x_mbhc_mbhc_bias_control()
1378 static void wcd937x_mbhc_program_btn_thr(struct snd_soc_component *component, in wcd937x_mbhc_program_btn_thr() argument
1385 dev_err(component->dev, "%s: invalid number of buttons: %d\n", in wcd937x_mbhc_program_btn_thr()
1392 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_BTN0 + i, in wcd937x_mbhc_program_btn_thr()
1397 static bool wcd937x_mbhc_micb_en_status(struct snd_soc_component *component, int micb_num) in wcd937x_mbhc_micb_en_status() argument
1402 val = snd_soc_component_read_field(component, in wcd937x_mbhc_micb_en_status()
1411 static void wcd937x_mbhc_hph_l_pull_up_control(struct snd_soc_component *component, in wcd937x_mbhc_hph_l_pull_up_control() argument
1418 snd_soc_component_write_field(component, in wcd937x_mbhc_hph_l_pull_up_control()
1423 static int wcd937x_mbhc_request_micbias(struct snd_soc_component *component, in wcd937x_mbhc_request_micbias() argument
1426 return wcd937x_micbias_control(component, micb_num, req, false); in wcd937x_mbhc_request_micbias()
1429 static void wcd937x_mbhc_micb_ramp_control(struct snd_soc_component *component, in wcd937x_mbhc_micb_ramp_control() argument
1433 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1435 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1438 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1440 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1445 static int wcd937x_mbhc_micb_adjust_voltage(struct snd_soc_component *component, in wcd937x_mbhc_micb_adjust_voltage() argument
1448 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_micb_adjust_voltage()
1473 micb_en = snd_soc_component_read_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1475 cur_vout_ctl = snd_soc_component_read_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1490 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1494 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1499 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1513 static int wcd937x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *component, in wcd937x_mbhc_micb_ctrl_threshold_mic() argument
1516 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_micb_ctrl_threshold_mic()
1531 return wcd937x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2); in wcd937x_mbhc_micb_ctrl_threshold_mic()
1534 static void wcd937x_mbhc_get_result_params(struct snd_soc_component *component, in wcd937x_mbhc_get_result_params() argument
1538 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_get_result_params()
1565 dev_err(component->dev, "Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd937x_mbhc_get_result_params()
1576 dev_err(component->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d (milliohm)\n", in wcd937x_mbhc_get_result_params()
1594 static void wcd937x_mbhc_zdet_ramp(struct snd_soc_component *component, in wcd937x_mbhc_zdet_ramp() argument
1598 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_zdet_ramp()
1601 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, in wcd937x_mbhc_zdet_ramp()
1603 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN5, in wcd937x_mbhc_zdet_ramp()
1605 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN6, in wcd937x_mbhc_zdet_ramp()
1607 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN7, in wcd937x_mbhc_zdet_ramp()
1609 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, in wcd937x_mbhc_zdet_ramp()
1611 snd_soc_component_update_bits(component, WCD937X_MBHC_NEW_ZDET_RAMP_CTL, in wcd937x_mbhc_zdet_ramp()
1619 wcd937x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd937x_mbhc_zdet_ramp()
1631 wcd937x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd937x_mbhc_zdet_ramp()
1638 static void wcd937x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component, in wcd937x_wcd_mbhc_qfuse_cal() argument
1645 q1 = snd_soc_component_read(component, in wcd937x_wcd_mbhc_qfuse_cal()
1648 q1 = snd_soc_component_read(component, in wcd937x_wcd_mbhc_qfuse_cal()
1658 static void wcd937x_wcd_mbhc_calc_impedance(struct snd_soc_component *component, in wcd937x_wcd_mbhc_calc_impedance() argument
1661 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_wcd_mbhc_calc_impedance()
1681 reg0 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN5); in wcd937x_wcd_mbhc_calc_impedance()
1682 reg1 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN6); in wcd937x_wcd_mbhc_calc_impedance()
1683 reg2 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN7); in wcd937x_wcd_mbhc_calc_impedance()
1684 reg3 = snd_soc_component_read(component, WCD937X_MBHC_CTL_CLK); in wcd937x_wcd_mbhc_calc_impedance()
1685 reg4 = snd_soc_component_read(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL); in wcd937x_wcd_mbhc_calc_impedance()
1687 if (snd_soc_component_read(component, WCD937X_ANA_MBHC_ELECT) & 0x80) { in wcd937x_wcd_mbhc_calc_impedance()
1713 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1l, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1730 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1l, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1740 wcd937x_wcd_mbhc_qfuse_cal(component, zl, 0); in wcd937x_wcd_mbhc_calc_impedance()
1744 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1r, d1); in wcd937x_wcd_mbhc_calc_impedance()
1762 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1r, d1); in wcd937x_wcd_mbhc_calc_impedance()
1770 wcd937x_wcd_mbhc_qfuse_cal(component, zr, 1); in wcd937x_wcd_mbhc_calc_impedance()
1776 dev_err(component->dev, in wcd937x_wcd_mbhc_calc_impedance()
1788 snd_soc_component_write_field(component, WCD937X_HPH_R_ATEST, in wcd937x_wcd_mbhc_calc_impedance()
1790 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_wcd_mbhc_calc_impedance()
1793 wcd937x_mbhc_zdet_ramp(component, &zdet_param[0], &z1ls, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1795 wcd937x_mbhc_zdet_ramp(component, &zdet_param[1], &z1ls, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1796 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_wcd_mbhc_calc_impedance()
1798 snd_soc_component_write_field(component, WCD937X_HPH_R_ATEST, in wcd937x_wcd_mbhc_calc_impedance()
1801 wcd937x_wcd_mbhc_qfuse_cal(component, &z1ls, 0); in wcd937x_wcd_mbhc_calc_impedance()
1815 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN5, reg0); in wcd937x_wcd_mbhc_calc_impedance()
1816 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN6, reg1); in wcd937x_wcd_mbhc_calc_impedance()
1817 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN7, reg2); in wcd937x_wcd_mbhc_calc_impedance()
1827 snd_soc_component_write(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, reg4); in wcd937x_wcd_mbhc_calc_impedance()
1828 snd_soc_component_write(component, WCD937X_MBHC_CTL_CLK, reg3); in wcd937x_wcd_mbhc_calc_impedance()
1834 static void wcd937x_mbhc_gnd_det_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_gnd_det_ctrl() argument
1838 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1840 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1843 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1845 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1850 static void wcd937x_mbhc_hph_pull_down_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_hph_pull_down_ctrl() argument
1853 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_mbhc_hph_pull_down_ctrl()
1855 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_mbhc_hph_pull_down_ctrl()
1859 static void wcd937x_mbhc_moisture_config(struct snd_soc_component *component) in wcd937x_mbhc_moisture_config() argument
1861 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_moisture_config()
1864 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1871 dev_err(component->dev, "%s: disable moisture detection for NC\n", in wcd937x_mbhc_moisture_config()
1873 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1878 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1882 static void wcd937x_mbhc_moisture_detect_en(struct snd_soc_component *component, bool enable) in wcd937x_mbhc_moisture_detect_en() argument
1884 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_moisture_detect_en()
1887 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_detect_en()
1890 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_detect_en()
1894 static bool wcd937x_mbhc_get_moisture_status(struct snd_soc_component *component) in wcd937x_mbhc_get_moisture_status() argument
1896 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_get_moisture_status()
1900 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_get_moisture_status()
1907 dev_err(component->dev, "%s: disable moisture detection for NC\n", in wcd937x_mbhc_get_moisture_status()
1909 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_get_moisture_status()
1918 if (snd_soc_component_read_field(component, WCD937X_MBHC_NEW_CTL_2, WCD937X_M_RTH_CTL_MASK)) in wcd937x_mbhc_get_moisture_status()
1921 wcd937x_mbhc_moisture_detect_en(component, true); in wcd937x_mbhc_get_moisture_status()
1923 ret = ((snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS) in wcd937x_mbhc_get_moisture_status()
1929 static void wcd937x_mbhc_moisture_polling_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_moisture_polling_ctrl() argument
1932 snd_soc_component_write_field(component, in wcd937x_mbhc_moisture_polling_ctrl()
1958 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_get_hph_type() local
1959 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_get_hph_type()
1972 struct snd_soc_component *component = in wcd937x_hph_impedance_get() local
1974 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_hph_impedance_get()
1996 static int wcd937x_mbhc_init(struct snd_soc_component *component) in wcd937x_mbhc_init() argument
1998 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_init()
2016 wcd937x->wcd_mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd937x_mbhc_init()
2020 snd_soc_add_component_controls(component, impedance_detect_controls, in wcd937x_mbhc_init()
2022 snd_soc_add_component_controls(component, hph_type_detect_controls, in wcd937x_mbhc_init()
2028 static void wcd937x_mbhc_deinit(struct snd_soc_component *component) in wcd937x_mbhc_deinit() argument
2030 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_deinit()
2488 static int wcd937x_soc_codec_probe(struct snd_soc_component *component) in wcd937x_soc_codec_probe() argument
2490 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wcd937x_soc_codec_probe()
2491 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_soc_codec_probe()
2493 struct device *dev = component->dev; in wcd937x_soc_codec_probe()
2505 snd_soc_component_init_regmap(component, wcd937x->regmap); in wcd937x_soc_codec_probe()
2510 chipid = (snd_soc_component_read(component, in wcd937x_soc_codec_probe()
2518 wcd937x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD937X); in wcd937x_soc_codec_probe()
2566 dev_err(component->dev, "Failed to add snd_ctls\n"); in wcd937x_soc_codec_probe()
2573 dev_err(component->dev, "Failed to add routes\n"); in wcd937x_soc_codec_probe()
2578 ret = wcd937x_mbhc_init(component); in wcd937x_soc_codec_probe()
2580 dev_err(component->dev, "mbhc initialization failed\n"); in wcd937x_soc_codec_probe()
2585 static void wcd937x_soc_codec_remove(struct snd_soc_component *component) in wcd937x_soc_codec_remove() argument
2587 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_soc_codec_remove()
2589 wcd937x_mbhc_deinit(component); in wcd937x_soc_codec_remove()
2650 static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component, bool active) in wcd937x_swap_gnd_mic() argument
2655 wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_swap_gnd_mic()