summaryrefslogtreecommitdiff
path: root/asoc/codecs/wcd-mbhc-v2.c
diff options
context:
space:
mode:
authorVatsal Bucha <vbucha@codeaurora.org>2017-12-12 14:22:31 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-21 20:30:38 -0800
commitd6d62b8d3c2962466542d7139efbde3b92e2234c (patch)
treec0b740cd4259e8b8c15350c0d2efb599ef5e907d /asoc/codecs/wcd-mbhc-v2.c
parent18d27316394995d1d0d301e8c1138ba0eec0acd1 (diff)
downloadmsm-extra-d6d62b8d3c2962466542d7139efbde3b92e2234c.tar.gz
ASoC: wcd: Avoid multiple insertion/removals for aux cable
High impedance aux cable when inserted causes jack to change to lineout. This causes removal event to be called which results in pause during music playback because jack value is not updated. Do not change current plug while plug is marked as lineout. CRs-Fixed: 2151012 Change-Id: I99797b58c48be00185a352094e32e8623faee491 Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Diffstat (limited to 'asoc/codecs/wcd-mbhc-v2.c')
-rw-r--r--asoc/codecs/wcd-mbhc-v2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/asoc/codecs/wcd-mbhc-v2.c b/asoc/codecs/wcd-mbhc-v2.c
index 6088a1ee..0b6e3556 100644
--- a/asoc/codecs/wcd-mbhc-v2.c
+++ b/asoc/codecs/wcd-mbhc-v2.c
@@ -605,6 +605,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
hphrocp_off_report(mbhc, SND_JACK_OC_HPHR);
hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
mbhc->current_plug = MBHC_PLUG_TYPE_NONE;
+ mbhc->force_linein = false;
} else {
/*
* Report removal of current jack type.
@@ -657,6 +658,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
SND_JACK_LINEOUT |
SND_JACK_ANC_HEADPHONE |
SND_JACK_UNSUPPORTED);
+ mbhc->force_linein = false;
}
if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET &&
@@ -699,6 +701,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
mbhc->zr < MAX_IMPED) &&
(jack_type == SND_JACK_HEADPHONE)) {
jack_type = SND_JACK_LINEOUT;
+ mbhc->force_linein = true;
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
if (mbhc->hph_status) {
mbhc->hph_status &= ~(SND_JACK_HEADSET |