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

Commit 40acd5c5 authored by Yeleswarapu Nagaradhesh's avatar Yeleswarapu Nagaradhesh
Browse files

ASoC: wcd: correct reporting of unsupported cable



If unsupported cable is slowly inserted it can be detected as
headset/headphone initially and then as unsuported cable.
Due to this MBHC driver is reporting headset/headphone first and
then unsupported cable, due to which headset icon is displayed.
So report removal of headset/headphone while reporting insertion
of unsupported cable.

CRs-Fixed: 740840
Change-Id: I1b63b90e42608b944beaa3ae9d017f1d823f6943
Signed-off-by: default avatarYeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
parent 76da5756
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -794,6 +794,11 @@ static void wcd_mbhc_find_plug_and_report(struct wcd_mbhc *mbhc,
				MSM8X16_WCD_A_ANALOG_MBHC_FSM_CTL, 0x30, 0x30);
		wcd_mbhc_report_plug(mbhc, 1, SND_JACK_HEADPHONE);
	} else if (plug_type == MBHC_PLUG_TYPE_GND_MIC_SWAP) {
			if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADPHONE)
				wcd_mbhc_report_plug(mbhc, 0,
						SND_JACK_HEADPHONE);
			if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET)
				wcd_mbhc_report_plug(mbhc, 0, SND_JACK_HEADSET);
		wcd_mbhc_report_plug(mbhc, 1, SND_JACK_UNSUPPORTED);
	} else if (plug_type == MBHC_PLUG_TYPE_HEADSET) {
		/*