ASoC: wcd: enable mbhc interrupts after SSR

After ssr mbhc interrupts need to be enabled for mbhc
to work. If mbhc_init is not called, there are no
interrupts enabled. Call the api so that mbhc is
initialized properly.

Change-Id: I64ba4b8de50da2b527e20c90f99c79c49fabfed3
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
This commit is contained in:
Simmi Pateriya 2015-09-08 12:32:32 +05:30 committed by Gerrit - the friendly Code Review server
parent 6fd6f578ac
commit c16d5c560b
2 changed files with 9 additions and 2 deletions

View file

@ -4921,6 +4921,7 @@ static int msm8x16_wcd_device_up(struct snd_soc_codec *codec)
struct msm8x16_wcd_priv *msm8x16_wcd_priv =
snd_soc_codec_get_drvdata(codec);
u32 reg;
int ret = 0;
dev_dbg(codec->dev, "%s: device up!\n", __func__);
mutex_lock(&codec->mutex);
@ -4967,7 +4968,14 @@ static int msm8x16_wcd_device_up(struct snd_soc_codec *codec)
msm8x16_wcd_configure_cap(codec, false, false);
wcd_mbhc_stop(&msm8x16_wcd_priv->mbhc);
wcd_mbhc_start(&msm8x16_wcd_priv->mbhc,
wcd_mbhc_deinit(&msm8x16_wcd_priv->mbhc);
ret = wcd_mbhc_init(&msm8x16_wcd_priv->mbhc, codec, &mbhc_cb, &intr_ids,
wcd_mbhc_registers, true);
if (ret)
dev_err(codec->dev, "%s: mbhc initialization failed\n",
__func__);
else
wcd_mbhc_start(&msm8x16_wcd_priv->mbhc,
msm8x16_wcd_priv->mbhc.mbhc_cfg);
mutex_unlock(&codec->mutex);

View file

@ -2101,7 +2101,6 @@ int wcd_mbhc_init(struct wcd_mbhc *mbhc, struct snd_soc_codec *codec,
mbhc->is_extn_cable = false;
mbhc->hph_type = WCD_MBHC_HPH_NONE;
mbhc->wcd_mbhc_regs = wcd_mbhc_regs;
mbhc->skip_imped_detection = false;
if (mbhc->intr_ids == NULL) {
pr_err("%s: Interrupt mapping not provided\n", __func__);