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

Commit e05d23ca authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

ASoC: wcd-mbhc: Fix plug type detection with extension cable



When headphone or headset is inserted at the other end of
extension cable, it should be detected correctly and needs
to be reported to the user-space. Update the mbhc driver
to support detection of plug that gets inserted at the other
end of the extension cable.

Change-Id: Ieaed1913479839a73bba21b53e172c249d2fa94a
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 1e8f3f50
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1196,6 +1196,7 @@ static void wcd_mbhc_detect_plug_type(struct wcd_mbhc *mbhc)
		pr_debug("%s: cross con found, start polling\n",
			 __func__);
		plug_type = MBHC_PLUG_TYPE_GND_MIC_SWAP;
		if (!mbhc->current_plug)
			mbhc->current_plug = plug_type;
		pr_debug("%s: Plug found, plug type is %d\n",
			 __func__, plug_type);
@@ -1432,7 +1433,7 @@ static irqreturn_t wcd_mbhc_hs_ins_irq(int irq, void *data)
				msleep(20);
				WCD_MBHC_REG_UPDATE_BITS(
						WCD_MBHC_ELECT_SCHMT_ISRC,
						3);
						1);
			}
			if (hphl_sch) {
				hphl_trigerred++;
@@ -1462,8 +1463,6 @@ determine_plug:
				   false);

	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_ELECT_SCHMT_ISRC, 0);
	/* Enable HW FSM */
	WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_FSM_EN, 1);
	hphl_trigerred = 0;
	mic_trigerred = 0;
	mbhc->is_extn_cable = true;