Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05db5cdd authored by Venkata Narendra Kumar Gutta's avatar Venkata Narendra Kumar Gutta
Browse files

ASoC: msm: Add support to configure compander GPIO



Add support to configure comapnder GPIO as this GPIO is used
to route compander gain.

CRs-Fixed: 965449
Change-Id: I3943c6942e6a418bace8f96747d9a8292c33787a
Signed-off-by: default avatarVenkata Narendra Kumar Gutta <vgutta@codeaurora.org>
parent 4f3b362e
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -209,6 +209,33 @@ static const struct snd_soc_dapm_widget msm8952_dapm_widgets[] = {
	SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
};

static int config_hph_compander_gpio(bool enable)
{
	int ret = 0;

	pr_debug("%s: %s HPH Compander\n", __func__,
		enable ? "Enable" : "Disable");

	if (enable) {
		ret = msm_gpioset_activate(CLIENT_WCD_INT, "comp_gpio");
		if (ret) {
			pr_err("%s: gpio set cannot be activated %s\n",
				__func__, "comp_gpio");
			goto done;
		}
	} else {
		ret = msm_gpioset_suspend(CLIENT_WCD_INT, "comp_gpio");
		if (ret) {
			pr_err("%s: gpio set cannot be de-activated %s\n",
				__func__, "comp_gpio");
			goto done;
		}
	}

done:
	return ret;
}

int is_ext_spk_gpio_support(struct platform_device *pdev,
			struct msm8916_asoc_mach_data *pdata)
{
@@ -1553,6 +1580,7 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd)
	snd_soc_dapm_sync(dapm);

	msm8x16_wcd_spk_ext_pa_cb(enable_spk_ext_pa, codec);
	msm8x16_wcd_hph_comp_cb(config_hph_compander_gpio, codec);

	mbhc_cfg.calibration = def_msm8952_wcd_mbhc_cal();
	if (mbhc_cfg.calibration) {