Lines Matching full:component
4 #include <linux/component.h>
300 static int wcd937x_rx_clk_enable(struct snd_soc_component *component) in wcd937x_rx_clk_enable() argument
302 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_clk_enable()
307 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_DIG_CLK_CTL, BIT(3), BIT(3)); in wcd937x_rx_clk_enable()
308 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(0), BIT(0)); in wcd937x_rx_clk_enable()
309 snd_soc_component_update_bits(component, WCD937X_ANA_RX_SUPPLIES, BIT(0), BIT(0)); in wcd937x_rx_clk_enable()
310 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX0_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
311 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX1_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
312 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_RX2_CTL, BIT(6), 0x00); in wcd937x_rx_clk_enable()
313 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(1), BIT(1)); in wcd937x_rx_clk_enable()
320 static int wcd937x_rx_clk_disable(struct snd_soc_component *component) in wcd937x_rx_clk_disable() argument
322 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_clk_disable()
325 dev_err(component->dev, "clk already disabled\n"); in wcd937x_rx_clk_disable()
331 snd_soc_component_update_bits(component, WCD937X_ANA_RX_SUPPLIES, BIT(0), 0x00); in wcd937x_rx_clk_disable()
332 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(1), 0x00); in wcd937x_rx_clk_disable()
333 snd_soc_component_update_bits(component, WCD937X_DIGITAL_CDC_ANA_CLK_CTL, BIT(0), 0x00); in wcd937x_rx_clk_disable()
342 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_hphl_dac_event() local
343 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_hphl_dac_event()
348 wcd937x_rx_clk_enable(component); in wcd937x_codec_hphl_dac_event()
349 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
352 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
355 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
362 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
366 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
371 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
374 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
379 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
382 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
391 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
394 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
399 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
404 snd_soc_component_update_bits(component, in wcd937x_codec_hphl_dac_event()
417 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_hphr_dac_event() local
418 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_hphr_dac_event()
423 wcd937x_rx_clk_enable(component); in wcd937x_codec_hphr_dac_event()
424 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
426 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
428 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
434 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
438 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
442 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
445 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
448 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
451 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
461 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
464 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
468 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
473 snd_soc_component_update_bits(component, in wcd937x_codec_hphr_dac_event()
486 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_ear_dac_event() local
487 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_ear_dac_event()
492 wcd937x_rx_clk_enable(component); in wcd937x_codec_ear_dac_event()
493 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
496 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
501 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
505 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
509 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
514 snd_soc_component_update_bits(component, WCD937X_FLYBACK_EN, BIT(2), 0x00); in wcd937x_codec_ear_dac_event()
524 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
528 snd_soc_component_update_bits(component, in wcd937x_codec_ear_dac_event()
541 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_aux_dac_event() local
542 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_aux_dac_event()
547 wcd937x_rx_clk_enable(component); in wcd937x_codec_aux_dac_event()
548 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
551 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
554 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
564 snd_soc_component_update_bits(component, in wcd937x_codec_aux_dac_event()
577 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_hphr_pa() local
578 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_hphr_pa()
587 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphr_pa()
591 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
604 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
608 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
628 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphr_pa()
630 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphr_pa()
646 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_hphl_pa() local
647 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_hphl_pa()
656 snd_soc_component_update_bits(component, WCD937X_ANA_HPH, in wcd937x_codec_enable_hphl_pa()
660 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
672 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
676 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
696 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
698 snd_soc_component_update_bits(component, in wcd937x_codec_enable_hphl_pa()
714 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_aux_pa() local
715 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_aux_pa()
724 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
732 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
746 snd_soc_component_update_bits(component, in wcd937x_codec_enable_aux_pa()
760 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_ear_pa() local
761 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_ear_pa()
767 wcd937x->ear_rx_path = snd_soc_component_read(component, in wcd937x_codec_enable_ear_pa()
771 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
775 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
779 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
786 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
803 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
811 snd_soc_component_update_bits(component, WCD937X_FLYBACK_EN, in wcd937x_codec_enable_ear_pa()
815 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
819 snd_soc_component_update_bits(component, in wcd937x_codec_enable_ear_pa()
832 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx1() local
835 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx1()
836 snd_soc_component_update_bits(component, in wcd937x_enable_rx1()
847 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx2() local
850 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx2()
851 snd_soc_component_update_bits(component, in wcd937x_enable_rx2()
863 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_rx3() local
867 wcd937x_rx_clk_disable(component); in wcd937x_enable_rx3()
868 snd_soc_component_update_bits(component, in wcd937x_enable_rx3()
889 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_tx_swr_ctrl() local
890 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_tx_swr_ctrl()
891 bool use_amic3 = snd_soc_component_read(component, WCD937X_TX_NEW_TX_CH2_SEL) & BIT(7); in wcd937x_tx_swr_ctrl()
904 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_adc() local
905 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_codec_enable_adc()
910 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
912 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
914 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
921 snd_soc_component_update_bits(component, in wcd937x_codec_enable_adc()
932 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_enable_req() local
933 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_enable_req()
937 snd_soc_component_update_bits(component, in wcd937x_enable_req()
939 snd_soc_component_update_bits(component, in wcd937x_enable_req()
941 snd_soc_component_update_bits(component, in wcd937x_enable_req()
943 snd_soc_component_update_bits(component, in wcd937x_enable_req()
945 snd_soc_component_update_bits(component, in wcd937x_enable_req()
947 snd_soc_component_update_bits(component, in wcd937x_enable_req()
949 snd_soc_component_update_bits(component, in wcd937x_enable_req()
951 snd_soc_component_update_bits(component, in wcd937x_enable_req()
953 snd_soc_component_update_bits(component, in wcd937x_enable_req()
957 snd_soc_component_update_bits(component, in wcd937x_enable_req()
959 snd_soc_component_update_bits(component, in wcd937x_enable_req()
961 snd_soc_component_update_bits(component, in wcd937x_enable_req()
963 snd_soc_component_update_bits(component, in wcd937x_enable_req()
968 snd_soc_component_update_bits(component, in wcd937x_enable_req()
974 snd_soc_component_update_bits(component, in wcd937x_enable_req()
987 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd937x_codec_enable_dmic() local
1004 dev_err(component->dev, "Invalid DMIC Selection\n"); in wcd937x_codec_enable_dmic()
1010 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1013 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1015 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1017 snd_soc_component_update_bits(component, in wcd937x_codec_enable_dmic()
1025 static int wcd937x_micbias_control(struct snd_soc_component *component, in wcd937x_micbias_control() argument
1028 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_micbias_control()
1033 dev_err(component->dev, "Invalid micbias index, micb_ind:%d\n", micb_index); in wcd937x_micbias_control()
1047 dev_err(component->dev, "Invalid micbias number: %d\n", micb_num); in wcd937x_micbias_control()
1057 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1065 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1072 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1075 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1078 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1081 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1084 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1087 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1105 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1113 snd_soc_component_update_bits(component, micb_reg, in wcd937x_micbias_control()
1124 snd_soc_component_update_bits(component, in wcd937x_micbias_control()
1139 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in __wcd937x_codec_enable_micbias() local
1144 wcd937x_micbias_control(component, micb_num, in __wcd937x_codec_enable_micbias()
1151 wcd937x_micbias_control(component, micb_num, in __wcd937x_codec_enable_micbias()
1169 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in __wcd937x_codec_enable_micbias_pullup() local
1174 wcd937x_micbias_control(component, micb_num, MICB_PULLUP_ENABLE, true); in __wcd937x_codec_enable_micbias_pullup()
1180 wcd937x_micbias_control(component, micb_num, MICB_PULLUP_DISABLE, true); in __wcd937x_codec_enable_micbias_pullup()
1214 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_rx_hph_mode_get() local
1215 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_hph_mode_get()
1224 struct snd_soc_component *component = in wcd937x_rx_hph_mode_put() local
1226 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_rx_hph_mode_put()
1250 dev_dbg(component->dev, "%s: Invalid HPH Mode\n", __func__); in wcd937x_rx_hph_mode_put()
1257 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_get_compander() local
1258 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_get_compander()
1273 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_set_compander() local
1274 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_set_compander()
1363 static void wcd937x_mbhc_clk_setup(struct snd_soc_component *component, in wcd937x_mbhc_clk_setup() argument
1366 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_1, in wcd937x_mbhc_clk_setup()
1370 static void wcd937x_mbhc_mbhc_bias_control(struct snd_soc_component *component, in wcd937x_mbhc_mbhc_bias_control() argument
1373 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_ELECT, in wcd937x_mbhc_mbhc_bias_control()
1377 static void wcd937x_mbhc_program_btn_thr(struct snd_soc_component *component, in wcd937x_mbhc_program_btn_thr() argument
1384 dev_err(component->dev, "%s: invalid number of buttons: %d\n", in wcd937x_mbhc_program_btn_thr()
1391 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_BTN0 + i, in wcd937x_mbhc_program_btn_thr()
1396 static bool wcd937x_mbhc_micb_en_status(struct snd_soc_component *component, int micb_num) in wcd937x_mbhc_micb_en_status() argument
1401 val = snd_soc_component_read_field(component, in wcd937x_mbhc_micb_en_status()
1410 static void wcd937x_mbhc_hph_l_pull_up_control(struct snd_soc_component *component, in wcd937x_mbhc_hph_l_pull_up_control() argument
1417 snd_soc_component_write_field(component, in wcd937x_mbhc_hph_l_pull_up_control()
1422 static int wcd937x_mbhc_request_micbias(struct snd_soc_component *component, in wcd937x_mbhc_request_micbias() argument
1425 return wcd937x_micbias_control(component, micb_num, req, false); in wcd937x_mbhc_request_micbias()
1428 static void wcd937x_mbhc_micb_ramp_control(struct snd_soc_component *component, in wcd937x_mbhc_micb_ramp_control() argument
1432 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1434 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1437 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1439 snd_soc_component_write_field(component, WCD937X_ANA_MICB2_RAMP, in wcd937x_mbhc_micb_ramp_control()
1444 static int wcd937x_mbhc_micb_adjust_voltage(struct snd_soc_component *component, in wcd937x_mbhc_micb_adjust_voltage() argument
1447 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_micb_adjust_voltage()
1472 micb_en = snd_soc_component_read_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1474 cur_vout_ctl = snd_soc_component_read_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1489 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1493 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1498 snd_soc_component_write_field(component, micb_reg, in wcd937x_mbhc_micb_adjust_voltage()
1512 static int wcd937x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *component, in wcd937x_mbhc_micb_ctrl_threshold_mic() argument
1515 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_micb_ctrl_threshold_mic()
1530 return wcd937x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2); in wcd937x_mbhc_micb_ctrl_threshold_mic()
1533 static void wcd937x_mbhc_get_result_params(struct snd_soc_component *component, in wcd937x_mbhc_get_result_params() argument
1537 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_get_result_params()
1564 dev_err(component->dev, "Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd937x_mbhc_get_result_params()
1575 dev_err(component->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d (milliohm)\n", in wcd937x_mbhc_get_result_params()
1593 static void wcd937x_mbhc_zdet_ramp(struct snd_soc_component *component, in wcd937x_mbhc_zdet_ramp() argument
1597 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_zdet_ramp()
1600 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, in wcd937x_mbhc_zdet_ramp()
1602 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN5, in wcd937x_mbhc_zdet_ramp()
1604 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN6, in wcd937x_mbhc_zdet_ramp()
1606 snd_soc_component_update_bits(component, WCD937X_ANA_MBHC_BTN7, in wcd937x_mbhc_zdet_ramp()
1608 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, in wcd937x_mbhc_zdet_ramp()
1610 snd_soc_component_update_bits(component, WCD937X_MBHC_NEW_ZDET_RAMP_CTL, in wcd937x_mbhc_zdet_ramp()
1618 wcd937x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd937x_mbhc_zdet_ramp()
1630 wcd937x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd937x_mbhc_zdet_ramp()
1637 static void wcd937x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component, in wcd937x_wcd_mbhc_qfuse_cal() argument
1644 q1 = snd_soc_component_read(component, in wcd937x_wcd_mbhc_qfuse_cal()
1647 q1 = snd_soc_component_read(component, in wcd937x_wcd_mbhc_qfuse_cal()
1657 static void wcd937x_wcd_mbhc_calc_impedance(struct snd_soc_component *component, in wcd937x_wcd_mbhc_calc_impedance() argument
1660 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_wcd_mbhc_calc_impedance()
1680 reg0 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN5); in wcd937x_wcd_mbhc_calc_impedance()
1681 reg1 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN6); in wcd937x_wcd_mbhc_calc_impedance()
1682 reg2 = snd_soc_component_read(component, WCD937X_ANA_MBHC_BTN7); in wcd937x_wcd_mbhc_calc_impedance()
1683 reg3 = snd_soc_component_read(component, WCD937X_MBHC_CTL_CLK); in wcd937x_wcd_mbhc_calc_impedance()
1684 reg4 = snd_soc_component_read(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL); in wcd937x_wcd_mbhc_calc_impedance()
1686 if (snd_soc_component_read(component, WCD937X_ANA_MBHC_ELECT) & 0x80) { in wcd937x_wcd_mbhc_calc_impedance()
1712 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1l, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1729 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, &z1l, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1739 wcd937x_wcd_mbhc_qfuse_cal(component, zl, 0); in wcd937x_wcd_mbhc_calc_impedance()
1743 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1r, d1); in wcd937x_wcd_mbhc_calc_impedance()
1761 wcd937x_mbhc_zdet_ramp(component, zdet_param_ptr, NULL, &z1r, d1); in wcd937x_wcd_mbhc_calc_impedance()
1769 wcd937x_wcd_mbhc_qfuse_cal(component, zr, 1); in wcd937x_wcd_mbhc_calc_impedance()
1775 dev_err(component->dev, in wcd937x_wcd_mbhc_calc_impedance()
1787 snd_soc_component_write_field(component, WCD937X_HPH_R_ATEST, in wcd937x_wcd_mbhc_calc_impedance()
1789 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_wcd_mbhc_calc_impedance()
1792 wcd937x_mbhc_zdet_ramp(component, &zdet_param[0], &z1ls, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1794 wcd937x_mbhc_zdet_ramp(component, &zdet_param[1], &z1ls, NULL, d1); in wcd937x_wcd_mbhc_calc_impedance()
1795 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_wcd_mbhc_calc_impedance()
1797 snd_soc_component_write_field(component, WCD937X_HPH_R_ATEST, in wcd937x_wcd_mbhc_calc_impedance()
1800 wcd937x_wcd_mbhc_qfuse_cal(component, &z1ls, 0); in wcd937x_wcd_mbhc_calc_impedance()
1814 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN5, reg0); in wcd937x_wcd_mbhc_calc_impedance()
1815 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN6, reg1); in wcd937x_wcd_mbhc_calc_impedance()
1816 snd_soc_component_write(component, WCD937X_ANA_MBHC_BTN7, reg2); in wcd937x_wcd_mbhc_calc_impedance()
1826 snd_soc_component_write(component, WCD937X_MBHC_NEW_ZDET_ANA_CTL, reg4); in wcd937x_wcd_mbhc_calc_impedance()
1827 snd_soc_component_write(component, WCD937X_MBHC_CTL_CLK, reg3); in wcd937x_wcd_mbhc_calc_impedance()
1833 static void wcd937x_mbhc_gnd_det_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_gnd_det_ctrl() argument
1837 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1839 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1842 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1844 snd_soc_component_write_field(component, WCD937X_ANA_MBHC_MECH, in wcd937x_mbhc_gnd_det_ctrl()
1849 static void wcd937x_mbhc_hph_pull_down_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_hph_pull_down_ctrl() argument
1852 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_mbhc_hph_pull_down_ctrl()
1854 snd_soc_component_write_field(component, WCD937X_HPH_PA_CTL2, in wcd937x_mbhc_hph_pull_down_ctrl()
1858 static void wcd937x_mbhc_moisture_config(struct snd_soc_component *component) in wcd937x_mbhc_moisture_config() argument
1860 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_moisture_config()
1863 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1870 dev_err(component->dev, "%s: disable moisture detection for NC\n", in wcd937x_mbhc_moisture_config()
1872 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1877 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_config()
1881 static void wcd937x_mbhc_moisture_detect_en(struct snd_soc_component *component, bool enable) in wcd937x_mbhc_moisture_detect_en() argument
1883 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_moisture_detect_en()
1886 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_detect_en()
1889 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_moisture_detect_en()
1893 static bool wcd937x_mbhc_get_moisture_status(struct snd_soc_component *component) in wcd937x_mbhc_get_moisture_status() argument
1895 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_get_moisture_status()
1899 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_get_moisture_status()
1906 dev_err(component->dev, "%s: disable moisture detection for NC\n", in wcd937x_mbhc_get_moisture_status()
1908 snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, in wcd937x_mbhc_get_moisture_status()
1917 if (snd_soc_component_read_field(component, WCD937X_MBHC_NEW_CTL_2, WCD937X_M_RTH_CTL_MASK)) in wcd937x_mbhc_get_moisture_status()
1920 wcd937x_mbhc_moisture_detect_en(component, true); in wcd937x_mbhc_get_moisture_status()
1922 ret = ((snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS) in wcd937x_mbhc_get_moisture_status()
1928 static void wcd937x_mbhc_moisture_polling_ctrl(struct snd_soc_component *component, in wcd937x_mbhc_moisture_polling_ctrl() argument
1931 snd_soc_component_write_field(component, in wcd937x_mbhc_moisture_polling_ctrl()
1957 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wcd937x_get_hph_type() local
1958 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_get_hph_type()
1971 struct snd_soc_component *component = in wcd937x_hph_impedance_get() local
1973 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_hph_impedance_get()
1995 static int wcd937x_mbhc_init(struct snd_soc_component *component) in wcd937x_mbhc_init() argument
1997 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_init()
2015 wcd937x->wcd_mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd937x_mbhc_init()
2019 snd_soc_add_component_controls(component, impedance_detect_controls, in wcd937x_mbhc_init()
2021 snd_soc_add_component_controls(component, hph_type_detect_controls, in wcd937x_mbhc_init()
2027 static void wcd937x_mbhc_deinit(struct snd_soc_component *component) in wcd937x_mbhc_deinit() argument
2029 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_mbhc_deinit()
2487 static int wcd937x_soc_codec_probe(struct snd_soc_component *component) in wcd937x_soc_codec_probe() argument
2489 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wcd937x_soc_codec_probe()
2490 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_soc_codec_probe()
2492 struct device *dev = component->dev; in wcd937x_soc_codec_probe()
2504 snd_soc_component_init_regmap(component, wcd937x->regmap); in wcd937x_soc_codec_probe()
2509 chipid = (snd_soc_component_read(component, in wcd937x_soc_codec_probe()
2517 wcd937x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD937X); in wcd937x_soc_codec_probe()
2565 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()
2579 ret = wcd937x_mbhc_init(component); in wcd937x_soc_codec_probe()
2581 dev_err(component->dev, "mbhc initialization failed\n"); in wcd937x_soc_codec_probe()
2586 static void wcd937x_soc_codec_remove(struct snd_soc_component *component) in wcd937x_soc_codec_remove() argument
2588 struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_soc_codec_remove()
2590 wcd937x_mbhc_deinit(component); in wcd937x_soc_codec_remove()
2651 static bool wcd937x_swap_gnd_mic(struct snd_soc_component *component, bool active) in wcd937x_swap_gnd_mic() argument
2656 wcd937x = snd_soc_component_get_drvdata(component); in wcd937x_swap_gnd_mic()