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

Commit 760853db authored by Yeleswarapu Nagaradhesh's avatar Yeleswarapu Nagaradhesh
Browse files

ASoC: wcd: acquire lock during mbhc initialise



If target is booted with headset connected, sometimes
plug type detection is happening without mbhc initialisation.
This results in improper detection of headset.
Acquire lock in mbhc initialise to stop detection routine.

Change-Id: I82f3dbcf7051ec89e984296130454c4d9e1cc696
Signed-off-by: default avatarYeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
parent 309b6b1c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1795,6 +1795,7 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
	struct snd_soc_codec *codec = mbhc->codec;

	pr_debug("%s: enter\n", __func__);
	WCD_MBHC_RSC_LOCK(mbhc);
	/* Bring the digital block out of reset */
	snd_soc_update_bits(codec, MSM8X16_WCD_A_DIGITAL_CDC_RST_CTL,
			0x80, 0x80);
@@ -1826,6 +1827,7 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
	wcd9xxx_spmi_enable_irq(mbhc->intr_ids->mbhc_btn_release_intr);
	wcd9xxx_spmi_enable_irq(mbhc->intr_ids->hph_left_ocp);
	wcd9xxx_spmi_enable_irq(mbhc->intr_ids->hph_right_ocp);
	WCD_MBHC_RSC_UNLOCK(mbhc);
	pr_debug("%s: leave\n", __func__);
	return ret;
}