wcd               346 sound/soc/codecs/msm8916-wcd-analog.c 	struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
wcd               354 sound/soc/codecs/msm8916-wcd-analog.c 	if (wcd->micbias_mv) {
wcd               357 sound/soc/codecs/msm8916-wcd-analog.c 				    MICB_VOLTAGE_REGVAL(wcd->micbias_mv));
wcd               362 sound/soc/codecs/msm8916-wcd-analog.c 		if (wcd->micbias_mv >= 2700)
wcd               416 sound/soc/codecs/msm8916-wcd-analog.c 	struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
wcd               419 sound/soc/codecs/msm8916-wcd-analog.c 						     wcd->micbias1_cap_mode);
wcd               428 sound/soc/codecs/msm8916-wcd-analog.c 	struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
wcd               431 sound/soc/codecs/msm8916-wcd-analog.c 						     wcd->micbias2_cap_mode);
wcd               441 sound/soc/codecs/msm8916-wcd-analog.c 	struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
wcd               452 sound/soc/codecs/msm8916-wcd-analog.c 						     wcd->micbias1_cap_mode);
wcd               502 sound/soc/codecs/msm8916-wcd-analog.c static void pm8916_wcd_setup_mbhc(struct pm8916_wcd_analog_priv *wcd)
wcd               504 sound/soc/codecs/msm8916-wcd-analog.c 	struct snd_soc_component *component = wcd->component;
wcd               515 sound/soc/codecs/msm8916-wcd-analog.c 	if (wcd->hphl_jack_type_normally_open)
wcd               518 sound/soc/codecs/msm8916-wcd-analog.c 	if (wcd->gnd_jack_type_normally_open)
wcd               540 sound/soc/codecs/msm8916-wcd-analog.c 	pm8916_mbhc_configure_bias(wcd, micbias_enabled);
wcd               543 sound/soc/codecs/msm8916-wcd-analog.c 	if (wcd->mbhc_btn_enabled)
wcd               548 sound/soc/codecs/msm8916-wcd-analog.c 	wcd->mbhc_btn0_released = false;
wcd               549 sound/soc/codecs/msm8916-wcd-analog.c 	wcd->detect_accessory_type = true;
wcd               558 sound/soc/codecs/msm8916-wcd-analog.c 	struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
wcd               567 sound/soc/codecs/msm8916-wcd-analog.c 		pm8916_mbhc_configure_bias(wcd, true);
wcd               570 sound/soc/codecs/msm8916-wcd-analog.c 		pm8916_mbhc_configure_bias(wcd, false);
wcd               575 sound/soc/codecs/msm8916-wcd-analog.c 						     wcd->micbias2_cap_mode);
wcd               954 sound/soc/codecs/msm8916-wcd-analog.c 	struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
wcd               956 sound/soc/codecs/msm8916-wcd-analog.c 	wcd->jack = jack;
wcd              1273 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(dapm->dev);
wcd              1275 sound/soc/codecs/wcd9335.c 	ucontrol->value.enumerated.item[0] = wcd->rx_port_value;
wcd              1284 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(w->dapm->dev);
wcd              1289 sound/soc/codecs/wcd9335.c 	wcd->rx_port_value = ucontrol->value.enumerated.item[0];
wcd              1291 sound/soc/codecs/wcd9335.c 	switch (wcd->rx_port_value) {
wcd              1293 sound/soc/codecs/wcd9335.c 		list_del_init(&wcd->rx_chs[port_id].list);
wcd              1296 sound/soc/codecs/wcd9335.c 		list_add_tail(&wcd->rx_chs[port_id].list,
wcd              1297 sound/soc/codecs/wcd9335.c 			      &wcd->dai[AIF1_PB].slim_ch_list);
wcd              1300 sound/soc/codecs/wcd9335.c 		list_add_tail(&wcd->rx_chs[port_id].list,
wcd              1301 sound/soc/codecs/wcd9335.c 			      &wcd->dai[AIF2_PB].slim_ch_list);
wcd              1304 sound/soc/codecs/wcd9335.c 		list_add_tail(&wcd->rx_chs[port_id].list,
wcd              1305 sound/soc/codecs/wcd9335.c 			      &wcd->dai[AIF3_PB].slim_ch_list);
wcd              1308 sound/soc/codecs/wcd9335.c 		list_add_tail(&wcd->rx_chs[port_id].list,
wcd              1309 sound/soc/codecs/wcd9335.c 			      &wcd->dai[AIF4_PB].slim_ch_list);
wcd              1312 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Unknown AIF %d\n", wcd->rx_port_value);
wcd              1316 sound/soc/codecs/wcd9335.c 	snd_soc_dapm_mux_update_power(w->dapm, kc, wcd->rx_port_value,
wcd              1329 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(dapm->dev);
wcd              1331 sound/soc/codecs/wcd9335.c 	ucontrol->value.integer.value[0] = wcd->tx_port_value;
wcd              1341 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(widget->dapm->dev);
wcd              1354 sound/soc/codecs/wcd9335.c 		if (enable && !(wcd->tx_port_value & BIT(port_id))) {
wcd              1355 sound/soc/codecs/wcd9335.c 			wcd->tx_port_value |= BIT(port_id);
wcd              1356 sound/soc/codecs/wcd9335.c 			list_add_tail(&wcd->tx_chs[port_id].list,
wcd              1357 sound/soc/codecs/wcd9335.c 					&wcd->dai[dai_id].slim_ch_list);
wcd              1358 sound/soc/codecs/wcd9335.c 		} else if (!enable && (wcd->tx_port_value & BIT(port_id))) {
wcd              1359 sound/soc/codecs/wcd9335.c 			wcd->tx_port_value &= ~BIT(port_id);
wcd              1360 sound/soc/codecs/wcd9335.c 			list_del_init(&wcd->tx_chs[port_id].list);
wcd              1364 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Unknown AIF %d\n", dai_id);
wcd              1614 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              1618 sound/soc/codecs/wcd9335.c 	list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) {
wcd              1640 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              1645 sound/soc/codecs/wcd9335.c 	list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) {
wcd              1669 sound/soc/codecs/wcd9335.c 					dev_info(wcd->dev,
wcd              1708 sound/soc/codecs/wcd9335.c static int wcd9335_slim_set_hw_params(struct wcd9335_codec *wcd,
wcd              1738 sound/soc/codecs/wcd9335.c 			ret = regmap_write(wcd->if_regmap,
wcd              1746 sound/soc/codecs/wcd9335.c 			ret = regmap_write(wcd->if_regmap,
wcd              1752 sound/soc/codecs/wcd9335.c 			ret = regmap_write(wcd->if_regmap,
wcd              1759 sound/soc/codecs/wcd9335.c 			ret = regmap_write(wcd->if_regmap,
wcd              1766 sound/soc/codecs/wcd9335.c 			ret = regmap_write(wcd->if_regmap,
wcd              1775 sound/soc/codecs/wcd9335.c 	dai_data->sruntime = slim_stream_allocate(wcd->slim, "WCD9335-SLIM");
wcd              1780 sound/soc/codecs/wcd9335.c 	dev_err(wcd->dev, "Error Setting slim hw params\n");
wcd              1791 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = snd_soc_component_get_drvdata(comp);
wcd              1797 sound/soc/codecs/wcd9335.c 	list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list) {
wcd              1800 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Invalid SLIM TX%u port DAI ID:%d\n",
wcd              1854 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "RX_MIX_TX%u going to SLIM TX%u\n",
wcd              1857 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "ERROR: Invalid decimator: %d\n",
wcd              1870 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd;
wcd              1873 sound/soc/codecs/wcd9335.c 	wcd = snd_soc_component_get_drvdata(dai->component);
wcd              1879 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "cannot set sample rate: %u\n",
wcd              1885 sound/soc/codecs/wcd9335.c 			wcd->dai[dai->id].sconfig.bps = params_width(params);
wcd              1888 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "%s: Invalid format 0x%x\n",
wcd              1918 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "%s: Invalid TX sample rate: %d\n",
wcd              1927 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Cannot set TX Decimator rate\n");
wcd              1932 sound/soc/codecs/wcd9335.c 			wcd->dai[dai->id].sconfig.bps = params_width(params);
wcd              1935 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "%s: Invalid format 0x%x\n",
wcd              1941 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Invalid stream type %d\n",
wcd              1946 sound/soc/codecs/wcd9335.c 	wcd->dai[dai->id].sconfig.rate = params_rate(params);
wcd              1947 sound/soc/codecs/wcd9335.c 	wcd9335_slim_set_hw_params(wcd, &wcd->dai[dai->id], substream->stream);
wcd              1956 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd;
wcd              1959 sound/soc/codecs/wcd9335.c 	wcd = snd_soc_component_get_drvdata(dai->component);
wcd              1961 sound/soc/codecs/wcd9335.c 	dai_data = &wcd->dai[dai->id];
wcd              1988 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd;
wcd              1991 sound/soc/codecs/wcd9335.c 	wcd = snd_soc_component_get_drvdata(dai->component);
wcd              1994 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Invalid tx_slot=%p, rx_slot=%p\n",
wcd              1999 sound/soc/codecs/wcd9335.c 	wcd->num_rx_port = rx_num;
wcd              2001 sound/soc/codecs/wcd9335.c 		wcd->rx_chs[i].ch_num = rx_slot[i];
wcd              2002 sound/soc/codecs/wcd9335.c 		INIT_LIST_HEAD(&wcd->rx_chs[i].list);
wcd              2005 sound/soc/codecs/wcd9335.c 	wcd->num_tx_port = tx_num;
wcd              2007 sound/soc/codecs/wcd9335.c 		wcd->tx_chs[i].ch_num = tx_slot[i];
wcd              2008 sound/soc/codecs/wcd9335.c 		INIT_LIST_HEAD(&wcd->tx_chs[i].list);
wcd              2019 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd;
wcd              2022 sound/soc/codecs/wcd9335.c 	wcd = snd_soc_component_get_drvdata(dai->component);
wcd              2030 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Invalid rx_slot %p or rx_num %p\n",
wcd              2035 sound/soc/codecs/wcd9335.c 		list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list)
wcd              2044 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Invalid tx_slot %p or tx_num %p\n",
wcd              2048 sound/soc/codecs/wcd9335.c 		list_for_each_entry(ch, &wcd->dai[dai->id].slim_ch_list, list)
wcd              2054 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Invalid DAI ID %x\n", dai->id);
wcd              2179 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              2181 sound/soc/codecs/wcd9335.c 	ucontrol->value.integer.value[0] = wcd->comp_enabled[comp];
wcd              2189 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              2194 sound/soc/codecs/wcd9335.c 	wcd->comp_enabled[comp] = value;
wcd              2228 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              2230 sound/soc/codecs/wcd9335.c 	ucontrol->value.enumerated.item[0] = wcd->hph_mode;
wcd              2239 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              2245 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Invalid HPH Mode, default to ClSH HiFi\n");
wcd              2248 sound/soc/codecs/wcd9335.c 	wcd->hph_mode = mode_val;
wcd              2506 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = snd_soc_component_get_drvdata(component);
wcd              2511 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Invalid micbias index, micb_ind:%d\n",
wcd              2537 sound/soc/codecs/wcd9335.c 		wcd->pullup_ref[micb_index]++;
wcd              2538 sound/soc/codecs/wcd9335.c 		if ((wcd->pullup_ref[micb_index] == 1) &&
wcd              2539 sound/soc/codecs/wcd9335.c 		    (wcd->micb_ref[micb_index] == 0))
wcd              2544 sound/soc/codecs/wcd9335.c 		wcd->pullup_ref[micb_index]--;
wcd              2545 sound/soc/codecs/wcd9335.c 		if ((wcd->pullup_ref[micb_index] == 0) &&
wcd              2546 sound/soc/codecs/wcd9335.c 		    (wcd->micb_ref[micb_index] == 0))
wcd              2551 sound/soc/codecs/wcd9335.c 		wcd->micb_ref[micb_index]++;
wcd              2552 sound/soc/codecs/wcd9335.c 		if (wcd->micb_ref[micb_index] == 1)
wcd              2557 sound/soc/codecs/wcd9335.c 		wcd->micb_ref[micb_index]--;
wcd              2558 sound/soc/codecs/wcd9335.c 		if ((wcd->micb_ref[micb_index] == 0) &&
wcd              2559 sound/soc/codecs/wcd9335.c 		    (wcd->pullup_ref[micb_index] > 0))
wcd              2562 sound/soc/codecs/wcd9335.c 		else if ((wcd->micb_ref[micb_index] == 0) &&
wcd              2563 sound/soc/codecs/wcd9335.c 			 (wcd->pullup_ref[micb_index] == 0)) {
wcd              2913 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = snd_soc_component_get_drvdata(comp);
wcd              2938 sound/soc/codecs/wcd9335.c 		dmic_clk_cnt = &(wcd->dmic_0_1_clk_cnt);
wcd              2943 sound/soc/codecs/wcd9335.c 		dmic_clk_cnt = &(wcd->dmic_2_3_clk_cnt);
wcd              2948 sound/soc/codecs/wcd9335.c 		dmic_clk_cnt = &(wcd->dmic_4_5_clk_cnt);
wcd              2961 sound/soc/codecs/wcd9335.c 					wcd->mclk_rate,
wcd              2962 sound/soc/codecs/wcd9335.c 					wcd->dmic_sample_rate);
wcd              2977 sound/soc/codecs/wcd9335.c 					wcd->mclk_rate,
wcd              2978 sound/soc/codecs/wcd9335.c 					wcd->mad_dmic_sample_rate);
wcd              2999 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              3011 sound/soc/codecs/wcd9335.c 		regmap_read(wcd->if_regmap, reg, &val);
wcd              3013 sound/soc/codecs/wcd9335.c 			regmap_write(wcd->if_regmap, reg,
wcd              3023 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = snd_soc_component_get_drvdata(comp);
wcd              3024 sound/soc/codecs/wcd9335.c 	struct wcd_slim_codec_dai_data *dai = &wcd->dai[w->shift];
wcd              3193 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3199 sound/soc/codecs/wcd9335.c 		wcd->prim_int_users[ind]++;
wcd              3200 sound/soc/codecs/wcd9335.c 		if (wcd->prim_int_users[ind] == 1) {
wcd              3218 sound/soc/codecs/wcd9335.c 		wcd->prim_int_users[ind]--;
wcd              3219 sound/soc/codecs/wcd9335.c 		if (wcd->prim_int_users[ind] == 0) {
wcd              3240 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              3249 sound/soc/codecs/wcd9335.c 	if (!wcd->comp_enabled[comp])
wcd              3363 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              3387 sound/soc/codecs/wcd9335.c 		wcd->hph_l_gain = hph_l_en & 0x1F;
wcd              3392 sound/soc/codecs/wcd9335.c 		wcd->hph_r_gain = hph_r_en & 0x1F;
wcd              3538 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3539 sound/soc/codecs/wcd9335.c 	int hph_mode = wcd->hph_mode;
wcd              3552 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_PRE_DAC,
wcd              3569 sound/soc/codecs/wcd9335.c 		if (!(wcd_clsh_ctrl_get_state(wcd->clsh_ctrl) &
wcd              3573 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA,
wcd              3587 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3591 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_PRE_DAC,
wcd              3595 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA,
wcd              3607 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3611 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_PRE_DAC,
wcd              3616 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA,
wcd              3624 sound/soc/codecs/wcd9335.c static void wcd9335_codec_hph_post_pa_config(struct wcd9335_codec *wcd,
wcd              3646 sound/soc/codecs/wcd9335.c 		snd_soc_component_update_bits(wcd->component,
wcd              3651 sound/soc/codecs/wcd9335.c 		if (wcd->comp_enabled[COMPANDER_1] ||
wcd              3652 sound/soc/codecs/wcd9335.c 		    wcd->comp_enabled[COMPANDER_2]) {
wcd              3654 sound/soc/codecs/wcd9335.c 			snd_soc_component_update_bits(wcd->component,
wcd              3658 sound/soc/codecs/wcd9335.c 			snd_soc_component_update_bits(wcd->component,
wcd              3662 sound/soc/codecs/wcd9335.c 			snd_soc_component_update_bits(wcd->component,
wcd              3667 sound/soc/codecs/wcd9335.c 		snd_soc_component_update_bits(wcd->component,
wcd              3670 sound/soc/codecs/wcd9335.c 						wcd->hph_l_gain);
wcd              3671 sound/soc/codecs/wcd9335.c 		snd_soc_component_update_bits(wcd->component,
wcd              3674 sound/soc/codecs/wcd9335.c 						wcd->hph_r_gain);
wcd              3678 sound/soc/codecs/wcd9335.c 		snd_soc_component_update_bits(wcd->component,
wcd              3689 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3690 sound/soc/codecs/wcd9335.c 	int hph_mode = wcd->hph_mode;
wcd              3707 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl,
wcd              3720 sound/soc/codecs/wcd9335.c 		if (!(wcd_clsh_ctrl_get_state(wcd->clsh_ctrl) &
wcd              3724 sound/soc/codecs/wcd9335.c 		wcd_clsh_ctrl_set_state(wcd->clsh_ctrl, WCD_CLSH_EVENT_POST_PA,
wcd              3738 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3739 sound/soc/codecs/wcd9335.c 	int hph_mode = wcd->hph_mode;
wcd              3751 sound/soc/codecs/wcd9335.c 		wcd9335_codec_hph_post_pa_config(wcd, hph_mode, event);
wcd              3768 sound/soc/codecs/wcd9335.c 		wcd9335_codec_hph_post_pa_config(wcd, hph_mode, event);
wcd              3857 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3861 sound/soc/codecs/wcd9335.c 		wcd->rx_bias_count++;
wcd              3862 sound/soc/codecs/wcd9335.c 		if (wcd->rx_bias_count == 1) {
wcd              3871 sound/soc/codecs/wcd9335.c 		wcd->rx_bias_count--;
wcd              3872 sound/soc/codecs/wcd9335.c 		if (!wcd->rx_bias_count)
wcd              3887 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              3888 sound/soc/codecs/wcd9335.c 	int hph_mode = wcd->hph_mode;
wcd              3899 sound/soc/codecs/wcd9335.c 		wcd9335_codec_hph_post_pa_config(wcd, hph_mode, event);
wcd              3916 sound/soc/codecs/wcd9335.c 		wcd9335_codec_hph_post_pa_config(wcd, hph_mode, event);
wcd              3967 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = data;
wcd              3977 sound/soc/codecs/wcd9335.c 		regmap_read(wcd->if_regmap, i, &val);
wcd              3984 sound/soc/codecs/wcd9335.c 		regmap_read(wcd->if_regmap,
wcd              3994 sound/soc/codecs/wcd9335.c 				wcd->if_regmap, reg, &int_val);
wcd              4004 sound/soc/codecs/wcd9335.c 			dev_err_ratelimited(wcd->dev,
wcd              4009 sound/soc/codecs/wcd9335.c 			dev_err_ratelimited(wcd->dev,
wcd              4022 sound/soc/codecs/wcd9335.c 				wcd->if_regmap, reg, &int_val);
wcd              4025 sound/soc/codecs/wcd9335.c 				regmap_write(wcd->if_regmap,
wcd              4030 sound/soc/codecs/wcd9335.c 		regmap_write(wcd->if_regmap,
wcd              4047 sound/soc/codecs/wcd9335.c static int wcd9335_setup_irqs(struct wcd9335_codec *wcd)
wcd              4052 sound/soc/codecs/wcd9335.c 		irq = regmap_irq_get_virq(wcd->irq_data, wcd9335_irqs[i].irq);
wcd              4054 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Failed to get %s\n",
wcd              4059 sound/soc/codecs/wcd9335.c 		ret = devm_request_threaded_irq(wcd->dev, irq, NULL,
wcd              4063 sound/soc/codecs/wcd9335.c 						wcd9335_irqs[i].name, wcd);
wcd              4065 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Failed to request %s\n",
wcd              4073 sound/soc/codecs/wcd9335.c 		regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_PORT_INT_EN0 + i,
wcd              4079 sound/soc/codecs/wcd9335.c static void wcd9335_cdc_sido_ccl_enable(struct wcd9335_codec *wcd,
wcd              4082 sound/soc/codecs/wcd9335.c 	struct snd_soc_component *comp = wcd->component;
wcd              4085 sound/soc/codecs/wcd9335.c 		if (++wcd->sido_ccl_cnt == 1)
wcd              4089 sound/soc/codecs/wcd9335.c 		if (wcd->sido_ccl_cnt == 0) {
wcd              4090 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "sido_ccl already disabled\n");
wcd              4093 sound/soc/codecs/wcd9335.c 		if (--wcd->sido_ccl_cnt == 0)
wcd              4099 sound/soc/codecs/wcd9335.c static int wcd9335_enable_master_bias(struct wcd9335_codec *wcd)
wcd              4101 sound/soc/codecs/wcd9335.c 	wcd->master_bias_users++;
wcd              4102 sound/soc/codecs/wcd9335.c 	if (wcd->master_bias_users == 1) {
wcd              4103 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS,
wcd              4106 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS,
wcd              4114 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS,
wcd              4117 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS,
wcd              4125 sound/soc/codecs/wcd9335.c static int wcd9335_enable_mclk(struct wcd9335_codec *wcd)
wcd              4128 sound/soc/codecs/wcd9335.c 	if (wcd->master_bias_users <= 0)
wcd              4131 sound/soc/codecs/wcd9335.c 	if (((wcd->clk_mclk_users == 0) && (wcd->clk_type == WCD_CLK_MCLK)) ||
wcd              4132 sound/soc/codecs/wcd9335.c 	    ((wcd->clk_mclk_users > 0) && (wcd->clk_type != WCD_CLK_MCLK))) {
wcd              4133 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Error enabling MCLK, clk_type: %d\n",
wcd              4134 sound/soc/codecs/wcd9335.c 			wcd->clk_type);
wcd              4138 sound/soc/codecs/wcd9335.c 	if (++wcd->clk_mclk_users == 1) {
wcd              4139 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP,
wcd              4142 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP,
wcd              4145 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP,
wcd              4148 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap,
wcd              4152 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap,
wcd              4163 sound/soc/codecs/wcd9335.c 	wcd->clk_type = WCD_CLK_MCLK;
wcd              4168 sound/soc/codecs/wcd9335.c static int wcd9335_disable_mclk(struct wcd9335_codec *wcd)
wcd              4170 sound/soc/codecs/wcd9335.c 	if (wcd->clk_mclk_users <= 0)
wcd              4173 sound/soc/codecs/wcd9335.c 	if (--wcd->clk_mclk_users == 0) {
wcd              4174 sound/soc/codecs/wcd9335.c 		if (wcd->clk_rco_users > 0) {
wcd              4176 sound/soc/codecs/wcd9335.c 			regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP,
wcd              4179 sound/soc/codecs/wcd9335.c 			wcd->clk_type = WCD_CLK_RCO;
wcd              4181 sound/soc/codecs/wcd9335.c 			regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP,
wcd              4184 sound/soc/codecs/wcd9335.c 			wcd->clk_type = WCD_CLK_OFF;
wcd              4187 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_CLK_TOP,
wcd              4195 sound/soc/codecs/wcd9335.c static int wcd9335_disable_master_bias(struct wcd9335_codec *wcd)
wcd              4197 sound/soc/codecs/wcd9335.c 	if (wcd->master_bias_users <= 0)
wcd              4200 sound/soc/codecs/wcd9335.c 	wcd->master_bias_users--;
wcd              4201 sound/soc/codecs/wcd9335.c 	if (wcd->master_bias_users == 0) {
wcd              4202 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS,
wcd              4205 sound/soc/codecs/wcd9335.c 		regmap_update_bits(wcd->regmap, WCD9335_ANA_BIAS,
wcd              4212 sound/soc/codecs/wcd9335.c static int wcd9335_cdc_req_mclk_enable(struct wcd9335_codec *wcd,
wcd              4218 sound/soc/codecs/wcd9335.c 		wcd9335_cdc_sido_ccl_enable(wcd, true);
wcd              4219 sound/soc/codecs/wcd9335.c 		ret = clk_prepare_enable(wcd->mclk);
wcd              4221 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "%s: ext clk enable failed\n",
wcd              4226 sound/soc/codecs/wcd9335.c 		wcd9335_enable_master_bias(wcd);
wcd              4228 sound/soc/codecs/wcd9335.c 		wcd9335_enable_mclk(wcd);
wcd              4232 sound/soc/codecs/wcd9335.c 		wcd9335_disable_mclk(wcd);
wcd              4234 sound/soc/codecs/wcd9335.c 		wcd9335_disable_master_bias(wcd);
wcd              4235 sound/soc/codecs/wcd9335.c 		clk_disable_unprepare(wcd->mclk);
wcd              4236 sound/soc/codecs/wcd9335.c 		wcd9335_cdc_sido_ccl_enable(wcd, false);
wcd              4242 sound/soc/codecs/wcd9335.c static void wcd9335_codec_apply_sido_voltage(struct wcd9335_codec *wcd,
wcd              4245 sound/soc/codecs/wcd9335.c 	struct snd_soc_component *comp = wcd->component;
wcd              4248 sound/soc/codecs/wcd9335.c 	if (req_mv == wcd->sido_voltage)
wcd              4261 sound/soc/codecs/wcd9335.c 	wcd->sido_voltage = req_mv;
wcd              4267 sound/soc/codecs/wcd9335.c static int wcd9335_codec_update_sido_voltage(struct wcd9335_codec *wcd,
wcd              4273 sound/soc/codecs/wcd9335.c 	ret = wcd9335_cdc_req_mclk_enable(wcd, true);
wcd              4275 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Ext clk enable failed\n");
wcd              4279 sound/soc/codecs/wcd9335.c 	wcd9335_codec_apply_sido_voltage(wcd, req_mv);
wcd              4280 sound/soc/codecs/wcd9335.c 	wcd9335_cdc_req_mclk_enable(wcd, false);
wcd              4289 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              4293 sound/soc/codecs/wcd9335.c 		ret = wcd9335_cdc_req_mclk_enable(wcd, true);
wcd              4297 sound/soc/codecs/wcd9335.c 		wcd9335_codec_apply_sido_voltage(wcd,
wcd              4300 sound/soc/codecs/wcd9335.c 		wcd9335_codec_update_sido_voltage(wcd,
wcd              4301 sound/soc/codecs/wcd9335.c 					wcd->sido_voltage);
wcd              4302 sound/soc/codecs/wcd9335.c 		wcd9335_cdc_req_mclk_enable(wcd, false);
wcd              4780 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              4795 sound/soc/codecs/wcd9335.c 	wcd->sido_input_src = SIDO_SOURCE_RCO_BG;
wcd              4824 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              4828 sound/soc/codecs/wcd9335.c 	regmap_update_bits(wcd->regmap, WCD9335_CODEC_RPM_CLK_GATE,
wcd              4831 sound/soc/codecs/wcd9335.c 	regmap_update_bits(wcd->regmap, WCD9335_CODEC_RPM_CLK_MCLK_CFG,
wcd              4846 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(component->dev);
wcd              4849 sound/soc/codecs/wcd9335.c 	snd_soc_component_init_regmap(component, wcd->regmap);
wcd              4851 sound/soc/codecs/wcd9335.c 	wcd->clsh_ctrl = wcd_clsh_ctrl_alloc(component, wcd->version);
wcd              4852 sound/soc/codecs/wcd9335.c 	if (IS_ERR(wcd->clsh_ctrl))
wcd              4853 sound/soc/codecs/wcd9335.c 		return PTR_ERR(wcd->clsh_ctrl);
wcd              4856 sound/soc/codecs/wcd9335.c 	wcd->hph_mode = CLS_H_HIFI;
wcd              4857 sound/soc/codecs/wcd9335.c 	wcd->component = component;
wcd              4862 sound/soc/codecs/wcd9335.c 		INIT_LIST_HEAD(&wcd->dai[i].slim_ch_list);
wcd              4864 sound/soc/codecs/wcd9335.c 	return wcd9335_setup_irqs(wcd);
wcd              4869 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              4871 sound/soc/codecs/wcd9335.c 	wcd_clsh_ctrl_free(wcd->clsh_ctrl);
wcd              4872 sound/soc/codecs/wcd9335.c 	free_irq(regmap_irq_get_virq(wcd->irq_data, WCD9335_IRQ_SLIMBUS), wcd);
wcd              4879 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
wcd              4881 sound/soc/codecs/wcd9335.c 	wcd->mclk_rate = freq;
wcd              4883 sound/soc/codecs/wcd9335.c 	if (wcd->mclk_rate == WCD9335_MCLK_CLK_12P288MHZ)
wcd              4888 sound/soc/codecs/wcd9335.c 	else if (wcd->mclk_rate == WCD9335_MCLK_CLK_9P6MHZ)
wcd              4894 sound/soc/codecs/wcd9335.c 	return clk_set_rate(wcd->mclk, freq);
wcd              4909 sound/soc/codecs/wcd9335.c static int wcd9335_probe(struct wcd9335_codec *wcd)
wcd              4911 sound/soc/codecs/wcd9335.c 	struct device *dev = wcd->dev;
wcd              4913 sound/soc/codecs/wcd9335.c 	memcpy(wcd->rx_chs, wcd9335_rx_chs, sizeof(wcd9335_rx_chs));
wcd              4914 sound/soc/codecs/wcd9335.c 	memcpy(wcd->tx_chs, wcd9335_tx_chs, sizeof(wcd9335_tx_chs));
wcd              4916 sound/soc/codecs/wcd9335.c 	wcd->sido_input_src = SIDO_SOURCE_INTERNAL;
wcd              4917 sound/soc/codecs/wcd9335.c 	wcd->sido_voltage = SIDO_VOLTAGE_NOMINAL_MV;
wcd              5014 sound/soc/codecs/wcd9335.c static int wcd9335_parse_dt(struct wcd9335_codec *wcd)
wcd              5016 sound/soc/codecs/wcd9335.c 	struct device *dev = wcd->dev;
wcd              5020 sound/soc/codecs/wcd9335.c 	wcd->reset_gpio = of_get_named_gpio(np,	"reset-gpios", 0);
wcd              5021 sound/soc/codecs/wcd9335.c 	if (wcd->reset_gpio < 0) {
wcd              5023 sound/soc/codecs/wcd9335.c 		return wcd->reset_gpio;
wcd              5026 sound/soc/codecs/wcd9335.c 	wcd->mclk = devm_clk_get(dev, "mclk");
wcd              5027 sound/soc/codecs/wcd9335.c 	if (IS_ERR(wcd->mclk)) {
wcd              5029 sound/soc/codecs/wcd9335.c 		return PTR_ERR(wcd->mclk);
wcd              5032 sound/soc/codecs/wcd9335.c 	wcd->native_clk = devm_clk_get(dev, "slimbus");
wcd              5033 sound/soc/codecs/wcd9335.c 	if (IS_ERR(wcd->native_clk)) {
wcd              5035 sound/soc/codecs/wcd9335.c 		return PTR_ERR(wcd->native_clk);
wcd              5038 sound/soc/codecs/wcd9335.c 	wcd->supplies[0].supply = "vdd-buck";
wcd              5039 sound/soc/codecs/wcd9335.c 	wcd->supplies[1].supply = "vdd-buck-sido";
wcd              5040 sound/soc/codecs/wcd9335.c 	wcd->supplies[2].supply = "vdd-tx";
wcd              5041 sound/soc/codecs/wcd9335.c 	wcd->supplies[3].supply = "vdd-rx";
wcd              5042 sound/soc/codecs/wcd9335.c 	wcd->supplies[4].supply = "vdd-io";
wcd              5044 sound/soc/codecs/wcd9335.c 	ret = regulator_bulk_get(dev, WCD9335_MAX_SUPPLY, wcd->supplies);
wcd              5053 sound/soc/codecs/wcd9335.c static int wcd9335_power_on_reset(struct wcd9335_codec *wcd)
wcd              5055 sound/soc/codecs/wcd9335.c 	struct device *dev = wcd->dev;
wcd              5058 sound/soc/codecs/wcd9335.c 	ret = regulator_bulk_enable(WCD9335_MAX_SUPPLY, wcd->supplies);
wcd              5073 sound/soc/codecs/wcd9335.c 	gpio_direction_output(wcd->reset_gpio, 0);
wcd              5075 sound/soc/codecs/wcd9335.c 	gpio_set_value(wcd->reset_gpio, 1);
wcd              5081 sound/soc/codecs/wcd9335.c static int wcd9335_bring_up(struct wcd9335_codec *wcd)
wcd              5083 sound/soc/codecs/wcd9335.c 	struct regmap *rm = wcd->regmap;
wcd              5090 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "WCD9335 CODEC version detection fail!\n");
wcd              5095 sound/soc/codecs/wcd9335.c 		dev_info(wcd->dev, "WCD9335 CODEC version is v2.0\n");
wcd              5096 sound/soc/codecs/wcd9335.c 		wcd->version = WCD9335_VERSION_2_0;
wcd              5106 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "WCD9335 CODEC version not supported\n");
wcd              5113 sound/soc/codecs/wcd9335.c static int wcd9335_irq_init(struct wcd9335_codec *wcd)
wcd              5122 sound/soc/codecs/wcd9335.c 	wcd->intr1 = of_irq_get_byname(wcd->dev->of_node, "intr1");
wcd              5123 sound/soc/codecs/wcd9335.c 	if (wcd->intr1 < 0) {
wcd              5124 sound/soc/codecs/wcd9335.c 		if (wcd->intr1 != -EPROBE_DEFER)
wcd              5125 sound/soc/codecs/wcd9335.c 			dev_err(wcd->dev, "Unable to configure IRQ\n");
wcd              5127 sound/soc/codecs/wcd9335.c 		return wcd->intr1;
wcd              5130 sound/soc/codecs/wcd9335.c 	ret = devm_regmap_add_irq_chip(wcd->dev, wcd->regmap, wcd->intr1,
wcd              5132 sound/soc/codecs/wcd9335.c 				 &wcd9335_regmap_irq1_chip, &wcd->irq_data);
wcd              5134 sound/soc/codecs/wcd9335.c 		dev_err(wcd->dev, "Failed to register IRQ chip: %d\n", ret);
wcd              5142 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd;
wcd              5145 sound/soc/codecs/wcd9335.c 	wcd = devm_kzalloc(dev, sizeof(*wcd), GFP_KERNEL);
wcd              5146 sound/soc/codecs/wcd9335.c 	if (!wcd)
wcd              5149 sound/soc/codecs/wcd9335.c 	wcd->dev = dev;
wcd              5150 sound/soc/codecs/wcd9335.c 	ret = wcd9335_parse_dt(wcd);
wcd              5156 sound/soc/codecs/wcd9335.c 	ret = wcd9335_power_on_reset(wcd);
wcd              5160 sound/soc/codecs/wcd9335.c 	dev_set_drvdata(dev, wcd);
wcd              5170 sound/soc/codecs/wcd9335.c 	struct wcd9335_codec *wcd;
wcd              5173 sound/soc/codecs/wcd9335.c 	wcd = dev_get_drvdata(dev);
wcd              5181 sound/soc/codecs/wcd9335.c 	wcd->slim = sdev;
wcd              5182 sound/soc/codecs/wcd9335.c 	wcd->slim_ifc_dev = of_slim_get_device(sdev->ctrl, ifc_dev_np);
wcd              5184 sound/soc/codecs/wcd9335.c 	if (!wcd->slim_ifc_dev) {
wcd              5189 sound/soc/codecs/wcd9335.c 	slim_get_logical_addr(wcd->slim_ifc_dev);
wcd              5191 sound/soc/codecs/wcd9335.c 	wcd->regmap = regmap_init_slimbus(sdev, &wcd9335_regmap_config);
wcd              5192 sound/soc/codecs/wcd9335.c 	if (IS_ERR(wcd->regmap)) {
wcd              5194 sound/soc/codecs/wcd9335.c 		return PTR_ERR(wcd->regmap);
wcd              5197 sound/soc/codecs/wcd9335.c 	wcd->if_regmap = regmap_init_slimbus(wcd->slim_ifc_dev,
wcd              5199 sound/soc/codecs/wcd9335.c 	if (IS_ERR(wcd->if_regmap)) {
wcd              5201 sound/soc/codecs/wcd9335.c 		return PTR_ERR(wcd->if_regmap);
wcd              5204 sound/soc/codecs/wcd9335.c 	ret = wcd9335_bring_up(wcd);
wcd              5210 sound/soc/codecs/wcd9335.c 	ret = wcd9335_irq_init(wcd);
wcd              5214 sound/soc/codecs/wcd9335.c 	wcd9335_probe(wcd);