Lines Matching +full:ignore +full:- +full:power +full:- +full:on +full:- +full:sel

1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
3 // Copyright (c) 2017-2018, Linaro Limited
18 #include <sound/soc-dapm.h>
25 #include "wcd-clsh-v2.h"
27 #include <dt-bindings/sound/qcom,wcd9335.h>
98 #define WCD9335_CALCULATE_VOUT_D(req_mv) (((req_mv - 650) * 10) / 25)
409 {24000, -EINVAL},/* 24K */
551 "Class H Invalid", "Class-H Hi-Fi", "Class-H Low Power", "Class-AB",
552 "Class-H Hi-Fi Low Power"
612 static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400);
1264 struct wcd9335_codec *wcd = dev_get_drvdata(w->dapm->dev); in slim_rx_mux_get()
1265 u32 port_id = w->shift; in slim_rx_mux_get()
1267 ucontrol->value.enumerated.item[0] = wcd->rx_port_value[port_id]; in slim_rx_mux_get()
1276 struct wcd9335_codec *wcd = dev_get_drvdata(w->dapm->dev); in slim_rx_mux_put()
1277 struct soc_enum *e = (struct soc_enum *)kc->private_value; in slim_rx_mux_put()
1279 u32 port_id = w->shift; in slim_rx_mux_put()
1281 if (wcd->rx_port_value[port_id] == ucontrol->value.enumerated.item[0]) in slim_rx_mux_put()
1284 wcd->rx_port_value[port_id] = ucontrol->value.enumerated.item[0]; in slim_rx_mux_put()
1287 list_del_init(&wcd->rx_chs[port_id].list); in slim_rx_mux_put()
1289 switch (wcd->rx_port_value[port_id]) { in slim_rx_mux_put()
1294 list_add_tail(&wcd->rx_chs[port_id].list, in slim_rx_mux_put()
1295 &wcd->dai[AIF1_PB].slim_ch_list); in slim_rx_mux_put()
1298 list_add_tail(&wcd->rx_chs[port_id].list, in slim_rx_mux_put()
1299 &wcd->dai[AIF2_PB].slim_ch_list); in slim_rx_mux_put()
1302 list_add_tail(&wcd->rx_chs[port_id].list, in slim_rx_mux_put()
1303 &wcd->dai[AIF3_PB].slim_ch_list); in slim_rx_mux_put()
1306 list_add_tail(&wcd->rx_chs[port_id].list, in slim_rx_mux_put()
1307 &wcd->dai[AIF4_PB].slim_ch_list); in slim_rx_mux_put()
1310 dev_err(wcd->dev, "Unknown AIF %d\n", wcd->rx_port_value[port_id]); in slim_rx_mux_put()
1314 snd_soc_dapm_mux_update_power(w->dapm, kc, wcd->rx_port_value[port_id], in slim_rx_mux_put()
1319 return -EINVAL; in slim_rx_mux_put()
1327 struct wcd9335_codec *wcd = dev_get_drvdata(dapm->dev); in slim_tx_mixer_get()
1330 (struct soc_mixer_control *)kc->private_value; in slim_tx_mixer_get()
1331 int dai_id = widget->shift; in slim_tx_mixer_get()
1332 int port_id = mixer->shift; in slim_tx_mixer_get()
1334 ucontrol->value.integer.value[0] = wcd->tx_port_value[port_id] == dai_id; in slim_tx_mixer_get()
1344 struct wcd9335_codec *wcd = dev_get_drvdata(widget->dapm->dev); in slim_tx_mixer_put()
1347 (struct soc_mixer_control *)kc->private_value; in slim_tx_mixer_put()
1348 int enable = ucontrol->value.integer.value[0]; in slim_tx_mixer_put()
1349 int dai_id = widget->shift; in slim_tx_mixer_put()
1350 int port_id = mixer->shift; in slim_tx_mixer_put()
1357 if (enable && wcd->tx_port_value[port_id] != dai_id) { in slim_tx_mixer_put()
1358 wcd->tx_port_value[port_id] = dai_id; in slim_tx_mixer_put()
1359 list_add_tail(&wcd->tx_chs[port_id].list, in slim_tx_mixer_put()
1360 &wcd->dai[dai_id].slim_ch_list); in slim_tx_mixer_put()
1361 } else if (!enable && wcd->tx_port_value[port_id] == dai_id) { in slim_tx_mixer_put()
1362 wcd->tx_port_value[port_id] = -1; in slim_tx_mixer_put()
1363 list_del_init(&wcd->tx_chs[port_id].list); in slim_tx_mixer_put()
1367 dev_err(wcd->dev, "Unknown AIF %d\n", dai_id); in slim_tx_mixer_put()
1368 return -EINVAL; in slim_tx_mixer_put()
1371 snd_soc_dapm_mixer_update_power(widget->dapm, kc, enable, update); in slim_tx_mixer_put()
1479 struct soc_enum *e = (struct soc_enum *)kc->private_value; in wcd9335_put_dec_enum()
1480 unsigned int val, reg, sel; in wcd9335_put_dec_enum() local
1482 val = ucontrol->value.enumerated.item[0]; in wcd9335_put_dec_enum()
1484 switch (e->reg) { in wcd9335_put_dec_enum()
1513 return -EINVAL; in wcd9335_put_dec_enum()
1517 sel = val ? WCD9335_CDC_TX_ADC_AMIC_SEL : WCD9335_CDC_TX_ADC_DMIC_SEL; in wcd9335_put_dec_enum()
1520 sel); in wcd9335_put_dec_enum()
1528 struct soc_enum *e = (struct soc_enum *)kc->private_value; in wcd9335_int_dem_inp_mux_put()
1533 val = ucontrol->value.enumerated.item[0]; in wcd9335_int_dem_inp_mux_put()
1535 if (e->reg == WCD9335_CDC_RX0_RX_PATH_SEC0) in wcd9335_int_dem_inp_mux_put()
1537 else if (e->reg == WCD9335_CDC_RX1_RX_PATH_SEC0) in wcd9335_int_dem_inp_mux_put()
1539 else if (e->reg == WCD9335_CDC_RX2_RX_PATH_SEC0) in wcd9335_int_dem_inp_mux_put()
1542 return -EINVAL; in wcd9335_int_dem_inp_mux_put()
1616 struct snd_soc_component *component = dai->component; in wcd9335_set_mix_interpolator_rate()
1617 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_set_mix_interpolator_rate()
1621 list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) { in wcd9335_set_mix_interpolator_rate()
1627 if (val == (ch->shift + INTn_2_INP_SEL_RX0)) in wcd9335_set_mix_interpolator_rate()
1642 struct snd_soc_component *comp = dai->component; in wcd9335_set_prim_interpolator_rate()
1643 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_set_prim_interpolator_rate()
1648 list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) { in wcd9335_set_prim_interpolator_rate()
1649 inp = ch->shift + INTn_1_MIX_INP_SEL_RX0; in wcd9335_set_prim_interpolator_rate()
1672 dev_info(wcd->dev, in wcd9335_set_prim_interpolator_rate()
1673 "Cannot set 44.1KHz on INT0\n"); in wcd9335_set_prim_interpolator_rate()
1715 struct list_head *slim_ch_list = &dai_data->slim_ch_list; in wcd9335_slim_set_hw_params()
1716 struct slim_stream_config *cfg = &dai_data->sconfig; in wcd9335_slim_set_hw_params()
1721 cfg->ch_count = 0; in wcd9335_slim_set_hw_params()
1722 cfg->direction = direction; in wcd9335_slim_set_hw_params()
1723 cfg->port_mask = 0; in wcd9335_slim_set_hw_params()
1727 cfg->ch_count++; in wcd9335_slim_set_hw_params()
1728 payload |= 1 << ch->shift; in wcd9335_slim_set_hw_params()
1729 cfg->port_mask |= BIT(ch->port); in wcd9335_slim_set_hw_params()
1732 cfg->chs = kcalloc(cfg->ch_count, sizeof(unsigned int), GFP_KERNEL); in wcd9335_slim_set_hw_params()
1733 if (!cfg->chs) in wcd9335_slim_set_hw_params()
1734 return -ENOMEM; in wcd9335_slim_set_hw_params()
1738 cfg->chs[i++] = ch->ch_num; in wcd9335_slim_set_hw_params()
1741 ret = regmap_write(wcd->if_regmap, in wcd9335_slim_set_hw_params()
1742 WCD9335_SLIM_PGD_RX_PORT_MULTI_CHNL_0(ch->port), in wcd9335_slim_set_hw_params()
1749 ret = regmap_write(wcd->if_regmap, in wcd9335_slim_set_hw_params()
1750 WCD9335_SLIM_PGD_RX_PORT_CFG(ch->port), in wcd9335_slim_set_hw_params()
1755 ret = regmap_write(wcd->if_regmap, in wcd9335_slim_set_hw_params()
1756 WCD9335_SLIM_PGD_TX_PORT_MULTI_CHNL_0(ch->port), in wcd9335_slim_set_hw_params()
1762 ret = regmap_write(wcd->if_regmap, in wcd9335_slim_set_hw_params()
1763 WCD9335_SLIM_PGD_TX_PORT_MULTI_CHNL_1(ch->port), in wcd9335_slim_set_hw_params()
1769 ret = regmap_write(wcd->if_regmap, in wcd9335_slim_set_hw_params()
1770 WCD9335_SLIM_PGD_TX_PORT_CFG(ch->port), in wcd9335_slim_set_hw_params()
1778 dai_data->sruntime = slim_stream_allocate(wcd->slim, "WCD9335-SLIM"); in wcd9335_slim_set_hw_params()
1783 dev_err(wcd->dev, "Error Setting slim hw params\n"); in wcd9335_slim_set_hw_params()
1784 kfree(cfg->chs); in wcd9335_slim_set_hw_params()
1785 cfg->chs = NULL; in wcd9335_slim_set_hw_params()
1793 struct snd_soc_component *comp = dai->component; in wcd9335_set_decimator_rate()
1798 int decimator = -1; in wcd9335_set_decimator_rate()
1800 list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) { in wcd9335_set_decimator_rate()
1801 tx_port = ch->port; in wcd9335_set_decimator_rate()
1803 dev_err(wcd->dev, "Invalid SLIM TX%u port DAI ID:%d\n", in wcd9335_set_decimator_rate()
1804 tx_port, dai->id); in wcd9335_set_decimator_rate()
1805 return -EINVAL; in wcd9335_set_decimator_rate()
1807 /* Find the SB TX MUX input - which decimator is connected */ in wcd9335_set_decimator_rate()
1814 shift = ((tx_port - 4) << 1); in wcd9335_set_decimator_rate()
1818 shift = ((tx_port - 8) << 1); in wcd9335_set_decimator_rate()
1842 decimator = tx_mux_sel - 1; in wcd9335_set_decimator_rate()
1855 dev_err(wcd->dev, "RX_MIX_TX%u going to SLIM TX%u\n", in wcd9335_set_decimator_rate()
1858 dev_err(wcd->dev, "ERROR: Invalid decimator: %d\n", in wcd9335_set_decimator_rate()
1860 return -EINVAL; in wcd9335_set_decimator_rate()
1874 wcd = snd_soc_component_get_drvdata(dai->component); in wcd9335_hw_params()
1876 switch (substream->stream) { in wcd9335_hw_params()
1880 dev_err(wcd->dev, "cannot set sample rate: %u\n", in wcd9335_hw_params()
1886 wcd->dai[dai->id].sconfig.bps = params_width(params); in wcd9335_hw_params()
1889 dev_err(wcd->dev, "%s: Invalid format 0x%x\n", in wcd9335_hw_params()
1891 return -EINVAL; in wcd9335_hw_params()
1919 dev_err(wcd->dev, "%s: Invalid TX sample rate: %d\n", in wcd9335_hw_params()
1921 return -EINVAL; in wcd9335_hw_params()
1928 dev_err(wcd->dev, "Cannot set TX Decimator rate\n"); in wcd9335_hw_params()
1933 wcd->dai[dai->id].sconfig.bps = params_width(params); in wcd9335_hw_params()
1936 dev_err(wcd->dev, "%s: Invalid format 0x%x\n", in wcd9335_hw_params()
1938 return -EINVAL; in wcd9335_hw_params()
1942 dev_err(wcd->dev, "Invalid stream type %d\n", in wcd9335_hw_params()
1943 substream->stream); in wcd9335_hw_params()
1944 return -EINVAL; in wcd9335_hw_params()
1947 wcd->dai[dai->id].sconfig.rate = params_rate(params); in wcd9335_hw_params()
1948 wcd9335_slim_set_hw_params(wcd, &wcd->dai[dai->id], substream->stream); in wcd9335_hw_params()
1960 wcd = snd_soc_component_get_drvdata(dai->component); in wcd9335_trigger()
1962 dai_data = &wcd->dai[dai->id]; in wcd9335_trigger()
1968 cfg = &dai_data->sconfig; in wcd9335_trigger()
1969 slim_stream_prepare(dai_data->sruntime, cfg); in wcd9335_trigger()
1970 slim_stream_enable(dai_data->sruntime); in wcd9335_trigger()
1975 slim_stream_disable(dai_data->sruntime); in wcd9335_trigger()
1976 slim_stream_unprepare(dai_data->sruntime); in wcd9335_trigger()
1992 wcd = snd_soc_component_get_drvdata(dai->component); in wcd9335_set_channel_map()
1995 dev_err(wcd->dev, "Invalid tx_slot=%p, rx_slot=%p\n", in wcd9335_set_channel_map()
1997 return -EINVAL; in wcd9335_set_channel_map()
2000 wcd->num_rx_port = rx_num; in wcd9335_set_channel_map()
2002 wcd->rx_chs[i].ch_num = rx_slot[i]; in wcd9335_set_channel_map()
2003 INIT_LIST_HEAD(&wcd->rx_chs[i].list); in wcd9335_set_channel_map()
2006 wcd->num_tx_port = tx_num; in wcd9335_set_channel_map()
2008 wcd->tx_chs[i].ch_num = tx_slot[i]; in wcd9335_set_channel_map()
2009 INIT_LIST_HEAD(&wcd->tx_chs[i].list); in wcd9335_set_channel_map()
2023 wcd = snd_soc_component_get_drvdata(dai->component); in wcd9335_get_channel_map()
2025 switch (dai->id) { in wcd9335_get_channel_map()
2031 dev_err(wcd->dev, "Invalid rx_slot %p or rx_num %p\n", in wcd9335_get_channel_map()
2033 return -EINVAL; in wcd9335_get_channel_map()
2036 list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) in wcd9335_get_channel_map()
2037 rx_slot[i++] = ch->ch_num; in wcd9335_get_channel_map()
2045 dev_err(wcd->dev, "Invalid tx_slot %p or tx_num %p\n", in wcd9335_get_channel_map()
2047 return -EINVAL; in wcd9335_get_channel_map()
2049 list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) in wcd9335_get_channel_map()
2050 tx_slot[i++] = ch->ch_num; in wcd9335_get_channel_map()
2055 dev_err(wcd->dev, "Invalid DAI ID %x\n", dai->id); in wcd9335_get_channel_map()
2179 int comp = ((struct soc_mixer_control *)kc->private_value)->shift; in wcd9335_get_compander()
2180 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_get_compander()
2182 ucontrol->value.integer.value[0] = wcd->comp_enabled[comp]; in wcd9335_get_compander()
2190 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_set_compander()
2191 int comp = ((struct soc_mixer_control *) kc->private_value)->shift; in wcd9335_set_compander()
2192 int value = ucontrol->value.integer.value[0]; in wcd9335_set_compander()
2193 int sel; in wcd9335_set_compander() local
2195 wcd->comp_enabled[comp] = value; in wcd9335_set_compander()
2196 sel = value ? WCD9335_HPH_GAIN_SRC_SEL_COMPANDER : in wcd9335_set_compander()
2202 /* Set Gain Source Select based on compander enable/disable */ in wcd9335_set_compander()
2204 WCD9335_HPH_GAIN_SRC_SEL_MASK, sel); in wcd9335_set_compander()
2208 WCD9335_HPH_GAIN_SRC_SEL_MASK, sel); in wcd9335_set_compander()
2212 WCD9335_HPH_GAIN_SRC_SEL_MASK, sel); in wcd9335_set_compander()
2216 WCD9335_HPH_GAIN_SRC_SEL_MASK, sel); in wcd9335_set_compander()
2229 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_rx_hph_mode_get()
2231 ucontrol->value.enumerated.item[0] = wcd->hph_mode; in wcd9335_rx_hph_mode_get()
2240 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_rx_hph_mode_put()
2243 mode_val = ucontrol->value.enumerated.item[0]; in wcd9335_rx_hph_mode_put()
2246 dev_err(wcd->dev, "Invalid HPH Mode, default to ClSH HiFi\n"); in wcd9335_rx_hph_mode_put()
2249 wcd->hph_mode = mode_val; in wcd9335_rx_hph_mode_put()
2255 /* -84dB min - 40dB max */
2257 -84, 40, digital_gain),
2259 -84, 40, digital_gain),
2261 -84, 40, digital_gain),
2263 -84, 40, digital_gain),
2265 -84, 40, digital_gain),
2267 -84, 40, digital_gain),
2269 -84, 40, digital_gain),
2271 -84, 40, digital_gain),
2273 -84, 40, digital_gain),
2275 -84, 40, digital_gain),
2277 -84, 40, digital_gain),
2279 -84, 40, digital_gain),
2281 -84, 40, digital_gain),
2283 -84, 40, digital_gain),
2285 -84, 40, digital_gain),
2287 -84, 40, digital_gain),
2289 -84, 40, digital_gain),
2291 -84, 40, digital_gain),
2499 int micb_index = micb_num - 1; in wcd9335_micbias_control()
2502 if ((micb_index < 0) || (micb_index > WCD9335_MAX_MICBIAS - 1)) { in wcd9335_micbias_control()
2503 dev_err(wcd->dev, "Invalid micbias index, micb_ind:%d\n", in wcd9335_micbias_control()
2505 return -EINVAL; in wcd9335_micbias_control()
2522 dev_err(component->dev, "%s: Invalid micbias number: %d\n", in wcd9335_micbias_control()
2524 return -EINVAL; in wcd9335_micbias_control()
2529 wcd->pullup_ref[micb_index]++; in wcd9335_micbias_control()
2530 if ((wcd->pullup_ref[micb_index] == 1) && in wcd9335_micbias_control()
2531 (wcd->micb_ref[micb_index] == 0)) in wcd9335_micbias_control()
2536 wcd->pullup_ref[micb_index]--; in wcd9335_micbias_control()
2537 if ((wcd->pullup_ref[micb_index] == 0) && in wcd9335_micbias_control()
2538 (wcd->micb_ref[micb_index] == 0)) in wcd9335_micbias_control()
2543 wcd->micb_ref[micb_index]++; in wcd9335_micbias_control()
2544 if (wcd->micb_ref[micb_index] == 1) in wcd9335_micbias_control()
2549 wcd->micb_ref[micb_index]--; in wcd9335_micbias_control()
2550 if ((wcd->micb_ref[micb_index] == 0) && in wcd9335_micbias_control()
2551 (wcd->pullup_ref[micb_index] > 0)) in wcd9335_micbias_control()
2554 else if ((wcd->micb_ref[micb_index] == 0) && in wcd9335_micbias_control()
2555 (wcd->pullup_ref[micb_index] == 0)) { in wcd9335_micbias_control()
2568 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in __wcd9335_codec_enable_micbias()
2571 if (strnstr(w->name, "MIC BIAS1", sizeof("MIC BIAS1"))) in __wcd9335_codec_enable_micbias()
2573 else if (strnstr(w->name, "MIC BIAS2", sizeof("MIC BIAS2"))) in __wcd9335_codec_enable_micbias()
2575 else if (strnstr(w->name, "MIC BIAS3", sizeof("MIC BIAS3"))) in __wcd9335_codec_enable_micbias()
2577 else if (strnstr(w->name, "MIC BIAS4", sizeof("MIC BIAS4"))) in __wcd9335_codec_enable_micbias()
2580 return -EINVAL; in __wcd9335_codec_enable_micbias()
2638 dev_err(comp->dev, "%s: invalid amic: %d\n", in wcd9335_codec_set_tx_hold()
2647 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_adc()
2651 wcd9335_codec_set_tx_hold(comp, w->reg, true); in wcd9335_codec_enable_adc()
2675 reg = WCD9335_CDC_TX_INP_MUX_ADC_MUX4_CFG0 + adc_mux_n - 4; in wcd9335_codec_find_amic_input()
2707 dev_err(comp->dev, "invalid amic: %d\n", amic); in wcd9335_codec_get_amic_pwlvl_reg()
2717 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_dec()
2728 widget_name = kmemdup_nul(w->name, 15, GFP_KERNEL); in wcd9335_codec_enable_dec()
2730 return -ENOMEM; in wcd9335_codec_enable_dec()
2735 dev_err(comp->dev, "%s: Invalid decimator = %s\n", in wcd9335_codec_enable_dec()
2736 __func__, w->name); in wcd9335_codec_enable_dec()
2737 ret = -EINVAL; in wcd9335_codec_enable_dec()
2744 dev_err(comp->dev, "%s: decimator index not found\n", in wcd9335_codec_enable_dec()
2746 ret = -EINVAL; in wcd9335_codec_enable_dec()
2752 dev_err(comp->dev, "%s: Invalid decimator = %s\n", in wcd9335_codec_enable_dec()
2754 ret = -EINVAL; in wcd9335_codec_enable_dec()
2853 dev_err(component->dev, in wcd9335_get_dmic_clk_val()
2864 dev_err(component->dev, in wcd9335_get_dmic_clk_val()
2891 dev_err(component->dev, in wcd9335_get_dmic_clk_val()
2904 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_dmic()
2914 wname = strpbrk(w->name, "012345"); in wcd9335_codec_enable_dmic()
2916 dev_err(comp->dev, "%s: widget not found\n", __func__); in wcd9335_codec_enable_dmic()
2917 return -EINVAL; in wcd9335_codec_enable_dmic()
2922 dev_err(comp->dev, "%s: Invalid DMIC line on the codec\n", in wcd9335_codec_enable_dmic()
2924 return -EINVAL; in wcd9335_codec_enable_dmic()
2930 dmic_clk_cnt = &(wcd->dmic_0_1_clk_cnt); in wcd9335_codec_enable_dmic()
2935 dmic_clk_cnt = &(wcd->dmic_2_3_clk_cnt); in wcd9335_codec_enable_dmic()
2940 dmic_clk_cnt = &(wcd->dmic_4_5_clk_cnt); in wcd9335_codec_enable_dmic()
2944 dev_err(comp->dev, "%s: Invalid DMIC Selection\n", in wcd9335_codec_enable_dmic()
2946 return -EINVAL; in wcd9335_codec_enable_dmic()
2953 wcd->mclk_rate, in wcd9335_codec_enable_dmic()
2954 wcd->dmic_sample_rate); in wcd9335_codec_enable_dmic()
2969 wcd->mclk_rate, in wcd9335_codec_enable_dmic()
2970 wcd->mad_dmic_sample_rate); in wcd9335_codec_enable_dmic()
2971 (*dmic_clk_cnt)--; in wcd9335_codec_enable_dmic()
2991 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_codec_enable_int_port()
2994 list_for_each_entry(ch, &dai->slim_ch_list, list) { in wcd9335_codec_enable_int_port()
2995 if (ch->port >= WCD9335_RX_START) { in wcd9335_codec_enable_int_port()
2996 port_num = ch->port - WCD9335_RX_START; in wcd9335_codec_enable_int_port()
2999 port_num = ch->port; in wcd9335_codec_enable_int_port()
3003 regmap_read(wcd->if_regmap, reg, &val); in wcd9335_codec_enable_int_port()
3005 regmap_write(wcd->if_regmap, reg, in wcd9335_codec_enable_int_port()
3014 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_slim()
3016 struct wcd_slim_codec_dai_data *dai = &wcd->dai[w->shift]; in wcd9335_codec_enable_slim()
3023 kfree(dai->sconfig.chs); in wcd9335_codec_enable_slim()
3034 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_mix_path()
3039 switch (w->reg) { in wcd9335_codec_enable_mix_path()
3068 dev_err(comp->dev, "%s: No gain register avail for %s\n", in wcd9335_codec_enable_mix_path()
3069 __func__, w->name); in wcd9335_codec_enable_mix_path()
3185 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_enable_prim_interpolator()
3191 wcd->prim_int_users[ind]++; in wcd9335_codec_enable_prim_interpolator()
3192 if (wcd->prim_int_users[ind] == 1) { in wcd9335_codec_enable_prim_interpolator()
3210 wcd->prim_int_users[ind]--; in wcd9335_codec_enable_prim_interpolator()
3211 if (wcd->prim_int_users[ind] == 0) { in wcd9335_codec_enable_prim_interpolator()
3232 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_config_compander()
3240 comp = interp_n - 1; in wcd9335_config_compander()
3241 if (!wcd->comp_enabled[comp]) in wcd9335_config_compander()
3293 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_interpolator()
3299 if (!(strcmp(w->name, "RX INT0 INTERP"))) { in wcd9335_codec_enable_interpolator()
3302 } else if (!(strcmp(w->name, "RX INT1 INTERP"))) { in wcd9335_codec_enable_interpolator()
3305 } else if (!(strcmp(w->name, "RX INT2 INTERP"))) { in wcd9335_codec_enable_interpolator()
3308 } else if (!(strcmp(w->name, "RX INT3 INTERP"))) { in wcd9335_codec_enable_interpolator()
3311 } else if (!(strcmp(w->name, "RX INT4 INTERP"))) { in wcd9335_codec_enable_interpolator()
3314 } else if (!(strcmp(w->name, "RX INT5 INTERP"))) { in wcd9335_codec_enable_interpolator()
3317 } else if (!(strcmp(w->name, "RX INT6 INTERP"))) { in wcd9335_codec_enable_interpolator()
3320 } else if (!(strcmp(w->name, "RX INT7 INTERP"))) { in wcd9335_codec_enable_interpolator()
3323 } else if (!(strcmp(w->name, "RX INT8 INTERP"))) { in wcd9335_codec_enable_interpolator()
3327 dev_err(comp->dev, "%s: Interpolator reg not found\n", in wcd9335_codec_enable_interpolator()
3329 return -EINVAL; in wcd9335_codec_enable_interpolator()
3338 wcd9335_config_compander(comp, w->shift, event); in wcd9335_codec_enable_interpolator()
3344 wcd9335_config_compander(comp, w->shift, event); in wcd9335_codec_enable_interpolator()
3355 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_codec_hph_mode_gain_opt()
3379 wcd->hph_l_gain = hph_l_en & 0x1F; in wcd9335_codec_hph_mode_gain_opt()
3384 wcd->hph_r_gain = hph_r_en & 0x1F; in wcd9335_codec_hph_mode_gain_opt()
3529 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_hphl_dac_event()
3530 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_hphl_dac_event()
3531 int hph_mode = wcd->hph_mode; in wcd9335_codec_hphl_dac_event()
3541 dev_err(comp->dev, "Incorrect DEM Input\n"); in wcd9335_codec_hphl_dac_event()
3542 return -EINVAL; in wcd9335_codec_hphl_dac_event()
3544 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_PRE_DAC, in wcd9335_codec_hphl_dac_event()
3561 if (!(wcd_clsh_ctrl_get_state(wcd->clsh_ctrl) & in wcd9335_codec_hphl_dac_event()
3565 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA, in wcd9335_codec_hphl_dac_event()
3578 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_lineout_dac_event()
3579 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_lineout_dac_event()
3583 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_PRE_DAC, in wcd9335_codec_lineout_dac_event()
3587 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA, in wcd9335_codec_lineout_dac_event()
3598 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_ear_dac_event()
3599 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_ear_dac_event()
3603 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_PRE_DAC, in wcd9335_codec_ear_dac_event()
3608 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA, in wcd9335_codec_ear_dac_event()
3638 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3643 if (wcd->comp_enabled[COMPANDER_1] || in wcd9335_codec_hph_post_pa_config()
3644 wcd->comp_enabled[COMPANDER_2]) { in wcd9335_codec_hph_post_pa_config()
3646 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3650 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3654 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3659 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3662 wcd->hph_l_gain); in wcd9335_codec_hph_post_pa_config()
3663 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3666 wcd->hph_r_gain); in wcd9335_codec_hph_post_pa_config()
3670 snd_soc_component_update_bits(wcd->component, in wcd9335_codec_hph_post_pa_config()
3680 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_hphr_dac_event()
3681 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_hphr_dac_event()
3682 int hph_mode = wcd->hph_mode; in wcd9335_codec_hphr_dac_event()
3694 dev_err(comp->dev, "DEM Input not set correctly, hph_mode: %d\n", in wcd9335_codec_hphr_dac_event()
3696 return -EINVAL; in wcd9335_codec_hphr_dac_event()
3699 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, in wcd9335_codec_hphr_dac_event()
3712 if (!(wcd_clsh_ctrl_get_state(wcd->clsh_ctrl) & in wcd9335_codec_hphr_dac_event()
3716 wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA, in wcd9335_codec_hphr_dac_event()
3729 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_hphl_pa()
3730 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_enable_hphl_pa()
3731 int hph_mode = wcd->hph_mode; in wcd9335_codec_enable_hphl_pa()
3777 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_lineout_pa()
3780 if (w->reg == WCD9335_ANA_LO_1_2) { in wcd9335_codec_enable_lineout_pa()
3781 if (w->shift == 7) { in wcd9335_codec_enable_lineout_pa()
3784 } else if (w->shift == 6) { in wcd9335_codec_enable_lineout_pa()
3788 } else if (w->reg == WCD9335_ANA_LO_3_4) { in wcd9335_codec_enable_lineout_pa()
3789 if (w->shift == 7) { in wcd9335_codec_enable_lineout_pa()
3792 } else if (w->shift == 6) { in wcd9335_codec_enable_lineout_pa()
3797 dev_err(comp->dev, "Error enabling lineout PA\n"); in wcd9335_codec_enable_lineout_pa()
3798 return -EINVAL; in wcd9335_codec_enable_lineout_pa()
3848 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_rx_bias()
3849 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_enable_rx_bias()
3853 wcd->rx_bias_count++; in wcd9335_codec_enable_rx_bias()
3854 if (wcd->rx_bias_count == 1) { in wcd9335_codec_enable_rx_bias()
3863 wcd->rx_bias_count--; in wcd9335_codec_enable_rx_bias()
3864 if (!wcd->rx_bias_count) in wcd9335_codec_enable_rx_bias()
3878 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_hphr_pa()
3879 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_enable_hphr_pa()
3880 int hph_mode = wcd->hph_mode; in wcd9335_codec_enable_hphr_pa()
3924 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_ear_pa()
3969 regmap_read(wcd->if_regmap, i, &val); in wcd9335_slimbus_irq()
3975 port_id = (tx ? j - 16 : j); in wcd9335_slimbus_irq()
3976 regmap_read(wcd->if_regmap, in wcd9335_slimbus_irq()
3986 wcd->if_regmap, reg, &int_val); in wcd9335_slimbus_irq()
3988 * Ignore interrupts for ports for which the in wcd9335_slimbus_irq()
3996 dev_err_ratelimited(wcd->dev, in wcd9335_slimbus_irq()
3997 "%s: overflow error on %s port %d, value %x\n", in wcd9335_slimbus_irq()
4001 dev_err_ratelimited(wcd->dev, in wcd9335_slimbus_irq()
4002 "%s: underflow error on %s port %d, value %x\n", in wcd9335_slimbus_irq()
4014 wcd->if_regmap, reg, &int_val); in wcd9335_slimbus_irq()
4017 regmap_write(wcd->if_regmap, in wcd9335_slimbus_irq()
4022 regmap_write(wcd->if_regmap, in wcd9335_slimbus_irq()
4044 irq = regmap_irq_get_virq(wcd->irq_data, wcd9335_irqs[i].irq); in wcd9335_setup_irqs()
4046 dev_err(wcd->dev, "Failed to get %s\n", in wcd9335_setup_irqs()
4051 ret = devm_request_threaded_irq(wcd->dev, irq, NULL, in wcd9335_setup_irqs()
4057 dev_err(wcd->dev, "Failed to request %s\n", in wcd9335_setup_irqs()
4063 /* enable interrupts on all slave ports */ in wcd9335_setup_irqs()
4065 regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_PORT_INT_EN0 + i, in wcd9335_setup_irqs()
4075 /* disable interrupts on all slave ports */ in wcd9335_teardown_irqs()
4077 regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_PORT_INT_EN0 + i, in wcd9335_teardown_irqs()
4084 struct snd_soc_component *comp = wcd->component; in wcd9335_cdc_sido_ccl_enable()
4087 if (++wcd->sido_ccl_cnt == 1) in wcd9335_cdc_sido_ccl_enable()
4091 if (wcd->sido_ccl_cnt == 0) { in wcd9335_cdc_sido_ccl_enable()
4092 dev_err(wcd->dev, "sido_ccl already disabled\n"); in wcd9335_cdc_sido_ccl_enable()
4095 if (--wcd->sido_ccl_cnt == 0) in wcd9335_cdc_sido_ccl_enable()
4103 wcd->master_bias_users++; in wcd9335_enable_master_bias()
4104 if (wcd->master_bias_users == 1) { in wcd9335_enable_master_bias()
4105 regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS, in wcd9335_enable_master_bias()
4108 regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS, in wcd9335_enable_master_bias()
4112 * 1ms delay is required after pre-charge is enabled in wcd9335_enable_master_bias()
4116 regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS, in wcd9335_enable_master_bias()
4119 regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS, in wcd9335_enable_master_bias()
4130 if (wcd->master_bias_users <= 0) in wcd9335_enable_mclk()
4131 return -EINVAL; in wcd9335_enable_mclk()
4133 if (((wcd->clk_mclk_users == 0) && (wcd->clk_type == WCD_CLK_MCLK)) || in wcd9335_enable_mclk()
4134 ((wcd->clk_mclk_users > 0) && (wcd->clk_type != WCD_CLK_MCLK))) { in wcd9335_enable_mclk()
4135 dev_err(wcd->dev, "Error enabling MCLK, clk_type: %d\n", in wcd9335_enable_mclk()
4136 wcd->clk_type); in wcd9335_enable_mclk()
4137 return -EINVAL; in wcd9335_enable_mclk()
4140 if (++wcd->clk_mclk_users == 1) { in wcd9335_enable_mclk()
4141 regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, in wcd9335_enable_mclk()
4144 regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, in wcd9335_enable_mclk()
4147 regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, in wcd9335_enable_mclk()
4150 regmap_update_bits(wcd->regmap, in wcd9335_enable_mclk()
4154 regmap_update_bits(wcd->regmap, in wcd9335_enable_mclk()
4165 wcd->clk_type = WCD_CLK_MCLK; in wcd9335_enable_mclk()
4172 if (wcd->clk_mclk_users <= 0) in wcd9335_disable_mclk()
4173 return -EINVAL; in wcd9335_disable_mclk()
4175 if (--wcd->clk_mclk_users == 0) { in wcd9335_disable_mclk()
4176 if (wcd->clk_rco_users > 0) { in wcd9335_disable_mclk()
4178 regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, in wcd9335_disable_mclk()
4181 wcd->clk_type = WCD_CLK_RCO; in wcd9335_disable_mclk()
4183 regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, in wcd9335_disable_mclk()
4186 wcd->clk_type = WCD_CLK_OFF; in wcd9335_disable_mclk()
4189 regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP, in wcd9335_disable_mclk()
4199 if (wcd->master_bias_users <= 0) in wcd9335_disable_master_bias()
4200 return -EINVAL; in wcd9335_disable_master_bias()
4202 wcd->master_bias_users--; in wcd9335_disable_master_bias()
4203 if (wcd->master_bias_users == 0) { in wcd9335_disable_master_bias()
4204 regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS, in wcd9335_disable_master_bias()
4207 regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS, in wcd9335_disable_master_bias()
4221 ret = clk_prepare_enable(wcd->mclk); in wcd9335_cdc_req_mclk_enable()
4223 dev_err(wcd->dev, "%s: ext clk enable failed\n", in wcd9335_cdc_req_mclk_enable()
4237 clk_disable_unprepare(wcd->mclk); in wcd9335_cdc_req_mclk_enable()
4247 struct snd_soc_component *comp = wcd->component; in wcd9335_codec_apply_sido_voltage()
4250 if (req_mv == wcd->sido_voltage) in wcd9335_codec_apply_sido_voltage()
4263 wcd->sido_voltage = req_mv; in wcd9335_codec_apply_sido_voltage()
4277 dev_err(wcd->dev, "Ext clk enable failed\n"); in wcd9335_codec_update_sido_voltage()
4291 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in _wcd9335_codec_enable_mclk()
4303 wcd->sido_voltage); in _wcd9335_codec_enable_mclk()
4313 struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm); in wcd9335_codec_enable_mclk()
4782 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_enable_sido_buck()
4797 wcd->sido_input_src = SIDO_SOURCE_RCO_BG; in wcd9335_enable_sido_buck()
4826 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_codec_init()
4830 regmap_update_bits(wcd->regmap, WCD9335_CODEC_RPM_CLK_GATE, in wcd9335_codec_init()
4833 regmap_update_bits(wcd->regmap, WCD9335_CODEC_RPM_CLK_MCLK_CFG, in wcd9335_codec_init()
4848 struct wcd9335_codec *wcd = dev_get_drvdata(component->dev); in wcd9335_codec_probe()
4852 snd_soc_component_init_regmap(component, wcd->regmap); in wcd9335_codec_probe()
4853 /* Class-H Init*/ in wcd9335_codec_probe()
4854 wcd->clsh_ctrl = wcd_clsh_ctrl_alloc(component, WCD9335); in wcd9335_codec_probe()
4855 if (IS_ERR(wcd->clsh_ctrl)) in wcd9335_codec_probe()
4856 return PTR_ERR(wcd->clsh_ctrl); in wcd9335_codec_probe()
4858 /* Default HPH Mode to Class-H HiFi */ in wcd9335_codec_probe()
4859 wcd->hph_mode = CLS_H_HIFI; in wcd9335_codec_probe()
4860 wcd->component = component; in wcd9335_codec_probe()
4865 INIT_LIST_HEAD(&wcd->dai[i].slim_ch_list); in wcd9335_codec_probe()
4874 wcd_clsh_ctrl_free(wcd->clsh_ctrl); in wcd9335_codec_probe()
4880 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_remove()
4882 wcd_clsh_ctrl_free(wcd->clsh_ctrl); in wcd9335_codec_remove()
4890 struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev); in wcd9335_codec_set_sysclk()
4892 wcd->mclk_rate = freq; in wcd9335_codec_set_sysclk()
4894 if (wcd->mclk_rate == WCD9335_MCLK_CLK_12P288MHZ) in wcd9335_codec_set_sysclk()
4899 else if (wcd->mclk_rate == WCD9335_MCLK_CLK_9P6MHZ) in wcd9335_codec_set_sysclk()
4905 return clk_set_rate(wcd->mclk, freq); in wcd9335_codec_set_sysclk()
4923 struct device *dev = wcd->dev; in wcd9335_probe()
4925 memcpy(wcd->rx_chs, wcd9335_rx_chs, sizeof(wcd9335_rx_chs)); in wcd9335_probe()
4926 memcpy(wcd->tx_chs, wcd9335_tx_chs, sizeof(wcd9335_tx_chs)); in wcd9335_probe()
4928 wcd->sido_input_src = SIDO_SOURCE_INTERNAL; in wcd9335_probe()
4929 wcd->sido_voltage = SIDO_VOLTAGE_NOMINAL_MV; in wcd9335_probe()
4981 .name = "WCD9335-IFC-DEV",
5034 struct device *dev = wcd->dev; in wcd9335_parse_dt()
5035 struct device_node *np = dev->of_node; in wcd9335_parse_dt()
5038 wcd->reset_gpio = of_get_named_gpio(np, "reset-gpios", 0); in wcd9335_parse_dt()
5039 if (wcd->reset_gpio < 0) { in wcd9335_parse_dt()
5041 return wcd->reset_gpio; in wcd9335_parse_dt()
5044 wcd->mclk = devm_clk_get(dev, "mclk"); in wcd9335_parse_dt()
5045 if (IS_ERR(wcd->mclk)) { in wcd9335_parse_dt()
5047 return PTR_ERR(wcd->mclk); in wcd9335_parse_dt()
5050 wcd->native_clk = devm_clk_get(dev, "slimbus"); in wcd9335_parse_dt()
5051 if (IS_ERR(wcd->native_clk)) { in wcd9335_parse_dt()
5053 return PTR_ERR(wcd->native_clk); in wcd9335_parse_dt()
5056 wcd->supplies[0].supply = "vdd-buck"; in wcd9335_parse_dt()
5057 wcd->supplies[1].supply = "vdd-buck-sido"; in wcd9335_parse_dt()
5058 wcd->supplies[2].supply = "vdd-tx"; in wcd9335_parse_dt()
5059 wcd->supplies[3].supply = "vdd-rx"; in wcd9335_parse_dt()
5060 wcd->supplies[4].supply = "vdd-io"; in wcd9335_parse_dt()
5062 ret = regulator_bulk_get(dev, WCD9335_MAX_SUPPLY, wcd->supplies); in wcd9335_parse_dt()
5073 struct device *dev = wcd->dev; in wcd9335_power_on_reset()
5076 ret = regulator_bulk_enable(WCD9335_MAX_SUPPLY, wcd->supplies); in wcd9335_power_on_reset()
5091 gpio_direction_output(wcd->reset_gpio, 0); in wcd9335_power_on_reset()
5093 gpio_set_value(wcd->reset_gpio, 1); in wcd9335_power_on_reset()
5101 struct regmap *rm = wcd->regmap; in wcd9335_bring_up()
5108 dev_err(wcd->dev, "WCD9335 CODEC version detection fail!\n"); in wcd9335_bring_up()
5109 return -EINVAL; in wcd9335_bring_up()
5113 dev_info(wcd->dev, "WCD9335 CODEC version is v2.0\n"); in wcd9335_bring_up()
5114 wcd->version = WCD9335_VERSION_2_0; in wcd9335_bring_up()
5124 dev_err(wcd->dev, "WCD9335 CODEC version not supported\n"); in wcd9335_bring_up()
5125 return -EINVAL; in wcd9335_bring_up()
5140 wcd->intr1 = of_irq_get_byname(wcd->dev->of_node, "intr1"); in wcd9335_irq_init()
5141 if (wcd->intr1 < 0) { in wcd9335_irq_init()
5142 if (wcd->intr1 != -EPROBE_DEFER) in wcd9335_irq_init()
5143 dev_err(wcd->dev, "Unable to configure IRQ\n"); in wcd9335_irq_init()
5145 return wcd->intr1; in wcd9335_irq_init()
5148 ret = devm_regmap_add_irq_chip(wcd->dev, wcd->regmap, wcd->intr1, in wcd9335_irq_init()
5150 &wcd9335_regmap_irq1_chip, &wcd->irq_data); in wcd9335_irq_init()
5152 dev_err(wcd->dev, "Failed to register IRQ chip: %d\n", ret); in wcd9335_irq_init()
5159 struct device *dev = &slim->dev; in wcd9335_slim_probe()
5165 return -ENOMEM; in wcd9335_slim_probe()
5167 wcd->dev = dev; in wcd9335_slim_probe()
5186 struct device *dev = &sdev->dev; in wcd9335_slim_status()
5193 ifc_dev_np = of_parse_phandle(dev->of_node, "slim-ifc-dev", 0); in wcd9335_slim_status()
5196 return -EINVAL; in wcd9335_slim_status()
5199 wcd->slim = sdev; in wcd9335_slim_status()
5200 wcd->slim_ifc_dev = of_slim_get_device(sdev->ctrl, ifc_dev_np); in wcd9335_slim_status()
5202 if (!wcd->slim_ifc_dev) { in wcd9335_slim_status()
5204 return -EINVAL; in wcd9335_slim_status()
5207 slim_get_logical_addr(wcd->slim_ifc_dev); in wcd9335_slim_status()
5209 wcd->regmap = regmap_init_slimbus(sdev, &wcd9335_regmap_config); in wcd9335_slim_status()
5210 if (IS_ERR(wcd->regmap)) { in wcd9335_slim_status()
5212 return PTR_ERR(wcd->regmap); in wcd9335_slim_status()
5215 wcd->if_regmap = regmap_init_slimbus(wcd->slim_ifc_dev, in wcd9335_slim_status()
5217 if (IS_ERR(wcd->if_regmap)) { in wcd9335_slim_status()
5219 return PTR_ERR(wcd->if_regmap); in wcd9335_slim_status()
5245 .name = "wcd9335-slim",