ASoC: Fix audio distortion issue during headset record

Audio is distorted during first 3 secs on headset record
while doing device switch from dmic to headset mic.
Disable BCS before slow insertion detection and enable it
afterwards to resolve the issue.

Change-Id: Ie5bc4b5292e5f69066760cab44d78989a74f13f4
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Cette révision appartient à :
Vatsal Bucha
2019-10-14 23:14:12 +05:30
révisé par Gerrit - the friendly Code Review server
Parent 731807e0a2
révision d06525fa68
9 fichiers modifiés avec 68 ajouts et 3 suppressions

Voir le fichier

@@ -689,6 +689,13 @@ static void wcd_correct_swch_plug(struct work_struct *work)
}
correct_plug_type:
/*
* Callback to disable BCS slow insertion detection
*/
if (plug_type == MBHC_PLUG_TYPE_HEADSET ||
plug_type == MBHC_PLUG_TYPE_HEADPHONE)
mbhc->mbhc_cb->bcs_enable(mbhc, false);
timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS);
while (!time_after(jiffies, timeout)) {
if (mbhc->hs_detect_work_stop) {
@@ -833,6 +840,10 @@ correct_plug_type:
wrk_complete = false;
}
}
if ((plug_type == MBHC_PLUG_TYPE_HEADSET ||
plug_type == MBHC_PLUG_TYPE_HEADPHONE))
mbhc->mbhc_cb->bcs_enable(mbhc, true);
if (!wrk_complete) {
/*
* If plug_tye is headset, we might have already reported either