Lines Matching +full:us +full:- +full:euro +full:- +full:gpios
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"
212 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, -1800);
213 static const DECLARE_TLV_DB_SCALE(line_gain, -3000, 150, 0);
369 struct regmap *rm = wcd938x->regmap; in wcd938x_io_init()
428 port_num = ch_info->port_num; in wcd938x_sdw_connect_port()
429 ch_mask = ch_info->ch_mask; in wcd938x_sdw_connect_port()
431 port_config->num = port_num; in wcd938x_sdw_connect_port()
434 port_config->ch_mask |= ch_mask; in wcd938x_sdw_connect_port()
436 port_config->ch_mask &= ~ch_mask; in wcd938x_sdw_connect_port()
443 return wcd938x_sdw_connect_port(&wcd->ch_info[ch_id], in wcd938x_connect_port()
444 &wcd->port_config[port_num - 1], in wcd938x_connect_port()
452 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_rxclk()
491 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_hphl_dac_event()
510 if (wcd938x->comp1_enable) { in wcd938x_codec_hphl_dac_event()
515 if (!wcd938x->comp2_enable || (snd_soc_component_read(component, in wcd938x_codec_hphl_dac_event()
545 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_hphr_dac_event()
564 if (wcd938x->comp2_enable) { in wcd938x_codec_hphr_dac_event()
569 if (!wcd938x->comp1_enable || in wcd938x_codec_hphr_dac_event()
599 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_ear_dac_event()
604 wcd938x->ear_rx_path = in wcd938x_codec_ear_dac_event()
607 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { in wcd938x_codec_ear_dac_event()
627 if (wcd938x->comp1_enable) in wcd938x_codec_ear_dac_event()
634 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_ear_dac_event()
637 wcd938x->flyback_cur_det_disable++; in wcd938x_codec_ear_dac_event()
638 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_ear_dac_event()
641 wcd938x->hph_mode); in wcd938x_codec_ear_dac_event()
644 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) { in wcd938x_codec_ear_dac_event()
658 if (wcd938x->comp1_enable) in wcd938x_codec_ear_dac_event()
678 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_aux_dac_event()
692 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_aux_dac_event()
695 wcd938x->flyback_cur_det_disable++; in wcd938x_codec_aux_dac_event()
696 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_aux_dac_event()
699 wcd938x->hph_mode); in wcd938x_codec_aux_dac_event()
714 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_hphr_pa()
716 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_hphr_pa()
720 if (wcd938x->ldoh) in wcd938x_codec_enable_hphr_pa()
723 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_PRE_DAC, in wcd938x_codec_enable_hphr_pa()
725 wcd_clsh_set_hph_mode(wcd938x->clsh_info, CLS_H_HIFI); in wcd938x_codec_enable_hphr_pa()
735 wcd_clsh_set_hph_mode(wcd938x->clsh_info, hph_mode); in wcd938x_codec_enable_hphr_pa()
738 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
749 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphr_pa()
750 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
760 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
769 enable_irq(wcd938x->hphr_pdm_wd_int); in wcd938x_codec_enable_hphr_pa()
772 disable_irq_nosync(wcd938x->hphr_pdm_wd_int); in wcd938x_codec_enable_hphr_pa()
778 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
784 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphr_pa()
786 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
794 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphr_pa()
795 if (!wcd938x->comp2_enable) in wcd938x_codec_enable_hphr_pa()
799 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphr_pa()
801 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphr_pa()
807 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_hphr_pa()
809 if (wcd938x->ldoh) in wcd938x_codec_enable_hphr_pa()
821 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_hphl_pa()
823 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_hphl_pa()
827 if (wcd938x->ldoh) in wcd938x_codec_enable_hphl_pa()
830 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_PRE_DAC, in wcd938x_codec_enable_hphl_pa()
832 wcd_clsh_set_hph_mode(wcd938x->clsh_info, CLS_H_HIFI); in wcd938x_codec_enable_hphl_pa()
841 wcd_clsh_set_hph_mode(wcd938x->clsh_info, hph_mode); in wcd938x_codec_enable_hphl_pa()
844 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
855 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphl_pa()
856 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
865 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
875 enable_irq(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_hphl_pa()
878 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_hphl_pa()
884 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
890 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, WCD_EVENT_PRE_HPHL_PA_OFF); in wcd938x_codec_enable_hphl_pa()
891 set_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
899 if (test_bit(HPH_PA_DELAY, &wcd938x->status_mask)) { in wcd938x_codec_enable_hphl_pa()
900 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_hphl_pa()
904 clear_bit(HPH_PA_DELAY, &wcd938x->status_mask); in wcd938x_codec_enable_hphl_pa()
906 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_codec_enable_hphl_pa()
912 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_hphl_pa()
914 if (wcd938x->ldoh) in wcd938x_codec_enable_hphl_pa()
926 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_aux_pa()
928 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_aux_pa()
943 enable_irq(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_aux_pa()
946 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_aux_pa()
953 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, in wcd938x_codec_enable_aux_pa()
958 wcd938x->flyback_cur_det_disable--; in wcd938x_codec_enable_aux_pa()
959 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_enable_aux_pa()
970 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_ear_pa()
972 int hph_mode = wcd938x->hph_mode; in wcd938x_codec_enable_ear_pa()
980 wcd938x->ear_rx_path = snd_soc_component_read(component, in wcd938x_codec_enable_ear_pa()
982 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
989 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_ear_pa()
1003 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
1004 enable_irq(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
1006 enable_irq(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
1009 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
1010 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
1012 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_codec_enable_ear_pa()
1015 if (!wcd938x->comp1_enable) in wcd938x_codec_enable_ear_pa()
1020 if (wcd938x->ear_rx_path & EAR_RX_PATH_AUX) in wcd938x_codec_enable_ear_pa()
1027 wcd_clsh_ctrl_set_state(wcd938x->clsh_info, WCD_CLSH_EVENT_POST_PA, in wcd938x_codec_enable_ear_pa()
1030 wcd938x->flyback_cur_det_disable--; in wcd938x_codec_enable_ear_pa()
1031 if (wcd938x->flyback_cur_det_disable == 0) in wcd938x_codec_enable_ear_pa()
1044 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_dmic()
1048 switch (w->shift) { in wcd938x_codec_enable_dmic()
1078 dev_err(component->dev, "%s: Invalid DMIC Selection\n", in wcd938x_codec_enable_dmic()
1080 return -EINVAL; in wcd938x_codec_enable_dmic()
1089 /* 250us sleep as per HW requirement */ in wcd938x_codec_enable_dmic()
1115 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_tx_swr_ctrl()
1120 bank = (wcd938x_swr_get_current_bank(wcd938x->sdw_priv[AIF1_CAP]->sdev)) ? 0 : 1; in wcd938x_tx_swr_ctrl()
1125 if (strnstr(w->name, "ADC", sizeof("ADC"))) { in wcd938x_tx_swr_ctrl()
1128 if (test_bit(WCD_ADC1, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1129 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC1]]; in wcd938x_tx_swr_ctrl()
1130 if (test_bit(WCD_ADC2, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1131 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC2]]; in wcd938x_tx_swr_ctrl()
1132 if (test_bit(WCD_ADC3, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1133 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC3]]; in wcd938x_tx_swr_ctrl()
1134 if (test_bit(WCD_ADC4, &wcd938x->status_mask)) in wcd938x_tx_swr_ctrl()
1135 mode |= tx_mode_bit[wcd938x->tx_mode[WCD_ADC4]]; in wcd938x_tx_swr_ctrl()
1152 if (strnstr(w->name, "ADC", sizeof("ADC"))) { in wcd938x_tx_swr_ctrl()
1190 ret = -EINVAL; in wcd938x_get_adc_mode()
1199 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_adc()
1210 set_bit(w->shift, &wcd938x->status_mask); in wcd938x_codec_enable_adc()
1215 clear_bit(w->shift, &wcd938x->status_mask); in wcd938x_codec_enable_adc()
1254 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_adc_enable_req()
1266 wcd938x_tx_channel_config(component, w->shift, 1); in wcd938x_adc_enable_req()
1267 mode = wcd938x_get_adc_mode(wcd938x->tx_mode[w->shift]); in wcd938x_adc_enable_req()
1269 dev_info(component->dev, "Invalid ADC mode\n"); in wcd938x_adc_enable_req()
1270 return -EINVAL; in wcd938x_adc_enable_req()
1272 switch (w->shift) { in wcd938x_adc_enable_req()
1309 wcd938x_tx_channel_config(component, w->shift, 0); in wcd938x_adc_enable_req()
1312 switch (w->shift) { in wcd938x_adc_enable_req()
1361 int micb_index = micb_num - 1; in wcd938x_micbias_control()
1378 dev_err(component->dev, "%s: Invalid micbias number: %d\n", in wcd938x_micbias_control()
1380 return -EINVAL; in wcd938x_micbias_control()
1385 wcd938x->pullup_ref[micb_index]++; in wcd938x_micbias_control()
1386 if ((wcd938x->pullup_ref[micb_index] == 1) && in wcd938x_micbias_control()
1387 (wcd938x->micb_ref[micb_index] == 0)) in wcd938x_micbias_control()
1393 if (wcd938x->pullup_ref[micb_index] > 0) in wcd938x_micbias_control()
1394 wcd938x->pullup_ref[micb_index]--; in wcd938x_micbias_control()
1396 if ((wcd938x->pullup_ref[micb_index] == 0) && in wcd938x_micbias_control()
1397 (wcd938x->micb_ref[micb_index] == 0)) in wcd938x_micbias_control()
1402 wcd938x->micb_ref[micb_index]++; in wcd938x_micbias_control()
1403 if (wcd938x->micb_ref[micb_index] == 1) { in wcd938x_micbias_control()
1418 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1422 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1428 if (wcd938x->micb_ref[micb_index] > 0) in wcd938x_micbias_control()
1429 wcd938x->micb_ref[micb_index]--; in wcd938x_micbias_control()
1431 if ((wcd938x->micb_ref[micb_index] == 0) && in wcd938x_micbias_control()
1432 (wcd938x->pullup_ref[micb_index] > 0)) in wcd938x_micbias_control()
1436 else if ((wcd938x->micb_ref[micb_index] == 0) && in wcd938x_micbias_control()
1437 (wcd938x->pullup_ref[micb_index] == 0)) { in wcd938x_micbias_control()
1439 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1445 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1449 wcd_mbhc_event_notify(wcd938x->wcd_mbhc, in wcd938x_micbias_control()
1461 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_micbias()
1462 int micb_num = w->shift; in wcd938x_codec_enable_micbias()
1484 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wcd938x_codec_enable_micbias_pullup()
1485 int micb_num = w->shift; in wcd938x_codec_enable_micbias_pullup()
1510 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in wcd938x_tx_mode_get()
1511 int path = e->shift_l; in wcd938x_tx_mode_get()
1513 ucontrol->value.enumerated.item[0] = wcd938x->tx_mode[path]; in wcd938x_tx_mode_get()
1523 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in wcd938x_tx_mode_put()
1524 int path = e->shift_l; in wcd938x_tx_mode_put()
1526 if (wcd938x->tx_mode[path] == ucontrol->value.enumerated.item[0]) in wcd938x_tx_mode_put()
1529 wcd938x->tx_mode[path] = ucontrol->value.enumerated.item[0]; in wcd938x_tx_mode_put()
1540 ucontrol->value.enumerated.item[0] = wcd938x->hph_mode; in wcd938x_rx_hph_mode_get()
1551 if (wcd938x->hph_mode == ucontrol->value.enumerated.item[0]) in wcd938x_rx_hph_mode_put()
1554 wcd938x->hph_mode = ucontrol->value.enumerated.item[0]; in wcd938x_rx_hph_mode_put()
1565 if (wcd938x->comp1_enable) { in wcd938x_ear_pa_put_gain()
1566 dev_err(component->dev, "Can not set EAR PA Gain, compander1 is enabled\n"); in wcd938x_ear_pa_put_gain()
1567 return -EINVAL; in wcd938x_ear_pa_put_gain()
1572 ucontrol->value.integer.value[0]); in wcd938x_ear_pa_put_gain()
1586 mc = (struct soc_mixer_control *)(kcontrol->private_value); in wcd938x_get_compander()
1587 hphr = mc->shift; in wcd938x_get_compander()
1590 ucontrol->value.integer.value[0] = wcd938x->comp2_enable; in wcd938x_get_compander()
1592 ucontrol->value.integer.value[0] = wcd938x->comp1_enable; in wcd938x_get_compander()
1603 int value = ucontrol->value.integer.value[0]; in wcd938x_set_compander()
1608 mc = (struct soc_mixer_control *)(kcontrol->private_value); in wcd938x_set_compander()
1609 hphr = mc->shift; in wcd938x_set_compander()
1611 wcd = wcd938x->sdw_priv[AIF1_PB]; in wcd938x_set_compander()
1614 wcd938x->comp2_enable = value; in wcd938x_set_compander()
1616 wcd938x->comp1_enable = value; in wcd938x_set_compander()
1618 portidx = wcd->ch_info[mc->reg].port_num; in wcd938x_set_compander()
1621 wcd938x_connect_port(wcd, portidx, mc->reg, true); in wcd938x_set_compander()
1623 wcd938x_connect_port(wcd, portidx, mc->reg, false); in wcd938x_set_compander()
1634 ucontrol->value.integer.value[0] = wcd938x->ldoh; in wcd938x_ldoh_get()
1645 if (wcd938x->ldoh == ucontrol->value.integer.value[0]) in wcd938x_ldoh_put()
1648 wcd938x->ldoh = ucontrol->value.integer.value[0]; in wcd938x_ldoh_put()
1659 ucontrol->value.integer.value[0] = wcd938x->bcs_dis; in wcd938x_bcs_get()
1670 if (wcd938x->bcs_dis == ucontrol->value.integer.value[0]) in wcd938x_bcs_put()
1673 wcd938x->bcs_dis = ucontrol->value.integer.value[0]; in wcd938x_bcs_put()
1900 struct soc_mixer_control *mixer = (struct soc_mixer_control *)kcontrol->private_value; in wcd938x_get_swr_port()
1901 int dai_id = mixer->shift; in wcd938x_get_swr_port()
1902 int portidx, ch_idx = mixer->reg; in wcd938x_get_swr_port()
1905 wcd = wcd938x->sdw_priv[dai_id]; in wcd938x_get_swr_port()
1906 portidx = wcd->ch_info[ch_idx].port_num; in wcd938x_get_swr_port()
1908 ucontrol->value.integer.value[0] = wcd->port_enable[portidx]; in wcd938x_get_swr_port()
1920 (struct soc_mixer_control *)kcontrol->private_value; in wcd938x_set_swr_port()
1921 int ch_idx = mixer->reg; in wcd938x_set_swr_port()
1923 int dai_id = mixer->shift; in wcd938x_set_swr_port()
1926 wcd = wcd938x->sdw_priv[dai_id]; in wcd938x_set_swr_port()
1928 portidx = wcd->ch_info[ch_idx].port_num; in wcd938x_set_swr_port()
1929 if (ucontrol->value.integer.value[0]) in wcd938x_set_swr_port()
1934 wcd->port_enable[portidx] = enable; in wcd938x_set_swr_port()
1964 dev_err(component->dev, "%s: invalid number of buttons: %d\n", in wcd938x_mbhc_program_btn_thr()
1973 dev_dbg(component->dev, "%s: btn_high[%d]: %d, vth: %d\n", in wcd938x_mbhc_program_btn_thr()
2030 return -EINVAL; in wcd938x_get_micb_vout_ctl_val()
2032 return (micb_mv - 1000) / 50; in wcd938x_get_micb_vout_ctl_val()
2055 return -EINVAL; in wcd938x_mbhc_micb_adjust_voltage()
2057 mutex_lock(&wcd938x->micb_lock); in wcd938x_mbhc_micb_adjust_voltage()
2062 * to avoid slow micbias ramp-up or down enable pull-up in wcd938x_mbhc_micb_adjust_voltage()
2063 * momentarily, change the micbias value and then re-enable in wcd938x_mbhc_micb_adjust_voltage()
2073 ret = -EINVAL; in wcd938x_mbhc_micb_adjust_voltage()
2102 mutex_unlock(&wcd938x->micb_lock); in wcd938x_mbhc_micb_adjust_voltage()
2113 return -EINVAL; in wcd938x_mbhc_micb_ctrl_threshold_mic()
2119 if (wcd938x->micb2_mv >= WCD_MBHC_THR_HS_MICB_MV) in wcd938x_mbhc_micb_ctrl_threshold_mic()
2122 micb_mv = req_en ? WCD_MBHC_THR_HS_MICB_MV : wcd938x->micb2_mv; in wcd938x_mbhc_micb_ctrl_threshold_mic()
2141 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ZDET, 0x20, 0x20); in wcd938x_mbhc_get_result_params()
2143 regmap_read(wcd938x->regmap, WCD938X_ANA_MBHC_RESULT_2, &val); in wcd938x_mbhc_get_result_params()
2148 regmap_read(wcd938x->regmap, WCD938X_ANA_MBHC_RESULT_1, &val1); in wcd938x_mbhc_get_result_params()
2150 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MBHC_ZDET, 0x20, 0x00); in wcd938x_mbhc_get_result_params()
2158 dev_err(component->dev, "Impedance detect ramp error, c1=%d, x1=0x%x\n", in wcd938x_mbhc_get_result_params()
2163 denom = (x1 * d1) - (1 << (14 - noff)); in wcd938x_mbhc_get_result_params()
2169 dev_dbg(component->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d (milliohm)\n", in wcd938x_mbhc_get_result_params()
2174 regmap_read(wcd938x->regmap, in wcd938x_mbhc_get_result_params()
2176 regmap_read(wcd938x->regmap, in wcd938x_mbhc_get_result_params()
2195 WCD938X_ZDET_MAXV_CTL_MASK, zdet_param->ldo_ctl); in wcd938x_mbhc_zdet_ramp()
2197 WCD938X_VTH_MASK, zdet_param->btn5); in wcd938x_mbhc_zdet_ramp()
2199 WCD938X_VTH_MASK, zdet_param->btn6); in wcd938x_mbhc_zdet_ramp()
2201 WCD938X_VTH_MASK, zdet_param->btn7); in wcd938x_mbhc_zdet_ramp()
2203 WCD938X_ZDET_RANGE_CTL_MASK, zdet_param->noff); in wcd938x_mbhc_zdet_ramp()
2205 0x0F, zdet_param->nshift); in wcd938x_mbhc_zdet_ramp()
2210 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2212 dev_dbg(component->dev, "%s: ramp for HPH_L, noff = %d\n", in wcd938x_mbhc_zdet_ramp()
2213 __func__, zdet_param->noff); in wcd938x_mbhc_zdet_ramp()
2214 wcd938x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd938x_mbhc_zdet_ramp()
2215 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2224 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2226 dev_dbg(component->dev, "%s: ramp for HPH_R, noff = %d\n", in wcd938x_mbhc_zdet_ramp()
2227 __func__, zdet_param->noff); in wcd938x_mbhc_zdet_ramp()
2228 wcd938x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet); in wcd938x_mbhc_zdet_ramp()
2229 regmap_update_bits(wcd938x->regmap, in wcd938x_mbhc_zdet_ramp()
2248 q1_cal = (10000 - ((q1 & 0x7F) * 25)); in wcd938x_wcd_mbhc_qfuse_cal()
2286 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2290 /* For NO-jack, disable L_DET_EN before Z-det measurements */ in wcd938x_wcd_mbhc_calc_impedance()
2291 if (wcd938x->mbhc_cfg.hphl_swh) in wcd938x_wcd_mbhc_calc_impedance()
2292 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2296 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2302 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2339 dev_dbg(component->dev, "%s: impedance on HPH_L = %d(ohms)\n", in wcd938x_wcd_mbhc_calc_impedance()
2346 (zdet_param_ptr->noff == 0x6)) || in wcd938x_wcd_mbhc_calc_impedance()
2371 dev_dbg(component->dev, "%s: impedance on HPH_R = %d(ohms)\n", in wcd938x_wcd_mbhc_calc_impedance()
2377 dev_dbg(component->dev, in wcd938x_wcd_mbhc_calc_impedance()
2386 dev_dbg(component->dev, in wcd938x_wcd_mbhc_calc_impedance()
2389 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_MONO); in wcd938x_wcd_mbhc_calc_impedance()
2408 z_diff1 = (z1Ls > zMono) ? (z1Ls - zMono) : (zMono - z1Ls); in wcd938x_wcd_mbhc_calc_impedance()
2409 z_diff2 = ((*zl) > z1Ls) ? ((*zl) - z1Ls) : (z1Ls - (*zl)); in wcd938x_wcd_mbhc_calc_impedance()
2411 dev_dbg(component->dev, "%s: stereo plug type detected\n", in wcd938x_wcd_mbhc_calc_impedance()
2413 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_STEREO); in wcd938x_wcd_mbhc_calc_impedance()
2415 dev_dbg(component->dev, "%s: MONO plug type detected\n", in wcd938x_wcd_mbhc_calc_impedance()
2417 wcd_mbhc_set_hph_type(wcd938x->wcd_mbhc, WCD_MBHC_HPH_MONO); in wcd938x_wcd_mbhc_calc_impedance()
2421 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2428 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2431 /* For NO-jack, re-enable L_DET_EN after Z-det measurements */ in wcd938x_wcd_mbhc_calc_impedance()
2432 if (wcd938x->mbhc_cfg.hphl_swh) in wcd938x_wcd_mbhc_calc_impedance()
2433 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2439 regmap_update_bits(wcd938x->regmap, in wcd938x_wcd_mbhc_calc_impedance()
2472 if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { in wcd938x_mbhc_moisture_config()
2479 if (!wcd938x->mbhc_cfg.hphl_swh) { in wcd938x_mbhc_moisture_config()
2480 dev_dbg(component->dev, "%s: disable moisture detection for NC\n", in wcd938x_mbhc_moisture_config()
2488 WCD938X_M_RTH_CTL_MASK, wcd938x->mbhc_cfg.moist_rref); in wcd938x_mbhc_moisture_config()
2497 WCD938X_M_RTH_CTL_MASK, wcd938x->mbhc_cfg.moist_rref); in wcd938x_mbhc_moisture_detect_en()
2508 if (wcd938x->mbhc_cfg.moist_rref == R_OFF) { in wcd938x_mbhc_get_moisture_status()
2515 if (!wcd938x->mbhc_cfg.hphl_swh) { in wcd938x_mbhc_get_moisture_status()
2516 dev_dbg(component->dev, "%s: disable moisture detection for NC\n", in wcd938x_mbhc_get_moisture_status()
2572 ucontrol->value.integer.value[0] = wcd_mbhc_get_hph_type(wcd938x->wcd_mbhc); in wcd938x_get_hph_type()
2587 mc = (struct soc_mixer_control *)(kcontrol->private_value); in wcd938x_hph_impedance_get()
2588 hphr = mc->shift; in wcd938x_hph_impedance_get()
2589 wcd_mbhc_get_impedance(wcd938x->wcd_mbhc, &zl, &zr); in wcd938x_hph_impedance_get()
2590 dev_dbg(component->dev, "%s: zl=%u(ohms), zr=%u(ohms)\n", __func__, zl, zr); in wcd938x_hph_impedance_get()
2591 ucontrol->value.integer.value[0] = hphr ? zr : zl; in wcd938x_hph_impedance_get()
2611 struct wcd_mbhc_intr *intr_ids = &wcd938x->intr_ids; in wcd938x_mbhc_init()
2613 intr_ids->mbhc_sw_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2615 intr_ids->mbhc_btn_press_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2617 intr_ids->mbhc_btn_release_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2619 intr_ids->mbhc_hs_ins_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2621 intr_ids->mbhc_hs_rem_intr = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2623 intr_ids->hph_left_ocp = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2625 intr_ids->hph_right_ocp = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_mbhc_init()
2628 wcd938x->wcd_mbhc = wcd_mbhc_init(component, &mbhc_cb, intr_ids, wcd_mbhc_fields, true); in wcd938x_mbhc_init()
2629 if (IS_ERR(wcd938x->wcd_mbhc)) in wcd938x_mbhc_init()
2630 return PTR_ERR(wcd938x->wcd_mbhc); in wcd938x_mbhc_init()
2644 wcd_mbhc_deinit(wcd938x->wcd_mbhc); in wcd938x_mbhc_deinit()
3034 vout_ctl_1 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb1_mv); in wcd938x_set_micbias_data()
3035 vout_ctl_2 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb2_mv); in wcd938x_set_micbias_data()
3036 vout_ctl_3 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb3_mv); in wcd938x_set_micbias_data()
3037 vout_ctl_4 = wcd938x_get_micb_vout_ctl_val(wcd938x->micb4_mv); in wcd938x_set_micbias_data()
3039 return -EINVAL; in wcd938x_set_micbias_data()
3041 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB1, in wcd938x_set_micbias_data()
3043 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB2, in wcd938x_set_micbias_data()
3045 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB3, in wcd938x_set_micbias_data()
3047 regmap_update_bits(wcd938x->regmap, WCD938X_ANA_MICB4, in wcd938x_set_micbias_data()
3079 wcd->virq = irq_domain_add_linear(NULL, 1, &wcd_domain_ops, NULL); in wcd938x_irq_init()
3080 if (!(wcd->virq)) { in wcd938x_irq_init()
3082 return -EINVAL; in wcd938x_irq_init()
3085 return devm_regmap_add_irq_chip(dev, wcd->regmap, in wcd938x_irq_init()
3086 irq_create_mapping(wcd->virq, 0), in wcd938x_irq_init()
3088 &wcd->irq_chip); in wcd938x_irq_init()
3094 struct sdw_slave *tx_sdw_dev = wcd938x->tx_sdw_dev; in wcd938x_soc_codec_probe()
3095 struct device *dev = component->dev; in wcd938x_soc_codec_probe()
3099 time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete, in wcd938x_soc_codec_probe()
3103 return -ETIMEDOUT; in wcd938x_soc_codec_probe()
3106 snd_soc_component_init_regmap(component, wcd938x->regmap); in wcd938x_soc_codec_probe()
3112 wcd938x->variant = snd_soc_component_read_field(component, in wcd938x_soc_codec_probe()
3116 wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X); in wcd938x_soc_codec_probe()
3117 if (IS_ERR(wcd938x->clsh_info)) { in wcd938x_soc_codec_probe()
3119 return PTR_ERR(wcd938x->clsh_info); in wcd938x_soc_codec_probe()
3125 regmap_write(wcd938x->regmap, in wcd938x_soc_codec_probe()
3131 wcd938x->hphr_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
3133 wcd938x->hphl_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
3135 wcd938x->aux_pdm_wd_int = regmap_irq_get_virq(wcd938x->irq_chip, in wcd938x_soc_codec_probe()
3139 ret = request_threaded_irq(wcd938x->hphr_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
3147 ret = request_threaded_irq(wcd938x->hphl_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
3155 ret = request_threaded_irq(wcd938x->aux_pdm_wd_int, NULL, wcd938x_wd_handle_irq, in wcd938x_soc_codec_probe()
3164 disable_irq_nosync(wcd938x->hphr_pdm_wd_int); in wcd938x_soc_codec_probe()
3165 disable_irq_nosync(wcd938x->hphl_pdm_wd_int); in wcd938x_soc_codec_probe()
3166 disable_irq_nosync(wcd938x->aux_pdm_wd_int); in wcd938x_soc_codec_probe()
3168 switch (wcd938x->variant) { in wcd938x_soc_codec_probe()
3173 dev_err(component->dev, in wcd938x_soc_codec_probe()
3175 __func__, wcd938x->variant); in wcd938x_soc_codec_probe()
3183 dev_err(component->dev, in wcd938x_soc_codec_probe()
3185 __func__, wcd938x->variant); in wcd938x_soc_codec_probe()
3195 dev_err(component->dev, "mbhc initialization failed\n"); in wcd938x_soc_codec_probe()
3202 free_irq(wcd938x->aux_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
3204 free_irq(wcd938x->hphl_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
3206 free_irq(wcd938x->hphr_pdm_wd_int, wcd938x); in wcd938x_soc_codec_probe()
3208 wcd_clsh_ctrl_free(wcd938x->clsh_info); in wcd938x_soc_codec_probe()
3219 free_irq(wcd938x->aux_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
3220 free_irq(wcd938x->hphl_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
3221 free_irq(wcd938x->hphr_pdm_wd_int, wcd938x); in wcd938x_soc_codec_remove()
3223 wcd_clsh_ctrl_free(wcd938x->clsh_info); in wcd938x_soc_codec_remove()
3229 struct wcd938x_priv *wcd = dev_get_drvdata(comp->dev); in wcd938x_codec_set_jack()
3232 return wcd_mbhc_start(wcd->wcd_mbhc, &wcd->mbhc_cfg, jack); in wcd938x_codec_set_jack()
3234 wcd_mbhc_stop(wcd->wcd_mbhc); in wcd938x_codec_set_jack()
3255 struct device_node *np = dev->of_node; in wcd938x_dt_parse_micbias_info()
3259 rc = of_property_read_u32(np, "qcom,micbias1-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3261 wcd->micb1_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3265 rc = of_property_read_u32(np, "qcom,micbias2-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3267 wcd->micb2_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3271 rc = of_property_read_u32(np, "qcom,micbias3-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3273 wcd->micb3_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3277 rc = of_property_read_u32(np, "qcom,micbias4-microvolt", &prop_val); in wcd938x_dt_parse_micbias_info()
3279 wcd->micb4_mv = prop_val/1000; in wcd938x_dt_parse_micbias_info()
3292 value = gpiod_get_value(wcd938x->us_euro_gpio); in wcd938x_swap_gnd_mic()
3294 gpiod_set_value(wcd938x->us_euro_gpio, !value); in wcd938x_swap_gnd_mic()
3302 struct wcd_mbhc_config *cfg = &wcd938x->mbhc_cfg; in wcd938x_populate_dt_data()
3305 wcd938x->reset_gpio = of_get_named_gpio(dev->of_node, "reset-gpios", 0); in wcd938x_populate_dt_data()
3306 if (wcd938x->reset_gpio < 0) in wcd938x_populate_dt_data()
3307 return dev_err_probe(dev, wcd938x->reset_gpio, in wcd938x_populate_dt_data()
3310 wcd938x->us_euro_gpio = devm_gpiod_get_optional(dev, "us-euro", in wcd938x_populate_dt_data()
3312 if (IS_ERR(wcd938x->us_euro_gpio)) in wcd938x_populate_dt_data()
3313 return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_gpio), in wcd938x_populate_dt_data()
3314 "us-euro swap Control GPIO not found\n"); in wcd938x_populate_dt_data()
3316 cfg->swap_gnd_mic = wcd938x_swap_gnd_mic; in wcd938x_populate_dt_data()
3318 wcd938x->supplies[0].supply = "vdd-rxtx"; in wcd938x_populate_dt_data()
3319 wcd938x->supplies[1].supply = "vdd-io"; in wcd938x_populate_dt_data()
3320 wcd938x->supplies[2].supply = "vdd-buck"; in wcd938x_populate_dt_data()
3321 wcd938x->supplies[3].supply = "vdd-mic-bias"; in wcd938x_populate_dt_data()
3323 ret = regulator_bulk_get(dev, WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
3327 ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
3329 regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_populate_dt_data()
3335 cfg->mbhc_micbias = MIC_BIAS_2; in wcd938x_populate_dt_data()
3336 cfg->anc_micbias = MIC_BIAS_2; in wcd938x_populate_dt_data()
3337 cfg->v_hs_max = WCD_MBHC_HS_V_MAX; in wcd938x_populate_dt_data()
3338 cfg->num_btn = WCD938X_MBHC_MAX_BUTTONS; in wcd938x_populate_dt_data()
3339 cfg->micb_mv = wcd938x->micb2_mv; in wcd938x_populate_dt_data()
3340 cfg->linein_th = 5000; in wcd938x_populate_dt_data()
3341 cfg->hs_thr = 1700; in wcd938x_populate_dt_data()
3342 cfg->hph_thr = 50; in wcd938x_populate_dt_data()
3351 gpio_direction_output(wcd938x->reset_gpio, 0); in wcd938x_reset()
3352 /* 20us sleep required after pulling the reset gpio to LOW */ in wcd938x_reset()
3354 gpio_set_value(wcd938x->reset_gpio, 1); in wcd938x_reset()
3355 /* 20us sleep required after pulling the reset gpio to HIGH */ in wcd938x_reset()
3365 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_hw_params()
3366 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_hw_params()
3374 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_free()
3375 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_free()
3383 struct wcd938x_priv *wcd938x = dev_get_drvdata(dai->dev); in wcd938x_codec_set_sdw_stream()
3384 struct wcd938x_sdw_priv *wcd = wcd938x->sdw_priv[dai->id]; in wcd938x_codec_set_sdw_stream()
3398 .name = "wcd938x-sdw-rx",
3411 .name = "wcd938x-sdw-tx",
3437 wcd938x->rxdev = wcd938x_sdw_device_get(wcd938x->rxnode); in wcd938x_bind()
3438 if (!wcd938x->rxdev) { in wcd938x_bind()
3440 ret = -EINVAL; in wcd938x_bind()
3443 wcd938x->sdw_priv[AIF1_PB] = dev_get_drvdata(wcd938x->rxdev); in wcd938x_bind()
3444 wcd938x->sdw_priv[AIF1_PB]->wcd938x = wcd938x; in wcd938x_bind()
3446 wcd938x->txdev = wcd938x_sdw_device_get(wcd938x->txnode); in wcd938x_bind()
3447 if (!wcd938x->txdev) { in wcd938x_bind()
3449 ret = -EINVAL; in wcd938x_bind()
3452 wcd938x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd938x->txdev); in wcd938x_bind()
3453 wcd938x->sdw_priv[AIF1_CAP]->wcd938x = wcd938x; in wcd938x_bind()
3454 wcd938x->tx_sdw_dev = dev_to_sdw_dev(wcd938x->txdev); in wcd938x_bind()
3458 if (!device_link_add(wcd938x->rxdev, wcd938x->txdev, DL_FLAG_STATELESS | in wcd938x_bind()
3461 ret = -EINVAL; in wcd938x_bind()
3465 if (!device_link_add(dev, wcd938x->txdev, DL_FLAG_STATELESS | in wcd938x_bind()
3468 ret = -EINVAL; in wcd938x_bind()
3472 if (!device_link_add(dev, wcd938x->rxdev, DL_FLAG_STATELESS | in wcd938x_bind()
3475 ret = -EINVAL; in wcd938x_bind()
3479 wcd938x->regmap = dev_get_regmap(&wcd938x->tx_sdw_dev->dev, NULL); in wcd938x_bind()
3480 if (!wcd938x->regmap) { in wcd938x_bind()
3482 ret = -EINVAL; in wcd938x_bind()
3492 wcd938x->sdw_priv[AIF1_PB]->slave_irq = wcd938x->virq; in wcd938x_bind()
3493 wcd938x->sdw_priv[AIF1_CAP]->slave_irq = wcd938x->virq; in wcd938x_bind()
3512 device_link_remove(dev, wcd938x->rxdev); in wcd938x_bind()
3514 device_link_remove(dev, wcd938x->txdev); in wcd938x_bind()
3516 device_link_remove(wcd938x->rxdev, wcd938x->txdev); in wcd938x_bind()
3518 put_device(wcd938x->txdev); in wcd938x_bind()
3520 put_device(wcd938x->rxdev); in wcd938x_bind()
3532 device_link_remove(dev, wcd938x->txdev); in wcd938x_unbind()
3533 device_link_remove(dev, wcd938x->rxdev); in wcd938x_unbind()
3534 device_link_remove(wcd938x->rxdev, wcd938x->txdev); in wcd938x_unbind()
3535 put_device(wcd938x->txdev); in wcd938x_unbind()
3536 put_device(wcd938x->rxdev); in wcd938x_unbind()
3551 np = dev->of_node; in wcd938x_add_slave_components()
3553 wcd938x->rxnode = of_parse_phandle(np, "qcom,rx-device", 0); in wcd938x_add_slave_components()
3554 if (!wcd938x->rxnode) { in wcd938x_add_slave_components()
3555 dev_err(dev, "%s: Rx-device node not defined\n", __func__); in wcd938x_add_slave_components()
3556 return -ENODEV; in wcd938x_add_slave_components()
3559 of_node_get(wcd938x->rxnode); in wcd938x_add_slave_components()
3561 component_compare_of, wcd938x->rxnode); in wcd938x_add_slave_components()
3563 wcd938x->txnode = of_parse_phandle(np, "qcom,tx-device", 0); in wcd938x_add_slave_components()
3564 if (!wcd938x->txnode) { in wcd938x_add_slave_components()
3565 dev_err(dev, "%s: Tx-device node not defined\n", __func__); in wcd938x_add_slave_components()
3566 return -ENODEV; in wcd938x_add_slave_components()
3568 of_node_get(wcd938x->txnode); in wcd938x_add_slave_components()
3570 component_compare_of, wcd938x->txnode); in wcd938x_add_slave_components()
3578 struct device *dev = &pdev->dev; in wcd938x_probe()
3584 return -ENOMEM; in wcd938x_probe()
3587 mutex_init(&wcd938x->micb_lock); in wcd938x_probe()
3615 regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_probe()
3616 regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_probe()
3623 struct device *dev = &pdev->dev; in wcd938x_remove()
3632 regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_remove()
3633 regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); in wcd938x_remove()
3638 { .compatible = "qcom,wcd9380-codec" },
3639 { .compatible = "qcom,wcd9385-codec" },