summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-07-13 15:45:32 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-07-13 15:45:31 -0700
commite78a398fb7d5cd3880b4ccc70dc26c64909ea322 (patch)
tree8163ead3c5898f0b2a5ada6b869eafbb107f2ffa
parentd55264e2fc55748c38ac5f401904f1118178cc4b (diff)
parent1785ac14381c522640ec3a1489217b05367a52dd (diff)
Merge "ASoC: wcd-mbhc: fix plug removal detection from extension cable"
-rw-r--r--sound/soc/codecs/wcd-mbhc-v2.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index 36ab897b8dc0..8ef9e4391b09 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -1382,6 +1382,15 @@ exit:
micbias2 = mbhc->mbhc_cb->micbias_enable_status(mbhc,
MIC_BIAS_2);
}
+
+ if (mbhc->mbhc_cfg->detect_extn_cable &&
+ ((plug_type == MBHC_PLUG_TYPE_HEADPHONE) ||
+ (plug_type == MBHC_PLUG_TYPE_HEADSET)) &&
+ !mbhc->hs_detect_work_stop) {
+ WCD_MBHC_RSC_LOCK(mbhc);
+ wcd_mbhc_hs_elec_irq(mbhc, WCD_MBHC_ELEC_HS_REM, true);
+ WCD_MBHC_RSC_UNLOCK(mbhc);
+ }
if (mbhc->mbhc_cb->set_cap_mode)
mbhc->mbhc_cb->set_cap_mode(codec, micbias1, micbias2);
@@ -1734,6 +1743,10 @@ static irqreturn_t wcd_mbhc_hs_rem_irq(int irq, void *data)
}
} while (!time_after(jiffies, timeout));
+ if (wcd_swch_level_remove(mbhc)) {
+ pr_debug("%s: Switch level is low ", __func__);
+ goto exit;
+ }
pr_debug("%s: headset %s actually removed\n", __func__,
removed ? "" : "not ");
@@ -1768,6 +1781,7 @@ static irqreturn_t wcd_mbhc_hs_rem_irq(int irq, void *data)
}
}
}
+exit:
WCD_MBHC_RSC_UNLOCK(mbhc);
pr_debug("%s: leave\n", __func__);
return IRQ_HANDLED;