Lines Matching +full:wcd +full:- +full:capture
1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
21 #include <sound/soc-dapm.h>
24 #include "wcd-clsh-v2.h"
25 #include "wcd-mbhc-v2.h"
193 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, -1800);
194 static const DECLARE_TLV_DB_SCALE(line_gain, -3000, 150, 0);
350 struct regmap *rm = wcd938x->regmap; in wcd938x_io_init()
409 port_num = ch_info->port_num; in wcd938x_sdw_connect_port()
410 ch_mask = ch_info->ch_mask; in wcd938x_sdw_connect_port()
412 port_config->num = port_num; in wcd938x_sdw_connect_port()
415 port_config->ch_mask |= ch_mask; in wcd938x_sdw_connect_port()
417 port_config->ch_mask &= ~ch_mask; in wcd938x_sdw_connect_port()
422 static int wcd938x_connect_port(struct wcd938x_sdw_priv *wcd, u8 port_num, u8 ch_id, u8 enable) in wcd938x_connect_port() argument
424 return wcd938x_sdw_connect_port(&wcd->ch_info[ch_id], in wcd938x_connect_port()
425 &wcd->port_config[port_num - 1], in wcd938x_connect_port()
433 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_rxclk()
472 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_hphl_dac_event()
491 if (wcd938x->comp1_enable) { in wcd938x_codec_hphl_dac_event()
496 if (!wcd938x->comp2_enable || (snd_soc_component_read(component, in wcd938x_codec_hphl_dac_event()
526 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_hphr_dac_event()
545 if (wcd938x->comp2_enable) { in wcd938x_codec_hphr_dac_event()
550 if (!wcd938x->comp1_enable || in wcd938x_codec_hphr_dac_event()
580 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_ear_dac_event()
585 wcd938x->ear_rx_path = in wcd938x_codec_ear_dac_event()
588 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { in wcd938x_codec_ear_dac_event()
608 if (wcd938x->comp1_enable) in wcd938x_codec_ear_dac_event()
615 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_ear_dac_event()
618 wcd938x->flyback_cur_det_disable++; in wcd938x_codec_ear_dac_event()
619 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_ear_dac_event()
622 wcd938x->hph_mode); in wcd938x_codec_ear_dac_event()
625 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { in wcd938x_codec_ear_dac_event()
639 if (wcd938x->comp1_enable) in wcd938x_codec_ear_dac_event()
659 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_aux_dac_event()
673 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_aux_dac_event()
676 wcd938x->flyback_cur_det_disable++; in wcd938x_codec_aux_dac_event()
677 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_aux_dac_event()
680 wcd938x->hph_mode); in wcd938x_codec_aux_dac_event()
695 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_hphr_pa()
697 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_hphr_pa()
701 if (wcd938x->ldoh) in wcd938x_codec_enable_hphr_pa()
704 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_PRE_DAC, in wcd938x_codec_enable_hphr_pa()
706 wcd_clsh_set_hph_mode(wcd938x->clsh_info, CLS_H_HIFI); in wcd938x_codec_enable_hphr_pa()
716 wcd_clsh_set_hph_mode(wcd938x->clsh_info, hph_mode); in wcd938x_codec_enable_hphr_pa()
719 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
730 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphr_pa()
731 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
741 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
750 enable_irq(wcd938x->hphr_pdm_wd_int); in wcd938x_codec_enable_hphr_pa()
753 disable_irq_nosync(wcd938x->hphr_pdm_wd_int); in wcd938x_codec_enable_hphr_pa()
759 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
765 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphr_pa()
767 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
775 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphr_pa()
776 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
780 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
782 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphr_pa()
788 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_hphr_pa()
790 if (wcd938x->ldoh) in wcd938x_codec_enable_hphr_pa()
802 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_hphl_pa()
804 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_hphl_pa()
808 if (wcd938x->ldoh) in wcd938x_codec_enable_hphl_pa()
811 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_PRE_DAC, in wcd938x_codec_enable_hphl_pa()
813 wcd_clsh_set_hph_mode(wcd938x->clsh_info, CLS_H_HIFI); in wcd938x_codec_enable_hphl_pa()
822 wcd_clsh_set_hph_mode(wcd938x->clsh_info, hph_mode); in wcd938x_codec_enable_hphl_pa()
825 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
836 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphl_pa()
837 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
846 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
856 enable_irq(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_hphl_pa()
859 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_hphl_pa()
865 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
871 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, WCD_EVENT_PRE_HPHL_PA_OFF); in wcd938x_codec_enable_hphl_pa()
872 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
880 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphl_pa()
881 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
885 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
887 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphl_pa()
893 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_hphl_pa()
895 if (wcd938x->ldoh) in wcd938x_codec_enable_hphl_pa()
907 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_aux_pa()
909 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_aux_pa()
924 enable_irq(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_aux_pa()
927 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_aux_pa()
934 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_enable_aux_pa()
939 wcd938x->flyback_cur_det_disable--; in wcd938x_codec_enable_aux_pa()
940 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_enable_aux_pa()
951 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_ear_pa()
953 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_ear_pa()
961 wcd938x->ear_rx_path = snd_soc_component_read(component, in wcd938x_codec_enable_ear_pa()
963 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
970 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_ear_pa()
984 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
985 enable_irq(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
987 enable_irq(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
990 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
991 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
993 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
996 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_ear_pa()
1001 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
1008 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_ear_pa()
1011 wcd938x->flyback_cur_det_disable--; in wcd938x_codec_enable_ear_pa()
1012 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_enable_ear_pa()
1025 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_dmic()
1029 switch (w->shift) { in wcd938x_codec_enable_dmic()
1059 dev_err(component->dev, "%s: Invalid DMIC Selection\n", in wcd938x_codec_enable_dmic()
1061 return -EINVAL; in wcd938x_codec_enable_dmic()
1096 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_tx_swr_ctrl()
1101 bank = (wcd938x_swr_get_current_bank(wcd938x->sdw_priv[AIF1_CAP]->sdev)) ? 0 : 1; in wcd938x_tx_swr_ctrl()
1106 if (strnstr(w->name, "ADC", sizeof("ADC"))) { in wcd938x_tx_swr_ctrl()
1109 if (test_bit(WCD_ADC1, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1110 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC1]]; in wcd938x_tx_swr_ctrl()
1111 if (test_bit(WCD_ADC2, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1112 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC2]]; in wcd938x_tx_swr_ctrl()
1113 if (test_bit(WCD_ADC3, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1114 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC3]]; in wcd938x_tx_swr_ctrl()
1115 if (test_bit(WCD_ADC4, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1116 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC4]]; in wcd938x_tx_swr_ctrl()
1133 if (strnstr(w->name, "ADC", sizeof("ADC"))) { in wcd938x_tx_swr_ctrl()
1171 ret = -EINVAL; in wcd938x_get_adc_mode()
1180 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_adc()
1191 set_bit(w->shift, &wcd938x->status_mask); in wcd938x_codec_enable_adc()
1196 clear_bit(w->shift, &wcd938x->status_mask); in wcd938x_codec_enable_adc()
1235 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_adc_enable_req()
1247 wcd938x_tx_channel_config(component, w->shift, 1); in wcd938x_adc_enable_req()
1248 mode = wcd938x_get_adc_mode(wcd938x->tx_mode[w->shift]); in wcd938x_adc_enable_req()
1250 dev_info(component->dev, "Invalid ADC mode\n"); in wcd938x_adc_enable_req()
1251 return -EINVAL; in wcd938x_adc_enable_req()
1253 switch (w->shift) { in wcd938x_adc_enable_req()
1290 wcd938x_tx_channel_config(component, w->shift, 0); in wcd938x_adc_enable_req()
1293 switch (w->shift) { in wcd938x_adc_enable_req()
1342 int micb_index = micb_num - 1; in wcd938x_micbias_control()
1359 dev_err(component->dev, "%s: Invalid micbias number: %d\n", in wcd938x_micbias_control()
1361 return -EINVAL; in wcd938x_micbias_control()
1366 wcd938x->pullup_ref[micb_index]++; in wcd938x_micbias_control()
1367 if ((wcd938x->pullup_ref[micb_index] == 1) && in wcd938x_micbias_control()
1368 (wcd938x->micb_ref[micb_index] == 0)) in wcd938x_micbias_control()
1374 if (wcd938x->pullup_ref[micb_index] > 0) in wcd938x_micbias_control()
1375 wcd938x->pullup_ref[micb_index]--; in wcd938x_micbias_control()
1377 if ((wcd938x->pullup_ref[micb_index] == 0) && in wcd938x_micbias_control()
1378 (wcd938x->micb_ref[micb_index] == 0)) in wcd938x_micbias_control()
1383 wcd938x->micb_ref[micb_index]++; in wcd938x_micbias_control()
1384 if (wcd938x->micb_ref[micb_index] == 1) { in wcd938x_micbias_control()
1399 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1403 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1409 if (wcd938x->micb_ref[micb_index] > 0) in wcd938x_micbias_control()
1410 wcd938x->micb_ref[micb_index]--; in wcd938x_micbias_control()
1412 if ((wcd938x->micb_ref[micb_index] == 0) && in wcd938x_micbias_control()
1413 (wcd938x->pullup_ref[micb_index] > 0)) in wcd938x_micbias_control()
1417 else if ((wcd938x->micb_ref[micb_index] == 0) && in wcd938x_micbias_control()
1418 (wcd938x->pullup_ref[micb_index] == 0)) { in wcd938x_micbias_control()
1420 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1426 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1430 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1442 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_micbias()
1443 int micb_num = w->shift; in wcd938x_codec_enable_micbias()
1465 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_micbias_pullup()
1466 int micb_num = w->shift; in wcd938x_codec_enable_micbias_pullup()
1491 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in wcd938x_tx_mode_get()
1492 int path = e->shift_l; in wcd938x_tx_mode_get()
1494 ucontrol->value.enumerated.item[0] = wcd938x->tx_mode[path]; in wcd938x_tx_mode_get()
1504 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in wcd938x_tx_mode_put()
1505 int path = e->shift_l; in wcd938x_tx_mode_put()
1507 if (wcd938x->tx_mode[path] == ucontrol->value.enumerated.item[0]) in wcd938x_tx_mode_put()
1510 wcd938x->tx_mode[path] = ucontrol->value.enumerated.item[0]; in wcd938x_tx_mode_put()
1521 ucontrol->value.enumerated.item[0] = wcd938x->hph_mode; in wcd938x_rx_hph_mode_get()
1532 if (wcd938x->hph_mode == ucontrol->value.enumerated.item[0]) in wcd938x_rx_hph_mode_put()
1535 wcd938x->hph_mode = ucontrol->value.enumerated.item[0]; in wcd938x_rx_hph_mode_put()
1546 if (wcd938x->comp1_enable) { in wcd938x_ear_pa_put_gain()
1547 dev_err(component->dev, "Can not set EAR PA Gain, compander1 is enabled\n"); in wcd938x_ear_pa_put_gain()
1548 return -EINVAL; in wcd938x_ear_pa_put_gain()
1553 ucontrol->value.integer.value[0]); in wcd938x_ear_pa_put_gain()
1567 mc = (struct soc_mixer_control *)(kcontrol->private_value); in wcd938x_get_compander()
1568 hphr = mc->shift; in wcd938x_get_compander()
1571 ucontrol->value.integer.value[0] = wcd938x->comp2_enable; in wcd938x_get_compander()
1573 ucontrol->value.integer.value[0] = wcd938x->comp1_enable; in wcd938x_get_compander()
1583 struct wcd938x_sdw_priv *wcd; in wcd938x_set_compander() local
1584 int value = ucontrol->value.integer.value[0]; in wcd938x_set_compander()
1589 mc = (struct soc_mixer_control *)(kcontrol->private_value); in wcd938x_set_compander()
1590 hphr = mc->shift; in wcd938x_set_compander()
1592 wcd = wcd938x->sdw_priv[AIF1_PB]; in wcd938x_set_compander()
1595 wcd938x->comp2_enable = value; in wcd938x_set_compander()
1597 wcd938x->comp1_enable = value; in wcd938x_set_compander()
1599 portidx = wcd->ch_info[mc->reg].port_num; in wcd938x_set_compander()
1602 wcd938x_connect_port(wcd, portidx, mc->reg, true); in wcd938x_set_compander()
1604 wcd938x_connect_port(wcd, portidx, mc->reg, false); in wcd938x_set_compander()
1615 ucontrol->value.integer.value[0] = wcd938x->ldoh; in wcd938x_ldoh_get()
1626 if (wcd938x->ldoh == ucontrol->value.integer.value[0]) in wcd938x_ldoh_put()
1629 wcd938x->ldoh = ucontrol->value.integer.value[0]; in wcd938x_ldoh_put()
1855 struct wcd938x_sdw_priv *wcd; in wcd938x_get_swr_port() local
1856 struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value; in wcd938x_get_swr_port()
1857 int dai_id = mixer->shift; in wcd938x_get_swr_port()
1858 int portidx, ch_idx = mixer->reg; in wcd938x_get_swr_port()
1861 wcd = wcd938x->sdw_priv[dai_id]; in wcd938x_get_swr_port()
1862 portidx = wcd->ch_info[ch_idx].port_num; in wcd938x_get_swr_port()
1864 ucontrol->value.integer.value[0] = wcd->port_enable[portidx]; in wcd938x_get_swr_port()
1874 struct wcd938x_sdw_priv *wcd; in wcd938x_set_swr_port() local
1876 (struct soc_mixer_control *)kcontrol->private_value; in wcd938x_set_swr_port()
1877 int ch_idx = mixer->reg; in wcd938x_set_swr_port()
1879 int dai_id = mixer->shift; in wcd938x_set_swr_port()
1882 wcd = wcd938x->sdw_priv[dai_id]; in wcd938x_set_swr_port()
1884 portidx = wcd->ch_info[ch_idx].port_num; in wcd938x_set_swr_port()
1885 if (ucontrol->value.integer.value[0]) in wcd938x_set_swr_port()
1890 wcd->port_enable[portidx] = enable; in wcd938x_set_swr_port()
1892 wcd938x_connect_port(wcd, portidx, ch_idx, enable); in wcd938x_set_swr_port()
1920 dev_err(component->dev, "%s: invalid number of buttons: %d\n", in wcd938x_mbhc_program_btn_thr()
1929 dev_dbg(component->dev, "%s: btn_high[%d]: %d, vth: %d\n", in wcd938x_mbhc_program_btn_thr()
1986 return -EINVAL; in wcd938x_get_micb_vout_ctl_val()
1988 return (micb_mv - 1000) / 50; in wcd938x_get_micb_vout_ctl_val()
2011 return -EINVAL; in wcd938x_mbhc_micb_adjust_voltage()
2013 mutex_lock(&wcd938x->micb_lock); in wcd938x_mbhc_micb_adjust_voltage()
2018 * to avoid slow micbias ramp-up or down enable pull-up in wcd938x_mbhc_micb_adjust_voltage()
2019 * momentarily, change the micbias value and then re-enable in wcd938x_mbhc_micb_adjust_voltage()
2029 ret = -EINVAL; in wcd938x_mbhc_micb_adjust_voltage()
2058 mutex_unlock(&wcd938x->micb_lock); in wcd938x_mbhc_micb_adjust_voltage()
2069 return -EINVAL; in wcd938x_mbhc_micb_ctrl_threshold_mic()
2075 if (wcd938x->micb2_mv >= WCD_MBHC_THR_HS_MICB_MV) in wcd938x_mbhc_micb_ctrl_threshold_mic()
2078 micb_mv = req_en ? WCD_MBHC_THR_HS_MICB_MV : wcd938x->micb2_mv; in wcd938x_mbhc_micb_ctrl_threshold_mic()
2097 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ZDET, 0x20, 0x20); in wcd938x_mbhc_get_result_params()
2099 regmap_read(wcd938x->regmap, WCD938X_ANA_MBHC_RESULT_2, &val); in wcd938x_mbhc_get_result_params()
2104 regmap_read(wcd938x->regmap, WCD938X_ANA_MBHC_RESULT_1, &val1); in wcd938x_mbhc_get_result_params()
2106 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ZDET, 0x20, 0x00); in wcd938x_mbhc_get_result_params()
2114 dev_err(component->dev, "Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd938x_mbhc_get_result_params()
2119 denom = (x1 * d1) - (1 << (14 - noff)); in wcd938x_mbhc_get_result_params()
2125 dev_dbg(component->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d (milliohm)\n", in wcd938x_mbhc_get_result_params()
2130 regmap_read(wcd938x->regmap, in wcd938x_mbhc_get_result_params()
2132 regmap_read(wcd938x->regmap, in wcd938x_mbhc_get_result_params()
2151 WCD938X_ZDET_MAXV_CTL_MASK, zdet_param->ldo_ctl); in wcd938x_mbhc_zdet_ramp()
2153 WCD938X_VTH_MASK, zdet_param->btn5); in wcd938x_mbhc_zdet_ramp()
2155 WCD938X_VTH_MASK, zdet_param->btn6); in wcd938x_mbhc_zdet_ramp()
2157 WCD938X_VTH_MASK, zdet_param->btn7); in wcd938x_mbhc_zdet_ramp()
2159 WCD938X_ZDET_RANGE_CTL_MASK, zdet_param->noff); in wcd938x_mbhc_zdet_ramp()
2161 0x0F, zdet_param->nshift); in wcd938x_mbhc_zdet_ramp()
2166 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2168 dev_dbg(component->dev, "%s: ramp for HPH_L, noff = %d\n", in wcd938x_mbhc_zdet_ramp()
2169 __func__, zdet_param->noff); in wcd938x_mbhc_zdet_ramp()
2170 wcd938x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd938x_mbhc_zdet_ramp()
2171 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2180 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2182 dev_dbg(component->dev, "%s: ramp for HPH_R, noff = %d\n", in wcd938x_mbhc_zdet_ramp()
2183 __func__, zdet_param->noff); in wcd938x_mbhc_zdet_ramp()
2184 wcd938x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd938x_mbhc_zdet_ramp()
2185 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2204 q1_cal = (10000 - ((q1 & 0x7F) * 25)); in wcd938x_wcd_mbhc_qfuse_cal()
2242 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2246 /* For NO-jack, disable L_DET_EN before Z-det measurements */ in wcd938x_wcd_mbhc_calc_impedance()
2247 if (wcd938x->mbhc_cfg.hphl_swh) in wcd938x_wcd_mbhc_calc_impedance()
2248 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2252 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2258 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2295 dev_dbg(component->dev, "%s: impedance on HPH_L = %d(ohms)\n", in wcd938x_wcd_mbhc_calc_impedance()
2302 (zdet_param_ptr->noff == 0x6)) || in wcd938x_wcd_mbhc_calc_impedance()
2327 dev_dbg(component->dev, "%s: impedance on HPH_R = %d(ohms)\n", in wcd938x_wcd_mbhc_calc_impedance()
2333 dev_dbg(component->dev, in wcd938x_wcd_mbhc_calc_impedance()
2342 dev_dbg(component->dev, in wcd938x_wcd_mbhc_calc_impedance()
2345 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_MONO); in wcd938x_wcd_mbhc_calc_impedance()
2364 z_diff1 = (z1Ls > zMono) ? (z1Ls - zMono) : (zMono - z1Ls); in wcd938x_wcd_mbhc_calc_impedance()
2365 z_diff2 = ((*zl) > z1Ls) ? ((*zl) - z1Ls) : (z1Ls - (*zl)); in wcd938x_wcd_mbhc_calc_impedance()
2367 dev_dbg(component->dev, "%s: stereo plug type detected\n", in wcd938x_wcd_mbhc_calc_impedance()
2369 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_STEREO); in wcd938x_wcd_mbhc_calc_impedance()
2371 dev_dbg(component->dev, "%s: MONO plug type detected\n", in wcd938x_wcd_mbhc_calc_impedance()
2373 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_MONO); in wcd938x_wcd_mbhc_calc_impedance()
2377 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2384 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2387 /* For NO-jack, re-enable L_DET_EN after Z-det measurements */ in wcd938x_wcd_mbhc_calc_impedance()
2388 if (wcd938x->mbhc_cfg.hphl_swh) in wcd938x_wcd_mbhc_calc_impedance()
2389 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2395 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2428 if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { in wcd938x_mbhc_moisture_config()
2435 if (!wcd938x->mbhc_cfg.hphl_swh) { in wcd938x_mbhc_moisture_config()
2436 dev_dbg(component->dev, "%s: disable moisture detection for NC\n", in wcd938x_mbhc_moisture_config()
2444 WCD938X_M_RTH_CTL_MASK, wcd938x->mbhc_cfg.moist_rref); in wcd938x_mbhc_moisture_config()
2453 WCD938X_M_RTH_CTL_MASK, wcd938x->mbhc_cfg.moist_rref); in wcd938x_mbhc_moisture_detect_en()
2464 if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { in wcd938x_mbhc_get_moisture_status()
2471 if (!wcd938x->mbhc_cfg.hphl_swh) { in wcd938x_mbhc_get_moisture_status()
2472 dev_dbg(component->dev, "%s: disable moisture detection for NC\n", in wcd938x_mbhc_get_moisture_status()
2528 ucontrol->value.integer.value[0] = wcd_mbhc_get_hph_type(wcd938x->wcd_mbhc); in wcd938x_get_hph_type()
2543 mc = (struct soc_mixer_control *)(kcontrol->private_value); in wcd938x_hph_impedance_get()
2544 hphr = mc->shift; in wcd938x_hph_impedance_get()
2545 wcd_mbhc_get_impedance(wcd938x->wcd_mbhc, &zl, &zr); in wcd938x_hph_impedance_get()
2546 dev_dbg(component->dev, "%s: zl=%u(ohms), zr=%u(ohms)\n", __func__, zl, zr); in wcd938x_hph_impedance_get()
2547 ucontrol->value.integer.value[0] = hphr ? zr : zl; in wcd938x_hph_impedance_get()
2567 struct wcd_mbhc_intr *intr_ids = &wcd938x->intr_ids; in wcd938x_mbhc_init()
2569 intr_ids->mbhc_sw_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2571 intr_ids->mbhc_btn_press_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2573 intr_ids->mbhc_btn_release_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2575 intr_ids->mbhc_hs_ins_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2577 intr_ids->mbhc_hs_rem_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2579 intr_ids->hph_left_ocp = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2581 intr_ids->hph_right_ocp = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2584 wcd938x->wcd_mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd938x_mbhc_init()
2585 if (IS_ERR(wcd938x->wcd_mbhc)) in wcd938x_mbhc_init()
2586 return PTR_ERR(wcd938x->wcd_mbhc); in wcd938x_mbhc_init()
2600 wcd_mbhc_deinit(wcd938x->wcd_mbhc); in wcd938x_mbhc_deinit()
2988 vout_ctl_1 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb1_mv); in wcd938x_set_micbias_data()
2989 vout_ctl_2 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb2_mv); in wcd938x_set_micbias_data()
2990 vout_ctl_3 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb3_mv); in wcd938x_set_micbias_data()
2991 vout_ctl_4 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb4_mv); in wcd938x_set_micbias_data()
2993 return -EINVAL; in wcd938x_set_micbias_data()
2995 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB1, in wcd938x_set_micbias_data()
2997 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB2, in wcd938x_set_micbias_data()
2999 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB3, in wcd938x_set_micbias_data()
3001 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB4, in wcd938x_set_micbias_data()
3030 static int wcd938x_irq_init(struct wcd938x_priv *wcd, struct device *dev) in wcd938x_irq_init() argument
3033 wcd->virq = irq_domain_add_linear(NULL, 1, &wcd_domain_ops, NULL); in wcd938x_irq_init()
3034 if (!(wcd->virq)) { in wcd938x_irq_init()
3036 return -EINVAL; in wcd938x_irq_init()
3039 return devm_regmap_add_irq_chip(dev, wcd->regmap, in wcd938x_irq_init()
3040 irq_create_mapping(wcd->virq, 0), in wcd938x_irq_init()
3042 &wcd->irq_chip); in wcd938x_irq_init()
3048 struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev; in wcd938x_soc_codec_probe()
3049 struct device *dev = component->dev; in wcd938x_soc_codec_probe()
3053 time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete, in wcd938x_soc_codec_probe()
3057 return -ETIMEDOUT; in wcd938x_soc_codec_probe()
3060 snd_soc_component_init_regmap(component, wcd938x->regmap); in wcd938x_soc_codec_probe()
3066 wcd938x->variant = snd_soc_component_read_field(component, in wcd938x_soc_codec_probe()
3070 wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X); in wcd938x_soc_codec_probe()
3071 if (IS_ERR(wcd938x->clsh_info)) { in wcd938x_soc_codec_probe()
3073 return PTR_ERR(wcd938x->clsh_info); in wcd938x_soc_codec_probe()
3079 regmap_write(wcd938x->regmap, in wcd938x_soc_codec_probe()
3085 wcd938x->hphr_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
3087 wcd938x->hphl_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
3089 wcd938x->aux_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
3093 ret = request_threaded_irq(wcd938x->hphr_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
3101 ret = request_threaded_irq(wcd938x->hphl_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
3109 ret = request_threaded_irq(wcd938x->aux_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
3118 disable_irq_nosync(wcd938x->hphr_pdm_wd_int); in wcd938x_soc_codec_probe()
3119 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_soc_codec_probe()
3120 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_soc_codec_probe()
3122 switch (wcd938x->variant) { in wcd938x_soc_codec_probe()
3127 dev_err(component->dev, in wcd938x_soc_codec_probe()
3129 __func__, wcd938x->variant); in wcd938x_soc_codec_probe()
3137 dev_err(component->dev, in wcd938x_soc_codec_probe()
3139 __func__, wcd938x->variant); in wcd938x_soc_codec_probe()
3149 dev_err(component->dev, "mbhc initialization failed\n"); in wcd938x_soc_codec_probe()
3156 free_irq(wcd938x->aux_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
3158 free_irq(wcd938x->hphl_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
3160 free_irq(wcd938x->hphr_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
3162 wcd_clsh_ctrl_free(wcd938x->clsh_info); in wcd938x_soc_codec_probe()
3173 free_irq(wcd938x->aux_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
3174 free_irq(wcd938x->hphl_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
3175 free_irq(wcd938x->hphr_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
3177 wcd_clsh_ctrl_free(wcd938x->clsh_info); in wcd938x_soc_codec_remove()
3183 struct wcd938x_priv *wcd = dev_get_drvdata(comp->dev); in wcd938x_codec_set_jack() local
3186 return wcd_mbhc_start(wcd->wcd_mbhc, &wcd->mbhc_cfg, jack); in wcd938x_codec_set_jack()
3188 wcd_mbhc_stop(wcd->wcd_mbhc); in wcd938x_codec_set_jack()
3207 static void wcd938x_dt_parse_micbias_info(struct device *dev, struct wcd938x_priv *wcd) in wcd938x_dt_parse_micbias_info() argument
3209 struct device_node *np = dev->of_node; in wcd938x_dt_parse_micbias_info()
3213 rc = of_property_read_u32(np, "qcom,micbias1-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3215 wcd->micb1_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3219 rc = of_property_read_u32(np, "qcom,micbias2-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3221 wcd->micb2_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3225 rc = of_property_read_u32(np, "qcom,micbias3-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3227 wcd->micb3_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3231 rc = of_property_read_u32(np, "qcom,micbias4-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3233 wcd->micb4_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3246 value = gpiod_get_value(wcd938x->us_euro_gpio); in wcd938x_swap_gnd_mic()
3248 gpiod_set_value(wcd938x->us_euro_gpio, !value); in wcd938x_swap_gnd_mic()
3256 struct wcd_mbhc_config *cfg = &wcd938x->mbhc_cfg; in wcd938x_populate_dt_data()
3259 wcd938x->reset_gpio = of_get_named_gpio(dev->of_node, "reset-gpios", 0); in wcd938x_populate_dt_data()
3260 if (wcd938x->reset_gpio < 0) in wcd938x_populate_dt_data()
3261 return dev_err_probe(dev, wcd938x->reset_gpio, in wcd938x_populate_dt_data()
3264 wcd938x->us_euro_gpio = devm_gpiod_get_optional(dev, "us-euro", in wcd938x_populate_dt_data()
3266 if (IS_ERR(wcd938x->us_euro_gpio)) in wcd938x_populate_dt_data()
3267 return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_gpio), in wcd938x_populate_dt_data()
3268 "us-euro swap Control GPIO not found\n"); in wcd938x_populate_dt_data()
3270 cfg->swap_gnd_mic = wcd938x_swap_gnd_mic; in wcd938x_populate_dt_data()
3272 wcd938x->supplies[0].supply = "vdd-rxtx"; in wcd938x_populate_dt_data()
3273 wcd938x->supplies[1].supply = "vdd-io"; in wcd938x_populate_dt_data()
3274 wcd938x->supplies[2].supply = "vdd-buck"; in wcd938x_populate_dt_data()
3275 wcd938x->supplies[3].supply = "vdd-mic-bias"; in wcd938x_populate_dt_data()
3277 ret = regulator_bulk_get(dev, WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
3281 ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
3283 regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
3289 cfg->mbhc_micbias = MIC_BIAS_2; in wcd938x_populate_dt_data()
3290 cfg->anc_micbias = MIC_BIAS_2; in wcd938x_populate_dt_data()
3291 cfg->v_hs_max = WCD_MBHC_HS_V_MAX; in wcd938x_populate_dt_data()
3292 cfg->num_btn = WCD938X_MBHC_MAX_BUTTONS; in wcd938x_populate_dt_data()
3293 cfg->micb_mv = wcd938x->micb2_mv; in wcd938x_populate_dt_data()
3294 cfg->linein_th = 5000; in wcd938x_populate_dt_data()
3295 cfg->hs_thr = 1700; in wcd938x_populate_dt_data()
3296 cfg->hph_thr = 50; in wcd938x_populate_dt_data()
3305 gpio_direction_output(wcd938x->reset_gpio, 0); in wcd938x_reset()
3308 gpio_set_value(wcd938x->reset_gpio, 1); in wcd938x_reset()
3319 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_hw_params()
3320 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_hw_params() local
3322 return wcd938x_sdw_hw_params(wcd, substream, params, dai); in wcd938x_codec_hw_params()
3328 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_free()
3329 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_free() local
3331 return wcd938x_sdw_free(wcd, substream, dai); in wcd938x_codec_free()
3337 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_set_sdw_stream()
3338 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_set_sdw_stream() local
3340 return wcd938x_sdw_set_sdw_stream(wcd, dai, stream, direction); in wcd938x_codec_set_sdw_stream()
3352 .name = "wcd938x-sdw-rx",
3354 .stream_name = "WCD AIF1 Playback",
3365 .name = "wcd938x-sdw-tx",
3366 .capture = {
3367 .stream_name = "WCD AIF1 Capture",
3391 wcd938x->rxdev = wcd938x_sdw_device_get(wcd938x->rxnode); in wcd938x_bind()
3392 if (!wcd938x->rxdev) { in wcd938x_bind()
3394 ret = -EINVAL; in wcd938x_bind()
3397 wcd938x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd938x->rxdev); in wcd938x_bind()
3398 wcd938x->sdw_priv[AIF1_PB]->wcd938x = wcd938x; in wcd938x_bind()
3400 wcd938x->txdev = wcd938x_sdw_device_get(wcd938x->txnode); in wcd938x_bind()
3401 if (!wcd938x->txdev) { in wcd938x_bind()
3403 ret = -EINVAL; in wcd938x_bind()
3406 wcd938x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd938x->txdev); in wcd938x_bind()
3407 wcd938x->sdw_priv[AIF1_CAP]->wcd938x = wcd938x; in wcd938x_bind()
3408 wcd938x->tx_sdw_dev = dev_to_sdw_dev(wcd938x->txdev); in wcd938x_bind()
3412 if (!device_link_add(wcd938x->rxdev, wcd938x->txdev, DL_FLAG_STATELESS | in wcd938x_bind()
3415 ret = -EINVAL; in wcd938x_bind()
3419 if (!device_link_add(dev, wcd938x->txdev, DL_FLAG_STATELESS | in wcd938x_bind()
3421 dev_err(dev, "could not devlink wcd and tx\n"); in wcd938x_bind()
3422 ret = -EINVAL; in wcd938x_bind()
3426 if (!device_link_add(dev, wcd938x->rxdev, DL_FLAG_STATELESS | in wcd938x_bind()
3428 dev_err(dev, "could not devlink wcd and rx\n"); in wcd938x_bind()
3429 ret = -EINVAL; in wcd938x_bind()
3433 wcd938x->regmap = dev_get_regmap(&wcd938x->tx_sdw_dev->dev, NULL); in wcd938x_bind()
3434 if (!wcd938x->regmap) { in wcd938x_bind()
3436 ret = -EINVAL; in wcd938x_bind()
3446 wcd938x->sdw_priv[AIF1_PB]->slave_irq = wcd938x->virq; in wcd938x_bind()
3447 wcd938x->sdw_priv[AIF1_CAP]->slave_irq = wcd938x->virq; in wcd938x_bind()
3466 device_link_remove(dev, wcd938x->rxdev); in wcd938x_bind()
3468 device_link_remove(dev, wcd938x->txdev); in wcd938x_bind()
3470 device_link_remove(wcd938x->rxdev, wcd938x->txdev); in wcd938x_bind()
3472 put_device(wcd938x->txdev); in wcd938x_bind()
3474 put_device(wcd938x->rxdev); in wcd938x_bind()
3486 device_link_remove(dev, wcd938x->txdev); in wcd938x_unbind()
3487 device_link_remove(dev, wcd938x->rxdev); in wcd938x_unbind()
3488 device_link_remove(wcd938x->rxdev, wcd938x->txdev); in wcd938x_unbind()
3489 put_device(wcd938x->txdev); in wcd938x_unbind()
3490 put_device(wcd938x->rxdev); in wcd938x_unbind()
3505 np = dev->of_node; in wcd938x_add_slave_components()
3507 wcd938x->rxnode = of_parse_phandle(np, "qcom,rx-device", 0); in wcd938x_add_slave_components()
3508 if (!wcd938x->rxnode) { in wcd938x_add_slave_components()
3509 dev_err(dev, "%s: Rx-device node not defined\n", __func__); in wcd938x_add_slave_components()
3510 return -ENODEV; in wcd938x_add_slave_components()
3513 of_node_get(wcd938x->rxnode); in wcd938x_add_slave_components()
3515 component_compare_of, wcd938x->rxnode); in wcd938x_add_slave_components()
3517 wcd938x->txnode = of_parse_phandle(np, "qcom,tx-device", 0); in wcd938x_add_slave_components()
3518 if (!wcd938x->txnode) { in wcd938x_add_slave_components()
3519 dev_err(dev, "%s: Tx-device node not defined\n", __func__); in wcd938x_add_slave_components()
3520 return -ENODEV; in wcd938x_add_slave_components()
3522 of_node_get(wcd938x->txnode); in wcd938x_add_slave_components()
3524 component_compare_of, wcd938x->txnode); in wcd938x_add_slave_components()
3532 struct device *dev = &pdev->dev; in wcd938x_probe()
3538 return -ENOMEM; in wcd938x_probe()
3541 mutex_init(&wcd938x->micb_lock); in wcd938x_probe()
3567 regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_probe()
3568 regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_probe()
3575 struct device *dev = &pdev->dev; in wcd938x_remove()
3584 regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_remove()
3585 regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_remove()
3590 { .compatible = "qcom,wcd9380-codec" },
3591 { .compatible = "qcom,wcd9385-codec" },