• Home
  • Raw
  • Download

Lines Matching refs:wcd938x

1361 static int wcd938x_io_init(struct wcd938x_priv *wcd938x)  in wcd938x_io_init()  argument
1363 struct regmap *rm = wcd938x->regmap; in wcd938x_io_init()
1486 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_hphl_dac_event() local
1504 if (wcd938x->comp1_enable) { in wcd938x_codec_hphl_dac_event()
1509 if (!wcd938x->comp2_enable || (snd_soc_component_read(component, in wcd938x_codec_hphl_dac_event()
1540 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_hphr_dac_event() local
1558 if (wcd938x->comp2_enable) { in wcd938x_codec_hphr_dac_event()
1563 if (!wcd938x->comp1_enable || in wcd938x_codec_hphr_dac_event()
1594 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_ear_dac_event() local
1598 wcd938x->ear_rx_path = in wcd938x_codec_ear_dac_event()
1601 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { in wcd938x_codec_ear_dac_event()
1621 if (wcd938x->comp1_enable) in wcd938x_codec_ear_dac_event()
1628 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_ear_dac_event()
1631 wcd938x->flyback_cur_det_disable++; in wcd938x_codec_ear_dac_event()
1632 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_ear_dac_event()
1635 wcd938x->hph_mode); in wcd938x_codec_ear_dac_event()
1638 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { in wcd938x_codec_ear_dac_event()
1652 if (wcd938x->comp1_enable) in wcd938x_codec_ear_dac_event()
1673 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_aux_dac_event() local
1686 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_aux_dac_event()
1689 wcd938x->flyback_cur_det_disable++; in wcd938x_codec_aux_dac_event()
1690 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_aux_dac_event()
1693 wcd938x->hph_mode); in wcd938x_codec_aux_dac_event()
1709 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_enable_hphr_pa() local
1710 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_hphr_pa()
1714 if (wcd938x->ldoh) in wcd938x_codec_enable_hphr_pa()
1717 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_PRE_DAC, in wcd938x_codec_enable_hphr_pa()
1719 wcd_clsh_set_hph_mode(wcd938x->clsh_info, CLS_H_HIFI); in wcd938x_codec_enable_hphr_pa()
1729 wcd_clsh_set_hph_mode(wcd938x->clsh_info, hph_mode); in wcd938x_codec_enable_hphr_pa()
1732 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
1743 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphr_pa()
1744 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
1754 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
1763 enable_irq(wcd938x->hphr_pdm_wd_int); in wcd938x_codec_enable_hphr_pa()
1766 disable_irq_nosync(wcd938x->hphr_pdm_wd_int); in wcd938x_codec_enable_hphr_pa()
1772 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
1778 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphr_pa()
1780 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
1788 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphr_pa()
1789 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
1793 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
1795 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphr_pa()
1801 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_hphr_pa()
1803 if (wcd938x->ldoh) in wcd938x_codec_enable_hphr_pa()
1816 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_enable_hphl_pa() local
1817 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_hphl_pa()
1821 if (wcd938x->ldoh) in wcd938x_codec_enable_hphl_pa()
1824 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_PRE_DAC, in wcd938x_codec_enable_hphl_pa()
1826 wcd_clsh_set_hph_mode(wcd938x->clsh_info, CLS_H_HIFI); in wcd938x_codec_enable_hphl_pa()
1835 wcd_clsh_set_hph_mode(wcd938x->clsh_info, hph_mode); in wcd938x_codec_enable_hphl_pa()
1838 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
1849 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphl_pa()
1850 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
1859 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
1869 enable_irq(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_hphl_pa()
1872 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_hphl_pa()
1878 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
1884 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, WCD_EVENT_PRE_HPHL_PA_OFF); in wcd938x_codec_enable_hphl_pa()
1885 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
1893 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphl_pa()
1894 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
1898 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
1900 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphl_pa()
1906 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_hphl_pa()
1908 if (wcd938x->ldoh) in wcd938x_codec_enable_hphl_pa()
1921 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_enable_aux_pa() local
1922 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_aux_pa()
1937 enable_irq(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_aux_pa()
1940 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_aux_pa()
1947 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_enable_aux_pa()
1952 wcd938x->flyback_cur_det_disable--; in wcd938x_codec_enable_aux_pa()
1953 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_enable_aux_pa()
1965 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_enable_ear_pa() local
1966 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_ear_pa()
1974 wcd938x->ear_rx_path = snd_soc_component_read(component, in wcd938x_codec_enable_ear_pa()
1976 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
1983 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_ear_pa()
1997 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
1998 enable_irq(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
2000 enable_irq(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
2003 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
2004 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
2006 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
2009 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_ear_pa()
2014 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
2021 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_ear_pa()
2024 wcd938x->flyback_cur_det_disable--; in wcd938x_codec_enable_ear_pa()
2025 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_enable_ear_pa()
2110 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_tx_swr_ctrl() local
2114 bank = (wcd938x_swr_get_current_bank(wcd938x->sdw_priv[AIF1_CAP]->sdev)) ? 0 : 1; in wcd938x_tx_swr_ctrl()
2122 if (test_bit(WCD_ADC1, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
2123 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC1]]; in wcd938x_tx_swr_ctrl()
2124 if (test_bit(WCD_ADC2, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
2125 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC2]]; in wcd938x_tx_swr_ctrl()
2126 if (test_bit(WCD_ADC3, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
2127 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC3]]; in wcd938x_tx_swr_ctrl()
2128 if (test_bit(WCD_ADC4, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
2129 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC4]]; in wcd938x_tx_swr_ctrl()
2194 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_codec_enable_adc() local
2204 set_bit(w->shift, &wcd938x->status_mask); in wcd938x_codec_enable_adc()
2209 clear_bit(w->shift, &wcd938x->status_mask); in wcd938x_codec_enable_adc()
2249 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_adc_enable_req() local
2261 mode = wcd938x_get_adc_mode(wcd938x->tx_mode[w->shift]); in wcd938x_adc_enable_req()
2354 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_micbias_control() local
2379 wcd938x->pullup_ref[micb_index]++; in wcd938x_micbias_control()
2380 if ((wcd938x->pullup_ref[micb_index] == 1) && in wcd938x_micbias_control()
2381 (wcd938x->micb_ref[micb_index] == 0)) in wcd938x_micbias_control()
2387 if (wcd938x->pullup_ref[micb_index] > 0) in wcd938x_micbias_control()
2388 wcd938x->pullup_ref[micb_index]--; in wcd938x_micbias_control()
2390 if ((wcd938x->pullup_ref[micb_index] == 0) && in wcd938x_micbias_control()
2391 (wcd938x->micb_ref[micb_index] == 0)) in wcd938x_micbias_control()
2396 wcd938x->micb_ref[micb_index]++; in wcd938x_micbias_control()
2397 if (wcd938x->micb_ref[micb_index] == 1) { in wcd938x_micbias_control()
2412 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
2416 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
2422 if (wcd938x->micb_ref[micb_index] > 0) in wcd938x_micbias_control()
2423 wcd938x->micb_ref[micb_index]--; in wcd938x_micbias_control()
2425 if ((wcd938x->micb_ref[micb_index] == 0) && in wcd938x_micbias_control()
2426 (wcd938x->pullup_ref[micb_index] > 0)) in wcd938x_micbias_control()
2430 else if ((wcd938x->micb_ref[micb_index] == 0) && in wcd938x_micbias_control()
2431 (wcd938x->pullup_ref[micb_index] == 0)) { in wcd938x_micbias_control()
2433 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
2439 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
2443 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
2503 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_tx_mode_get() local
2507 ucontrol->value.enumerated.item[0] = wcd938x->tx_mode[path]; in wcd938x_tx_mode_get()
2516 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_tx_mode_put() local
2520 if (wcd938x->tx_mode[path] == ucontrol->value.enumerated.item[0]) in wcd938x_tx_mode_put()
2523 wcd938x->tx_mode[path] = ucontrol->value.enumerated.item[0]; in wcd938x_tx_mode_put()
2532 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_rx_hph_mode_get() local
2534 ucontrol->value.enumerated.item[0] = wcd938x->hph_mode; in wcd938x_rx_hph_mode_get()
2543 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_rx_hph_mode_put() local
2545 if (wcd938x->hph_mode == ucontrol->value.enumerated.item[0]) in wcd938x_rx_hph_mode_put()
2548 wcd938x->hph_mode = ucontrol->value.enumerated.item[0]; in wcd938x_rx_hph_mode_put()
2557 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_ear_pa_put_gain() local
2559 if (wcd938x->comp1_enable) { in wcd938x_ear_pa_put_gain()
2576 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_get_compander() local
2584 ucontrol->value.integer.value[0] = wcd938x->comp2_enable; in wcd938x_get_compander()
2586 ucontrol->value.integer.value[0] = wcd938x->comp1_enable; in wcd938x_get_compander()
2595 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_set_compander() local
2605 wcd = wcd938x->sdw_priv[AIF1_PB]; in wcd938x_set_compander()
2608 wcd938x->comp2_enable = value; in wcd938x_set_compander()
2610 wcd938x->comp1_enable = value; in wcd938x_set_compander()
2626 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_ldoh_get() local
2628 ucontrol->value.integer.value[0] = wcd938x->ldoh; in wcd938x_ldoh_get()
2637 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_ldoh_put() local
2639 if (wcd938x->ldoh == ucontrol->value.integer.value[0]) in wcd938x_ldoh_put()
2642 wcd938x->ldoh = ucontrol->value.integer.value[0]; in wcd938x_ldoh_put()
2651 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_bcs_get() local
2653 ucontrol->value.integer.value[0] = wcd938x->bcs_dis; in wcd938x_bcs_get()
2662 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_bcs_put() local
2664 if (wcd938x->bcs_dis == ucontrol->value.integer.value[0]) in wcd938x_bcs_put()
2667 wcd938x->bcs_dis = ucontrol->value.integer.value[0]; in wcd938x_bcs_put()
2892 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(comp); in wcd938x_get_swr_port() local
2899 wcd = wcd938x->sdw_priv[dai_id]; in wcd938x_get_swr_port()
2911 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(comp); in wcd938x_set_swr_port() local
2920 wcd = wcd938x->sdw_priv[dai_id]; in wcd938x_set_swr_port()
3032 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_micb_adjust_voltage() local
3051 mutex_lock(&wcd938x->micb_lock); in wcd938x_mbhc_micb_adjust_voltage()
3096 mutex_unlock(&wcd938x->micb_lock); in wcd938x_mbhc_micb_adjust_voltage()
3103 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_micb_ctrl_threshold_mic() local
3113 if (wcd938x->micb2_mv >= WCD_MBHC_THR_HS_MICB_MV) in wcd938x_mbhc_micb_ctrl_threshold_mic()
3116 micb_mv = req_en ? WCD_MBHC_THR_HS_MICB_MV : wcd938x->micb2_mv; in wcd938x_mbhc_micb_ctrl_threshold_mic()
3123 static inline void wcd938x_mbhc_get_result_params(struct wcd938x_priv *wcd938x, in wcd938x_mbhc_get_result_params() argument
3136 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ZDET, 0x20, 0x20); in wcd938x_mbhc_get_result_params()
3138 regmap_read(wcd938x->regmap, WCD938X_ANA_MBHC_RESULT_2, &val); in wcd938x_mbhc_get_result_params()
3143 regmap_read(wcd938x->regmap, WCD938X_ANA_MBHC_RESULT_1, &val1); in wcd938x_mbhc_get_result_params()
3145 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ZDET, 0x20, 0x00); in wcd938x_mbhc_get_result_params()
3169 regmap_read(wcd938x->regmap, in wcd938x_mbhc_get_result_params()
3171 regmap_read(wcd938x->regmap, in wcd938x_mbhc_get_result_params()
3186 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_zdet_ramp() local
3205 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
3209 wcd938x_mbhc_get_result_params(wcd938x, d1_a, zdet_param->noff, &zdet); in wcd938x_mbhc_zdet_ramp()
3210 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
3219 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
3223 wcd938x_mbhc_get_result_params(wcd938x, d1_a, zdet_param->noff, &zdet); in wcd938x_mbhc_zdet_ramp()
3224 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
3253 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_wcd_mbhc_calc_impedance() local
3281 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3286 if (wcd938x->mbhc_cfg.hphl_swh) in wcd938x_wcd_mbhc_calc_impedance()
3287 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3291 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3297 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3384 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_MONO); in wcd938x_wcd_mbhc_calc_impedance()
3408 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_STEREO); in wcd938x_wcd_mbhc_calc_impedance()
3412 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_MONO); in wcd938x_wcd_mbhc_calc_impedance()
3416 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3423 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3427 if (wcd938x->mbhc_cfg.hphl_swh) in wcd938x_wcd_mbhc_calc_impedance()
3428 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3434 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
3465 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_moisture_config() local
3467 if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { in wcd938x_mbhc_moisture_config()
3474 if (!wcd938x->mbhc_cfg.hphl_swh) { in wcd938x_mbhc_moisture_config()
3483 WCD938X_M_RTH_CTL_MASK, wcd938x->mbhc_cfg.moist_rref); in wcd938x_mbhc_moisture_config()
3488 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_moisture_detect_en() local
3492 WCD938X_M_RTH_CTL_MASK, wcd938x->mbhc_cfg.moist_rref); in wcd938x_mbhc_moisture_detect_en()
3500 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_get_moisture_status() local
3503 if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { in wcd938x_mbhc_get_moisture_status()
3510 if (!wcd938x->mbhc_cfg.hphl_swh) { in wcd938x_mbhc_get_moisture_status()
3565 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_get_hph_type() local
3567 ucontrol->value.integer.value[0] = wcd_mbhc_get_hph_type(wcd938x->wcd_mbhc); in wcd938x_get_hph_type()
3580 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_hph_impedance_get() local
3584 wcd_mbhc_get_impedance(wcd938x->wcd_mbhc, &zl, &zr); in wcd938x_hph_impedance_get()
3605 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_init() local
3606 struct wcd_mbhc_intr *intr_ids = &wcd938x->intr_ids; in wcd938x_mbhc_init()
3608 intr_ids->mbhc_sw_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3610 intr_ids->mbhc_btn_press_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3612 intr_ids->mbhc_btn_release_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3614 intr_ids->mbhc_hs_ins_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3616 intr_ids->mbhc_hs_rem_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3618 intr_ids->hph_left_ocp = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3620 intr_ids->hph_right_ocp = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
3623 wcd938x->wcd_mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd938x_mbhc_init()
3624 if (IS_ERR(wcd938x->wcd_mbhc)) in wcd938x_mbhc_init()
3625 return PTR_ERR(wcd938x->wcd_mbhc); in wcd938x_mbhc_init()
3637 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_mbhc_deinit() local
3639 wcd_mbhc_deinit(wcd938x->wcd_mbhc); in wcd938x_mbhc_deinit()
4024 static int wcd938x_set_micbias_data(struct wcd938x_priv *wcd938x) in wcd938x_set_micbias_data() argument
4029 vout_ctl_1 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb1_mv); in wcd938x_set_micbias_data()
4030 vout_ctl_2 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb2_mv); in wcd938x_set_micbias_data()
4031 vout_ctl_3 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb3_mv); in wcd938x_set_micbias_data()
4032 vout_ctl_4 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb4_mv); in wcd938x_set_micbias_data()
4036 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB1, in wcd938x_set_micbias_data()
4038 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB2, in wcd938x_set_micbias_data()
4040 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB3, in wcd938x_set_micbias_data()
4042 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB4, in wcd938x_set_micbias_data()
4088 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_soc_codec_probe() local
4089 struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev; in wcd938x_soc_codec_probe()
4101 snd_soc_component_init_regmap(component, wcd938x->regmap); in wcd938x_soc_codec_probe()
4107 wcd938x->variant = snd_soc_component_read_field(component, in wcd938x_soc_codec_probe()
4111 wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X); in wcd938x_soc_codec_probe()
4112 if (IS_ERR(wcd938x->clsh_info)) { in wcd938x_soc_codec_probe()
4114 return PTR_ERR(wcd938x->clsh_info); in wcd938x_soc_codec_probe()
4117 wcd938x_io_init(wcd938x); in wcd938x_soc_codec_probe()
4120 regmap_write(wcd938x->regmap, in wcd938x_soc_codec_probe()
4126 wcd938x->hphr_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
4128 wcd938x->hphl_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
4130 wcd938x->aux_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
4134 ret = request_threaded_irq(wcd938x->hphr_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
4136 "HPHR PDM WD INT", wcd938x); in wcd938x_soc_codec_probe()
4142 ret = request_threaded_irq(wcd938x->hphl_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
4144 "HPHL PDM WD INT", wcd938x); in wcd938x_soc_codec_probe()
4150 ret = request_threaded_irq(wcd938x->aux_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
4152 "AUX PDM WD INT", wcd938x); in wcd938x_soc_codec_probe()
4159 disable_irq_nosync(wcd938x->hphr_pdm_wd_int); in wcd938x_soc_codec_probe()
4160 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_soc_codec_probe()
4161 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_soc_codec_probe()
4163 switch (wcd938x->variant) { in wcd938x_soc_codec_probe()
4170 __func__, wcd938x->variant); in wcd938x_soc_codec_probe()
4180 __func__, wcd938x->variant); in wcd938x_soc_codec_probe()
4197 free_irq(wcd938x->aux_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
4199 free_irq(wcd938x->hphl_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
4201 free_irq(wcd938x->hphr_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
4203 wcd_clsh_ctrl_free(wcd938x->clsh_info); in wcd938x_soc_codec_probe()
4210 struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); in wcd938x_soc_codec_remove() local
4214 free_irq(wcd938x->aux_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
4215 free_irq(wcd938x->hphl_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
4216 free_irq(wcd938x->hphr_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
4218 wcd_clsh_ctrl_free(wcd938x->clsh_info); in wcd938x_soc_codec_remove()
4278 static int wcd938x_populate_dt_data(struct wcd938x_priv *wcd938x, struct device *dev) in wcd938x_populate_dt_data() argument
4280 struct wcd_mbhc_config *cfg = &wcd938x->mbhc_cfg; in wcd938x_populate_dt_data()
4283 wcd938x->reset_gpio = of_get_named_gpio(dev->of_node, "reset-gpios", 0); in wcd938x_populate_dt_data()
4284 if (wcd938x->reset_gpio < 0) { in wcd938x_populate_dt_data()
4286 wcd938x->reset_gpio); in wcd938x_populate_dt_data()
4287 return wcd938x->reset_gpio; in wcd938x_populate_dt_data()
4290 wcd938x->supplies[0].supply = "vdd-rxtx"; in wcd938x_populate_dt_data()
4291 wcd938x->supplies[1].supply = "vdd-io"; in wcd938x_populate_dt_data()
4292 wcd938x->supplies[2].supply = "vdd-buck"; in wcd938x_populate_dt_data()
4293 wcd938x->supplies[3].supply = "vdd-mic-bias"; in wcd938x_populate_dt_data()
4295 ret = regulator_bulk_get(dev, WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
4301 ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
4307 wcd938x_dt_parse_micbias_info(dev, wcd938x); in wcd938x_populate_dt_data()
4313 cfg->micb_mv = wcd938x->micb2_mv; in wcd938x_populate_dt_data()
4323 static int wcd938x_reset(struct wcd938x_priv *wcd938x) in wcd938x_reset() argument
4325 gpio_direction_output(wcd938x->reset_gpio, 0); in wcd938x_reset()
4328 gpio_set_value(wcd938x->reset_gpio, 1); in wcd938x_reset()
4339 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_hw_params() local
4340 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_hw_params()
4348 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_free() local
4349 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_free()
4357 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_set_sdw_stream() local
4358 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_set_sdw_stream()
4401 struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); in wcd938x_bind() local
4404 ret = component_bind_all(dev, wcd938x); in wcd938x_bind()
4411 wcd938x->rxdev = wcd938x_sdw_device_get(wcd938x->rxnode); in wcd938x_bind()
4412 if (!wcd938x->rxdev) { in wcd938x_bind()
4417 wcd938x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd938x->rxdev); in wcd938x_bind()
4418 wcd938x->sdw_priv[AIF1_PB]->wcd938x = wcd938x; in wcd938x_bind()
4420 wcd938x->txdev = wcd938x_sdw_device_get(wcd938x->txnode); in wcd938x_bind()
4421 if (!wcd938x->txdev) { in wcd938x_bind()
4426 wcd938x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd938x->txdev); in wcd938x_bind()
4427 wcd938x->sdw_priv[AIF1_CAP]->wcd938x = wcd938x; in wcd938x_bind()
4428 wcd938x->tx_sdw_dev = dev_to_sdw_dev(wcd938x->txdev); in wcd938x_bind()
4432 if (!device_link_add(wcd938x->rxdev, wcd938x->txdev, DL_FLAG_STATELESS | in wcd938x_bind()
4439 if (!device_link_add(dev, wcd938x->txdev, DL_FLAG_STATELESS | in wcd938x_bind()
4446 if (!device_link_add(dev, wcd938x->rxdev, DL_FLAG_STATELESS | in wcd938x_bind()
4453 wcd938x->regmap = devm_regmap_init_sdw(wcd938x->tx_sdw_dev, &wcd938x_regmap_config); in wcd938x_bind()
4454 if (IS_ERR(wcd938x->regmap)) { in wcd938x_bind()
4456 ret = PTR_ERR(wcd938x->regmap); in wcd938x_bind()
4460 ret = wcd938x_irq_init(wcd938x, dev); in wcd938x_bind()
4466 wcd938x->sdw_priv[AIF1_PB]->slave_irq = wcd938x->virq; in wcd938x_bind()
4467 wcd938x->sdw_priv[AIF1_CAP]->slave_irq = wcd938x->virq; in wcd938x_bind()
4469 ret = wcd938x_set_micbias_data(wcd938x); in wcd938x_bind()
4486 device_link_remove(dev, wcd938x->rxdev); in wcd938x_bind()
4488 device_link_remove(dev, wcd938x->txdev); in wcd938x_bind()
4490 device_link_remove(wcd938x->rxdev, wcd938x->txdev); in wcd938x_bind()
4492 put_device(wcd938x->txdev); in wcd938x_bind()
4494 put_device(wcd938x->rxdev); in wcd938x_bind()
4496 component_unbind_all(dev, wcd938x); in wcd938x_bind()
4503 struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); in wcd938x_unbind() local
4506 device_link_remove(dev, wcd938x->txdev); in wcd938x_unbind()
4507 device_link_remove(dev, wcd938x->rxdev); in wcd938x_unbind()
4508 device_link_remove(wcd938x->rxdev, wcd938x->txdev); in wcd938x_unbind()
4509 put_device(wcd938x->txdev); in wcd938x_unbind()
4510 put_device(wcd938x->rxdev); in wcd938x_unbind()
4511 component_unbind_all(dev, wcd938x); in wcd938x_unbind()
4529 static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x, in wcd938x_add_slave_components() argument
4537 wcd938x->rxnode = of_parse_phandle(np, "qcom,rx-device", 0); in wcd938x_add_slave_components()
4538 if (!wcd938x->rxnode) { in wcd938x_add_slave_components()
4543 of_node_get(wcd938x->rxnode); in wcd938x_add_slave_components()
4545 wcd938x_compare_of, wcd938x->rxnode); in wcd938x_add_slave_components()
4547 wcd938x->txnode = of_parse_phandle(np, "qcom,tx-device", 0); in wcd938x_add_slave_components()
4548 if (!wcd938x->txnode) { in wcd938x_add_slave_components()
4552 of_node_get(wcd938x->txnode); in wcd938x_add_slave_components()
4554 wcd938x_compare_of, wcd938x->txnode); in wcd938x_add_slave_components()
4561 struct wcd938x_priv *wcd938x = NULL; in wcd938x_probe() local
4565 wcd938x = devm_kzalloc(dev, sizeof(struct wcd938x_priv), in wcd938x_probe()
4567 if (!wcd938x) in wcd938x_probe()
4570 dev_set_drvdata(dev, wcd938x); in wcd938x_probe()
4571 mutex_init(&wcd938x->micb_lock); in wcd938x_probe()
4573 ret = wcd938x_populate_dt_data(wcd938x, dev); in wcd938x_probe()
4579 ret = wcd938x_add_slave_components(wcd938x, dev, &match); in wcd938x_probe()
4583 wcd938x_reset(wcd938x); in wcd938x_probe()