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

Commit 7c5404ea authored by Simmi Pateriya's avatar Simmi Pateriya
Browse files

ASoC: wcd: correct cross connection detection



To detect a cross connection only micbias and schmitt
triggers are needed to be enabled. The check for button
press is not required hence remove it.

CRs-Fixed: 748814
Change-Id: I4b9edb8ae5700ebdd5d31eb046aa58663623e09d
Signed-off-by: default avatarSimmi Pateriya <simmip@codeaurora.org>
parent b37e3871
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -834,7 +834,7 @@ static void wcd_mbhc_find_plug_and_report(struct wcd_mbhc *mbhc,
/* To determine if cross connection occured */
static bool wcd_check_cross_conn(struct wcd_mbhc *mbhc)
{
	u16 result1, swap_res;
	u16 swap_res;
	struct snd_soc_codec *codec = mbhc->codec;
	enum wcd_mbhc_plug_type plug_type = mbhc->current_plug;
	s16 reg1;
@@ -845,8 +845,6 @@ static bool wcd_check_cross_conn(struct wcd_mbhc *mbhc)
	 * Micbias and schmitt trigger (HPHL-HPHR)
	 * needs to be enabled.
	 */
	result1 = snd_soc_read(codec, MSM8X16_WCD_A_ANALOG_MBHC_BTN_RESULT);
	/* Make sure micbias is enabled now */
	wcd_enable_curr_micbias(mbhc, WCD_MBHC_EN_MB);
	snd_soc_update_bits(codec,
			MSM8X16_WCD_A_ANALOG_MBHC_DET_CTL_2,
@@ -855,7 +853,7 @@ static bool wcd_check_cross_conn(struct wcd_mbhc *mbhc)
	swap_res = snd_soc_read(codec,
			MSM8X16_WCD_A_ANALOG_MBHC_ZDET_ELECT_RESULT);
	pr_debug("%s: swap_res %x\n", __func__, swap_res);
	if (!result1 && !(swap_res & 0x0C)) {
	if (!(swap_res & 0x0C)) {
		plug_type = MBHC_PLUG_TYPE_GND_MIC_SWAP;
		pr_debug("%s: Cross connection identified\n", __func__);
	} else {