asoc: mbhc: disable/enable BCS for all headset types

When EU headset is inserted into US headset jack and corrected as
right jack type, BCS will not be enabled. Remove the headset
type check to disable/enable BCS for all headset types.

Change-Id: I9898581727b74795cb357a19a2489761aa294f3b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
Meng Wang
2021-03-18 15:59:38 +08:00
parent 5314fb4974
commit efae28bba9

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/module.h>
#include <linux/init.h>
@@ -723,10 +723,8 @@ correct_plug_type:
/*
* Callback to disable BCS slow insertion detection
*/
if (plug_type == MBHC_PLUG_TYPE_HEADSET ||
plug_type == MBHC_PLUG_TYPE_HEADPHONE)
if (mbhc->mbhc_cb->bcs_enable)
mbhc->mbhc_cb->bcs_enable(mbhc, false);
if (mbhc->mbhc_cb->bcs_enable)
mbhc->mbhc_cb->bcs_enable(mbhc, false);
timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS);
while (!time_after(jiffies, timeout)) {
@@ -872,10 +870,8 @@ correct_plug_type:
wrk_complete = false;
}
}
if ((plug_type == MBHC_PLUG_TYPE_HEADSET ||
plug_type == MBHC_PLUG_TYPE_HEADPHONE))
if (mbhc->mbhc_cb->bcs_enable)
mbhc->mbhc_cb->bcs_enable(mbhc, true);
if (mbhc->mbhc_cb->bcs_enable)
mbhc->mbhc_cb->bcs_enable(mbhc, true);
if (!wrk_complete) {
/*