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

Commit 3c20d5bd authored by Simmi Pateriya's avatar Simmi Pateriya
Browse files

ASoC: wcd9xxx: Don't enable micbias if headset is removed



If special headset is removed, the callback to
disable micbias will be called, as micbias is
always on with special headset. Mbhc driver
checks a flag, used to disable/enable micbias
for special headset, to make sure micbias is
not disabled by recording. If this flag is not
updated properly before the callback is called
while the headset is removed, it can cause that
micbias is left enabled.

CRs-Fixed: 687630
Change-Id: Id49a2a0ba43821deef8fc5b6fb904239b2273f69
Signed-off-by: default avatarSimmi Pateriya <simmip@codeaurora.org>
parent c6482ce7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -860,9 +860,9 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion,

		if (mbhc->micbias_enable && mbhc->micbias_enable_cb) {
			pr_debug("%s: Disabling micbias\n", __func__);
			mbhc->micbias_enable = false;
			mbhc->micbias_enable_cb(mbhc->codec, false,
						mbhc->mbhc_cfg->micbias);
			mbhc->micbias_enable = false;
		}
		mbhc->zl = mbhc->zr = 0;
		pr_debug("%s: Reporting removal %d(%x)\n", __func__,
@@ -887,9 +887,9 @@ static void wcd9xxx_report_plug(struct wcd9xxx_mbhc *mbhc, int insertion,
			if (mbhc->micbias_enable && mbhc->micbias_enable_cb &&
			    mbhc->hph_status == SND_JACK_HEADSET) {
				pr_debug("%s: Disabling micbias\n", __func__);
				mbhc->micbias_enable = false;
				mbhc->micbias_enable_cb(mbhc->codec, false,
						mbhc->mbhc_cfg->micbias);
				mbhc->micbias_enable = false;
			}

			pr_debug("%s: Reporting removal (%x)\n",