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

Commit 7eed4ec0 authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9xxx: Change PA on and VDDIO switch sequence



During removing and re-inserting of headset while music
playback is ON, mbhc driver disables HPH PA and re-enables
it once the detection is completed. After enabling PA, it
switches micbias output to VDDIO to avoid polling noise on
the headset. This sequence would cause a glitch because PA
is already enabled while switching to VDDIO is taking place.
Avoid this glitch by changing the sequence - switch to vddio
and then enable HPH PA.

CRs-Fixed: 704414
Change-Id: Ibe7d2ffa65adb0203e67d488acadc299e3a54fc0
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent a206d164
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -941,6 +941,16 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion,
			 jack_type, mbhc->hph_status);
		wcd9xxx_jack_report(mbhc, &mbhc->headset_jack,
				    mbhc->hph_status, WCD9XXX_JACK_MASK);
		/*
		 * if PA is already on, switch micbias
		 * source to VDDIO
		 */
		if (((mbhc->current_plug == PLUG_TYPE_HEADSET) ||
		     (mbhc->current_plug == PLUG_TYPE_ANC_HEADPHONE)) &&
		    ((mbhc->event_state & (1 << MBHC_EVENT_PA_HPHL |
			1 << MBHC_EVENT_PA_HPHR))))
			__wcd9xxx_switch_micbias(mbhc, 1, false,
						 false);
		wcd9xxx_clr_and_turnon_hph_padac(mbhc);
	}
	/* Setup insert detect */
@@ -2345,14 +2355,6 @@ static void wcd9xxx_find_plug_and_report(struct wcd9xxx_mbhc *mbhc,
		 */
		msleep(100);

		/*
		 * if PA is already on, switch micbias
		 * source to VDDIO
		 */
		if (mbhc->event_state &
		(1 << MBHC_EVENT_PA_HPHL | 1 << MBHC_EVENT_PA_HPHR))
			__wcd9xxx_switch_micbias(mbhc, 1, false,
						 false);
		wcd9xxx_start_hs_polling(mbhc);
	} else if (plug_type == PLUG_TYPE_HIGH_HPH) {
		if (mbhc->mbhc_cfg->detect_extn_cable) {