diff options
author | Karthikeyan Mani <kmani@codeaurora.org> | 2017-11-08 20:32:38 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-12-11 21:03:01 -0800 |
commit | 5392d8052e1a81bad1c1da097cd2900f0ff6c4aa (patch) | |
tree | d7f26f61c0b35a9a2598539221fd017e7dac0676 /asoc/codecs/wcd-mbhc-legacy.c | |
parent | 9326b2df53c2f21d560941c5e2a1a648477d4136 (diff) | |
download | msm-extra-5392d8052e1a81bad1c1da097cd2900f0ff6c4aa.tar.gz |
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>
Diffstat (limited to 'asoc/codecs/wcd-mbhc-legacy.c')
-rw-r--r-- | asoc/codecs/wcd-mbhc-legacy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/asoc/codecs/wcd-mbhc-legacy.c b/asoc/codecs/wcd-mbhc-legacy.c index a72f64b4..9f6a6254 100644 --- a/asoc/codecs/wcd-mbhc-legacy.c +++ b/asoc/codecs/wcd-mbhc-legacy.c @@ -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, |