asoc: codecs: modify gnd mic swap threshold for usb-c analog

To reduce time of usb-c analog headset detection, reduce
gnd mic swap threshold if usb-c is enabled. Use
existing threshold value otherwise.

CRs-Fixed: 2137077
Change-Id: Ic1d1f3a00c9034caaac45f2c80f018546a69ce59
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Esse commit está contido em:
Karthikeyan Mani
2017-11-08 20:32:38 -08:00
commit de Gerrit - the friendly Code Review server
commit 5392d8052e
4 arquivos alterados com 13 adições e 9 exclusões

Ver arquivo

@@ -498,7 +498,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
do {
cross_conn = wcd_check_cross_conn(mbhc);
try++;
} while (try < GND_MIC_SWAP_THRESHOLD);
} while (try < mbhc->swap_thr);
/*
* Check for cross connection 4 times.
@@ -599,10 +599,10 @@ correct_plug_type:
pt_gnd_mic_swap_cnt++;
no_gnd_mic_swap_cnt = 0;
if (pt_gnd_mic_swap_cnt <
GND_MIC_SWAP_THRESHOLD) {
mbhc->swap_thr) {
continue;
} else if (pt_gnd_mic_swap_cnt >
GND_MIC_SWAP_THRESHOLD) {
mbhc->swap_thr) {
/*
* This is due to GND/MIC switch didn't
* work, Report unsupported plug.
@@ -626,7 +626,7 @@ correct_plug_type:
no_gnd_mic_swap_cnt = 0;
}
}
if ((pt_gnd_mic_swap_cnt == GND_MIC_SWAP_THRESHOLD) &&
if ((pt_gnd_mic_swap_cnt == mbhc->swap_thr) &&
(plug_type == MBHC_PLUG_TYPE_GND_MIC_SWAP)) {
/*
* if switch is toggled, check again,