From 07ceb38173c00cc36d74500ed1742a8daf2d66a0 Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Fri, 26 Feb 2016 17:56:43 -0800 Subject: [PATCH] ASoC: wcd-mbhc: Avoid fake headset report during headphone remove When headphone is removed while 3 second polling is still in progress, mbhc hs comparator result will be read as "0" and this causes reporting a fake headset insert event to user-space followed by headphone removal. Avoid sending this fake headset insert event to user-space by checking for the microphone clamp bit from codec mbhc hardware. CRs-fixed: 941089 Change-Id: I96d96dca92a6c99bbb25ab70a2706e730c28818b Signed-off-by: Phani Kumar Uppalapati --- sound/soc/codecs/wcd-mbhc-v2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index e04b12b698ce..33cce5ee17cc 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -1311,6 +1311,7 @@ correct_plug_type: MBHC_PLUG_TYPE_HEADSET) && (mbhc->current_plug != MBHC_PLUG_TYPE_ANC_HEADPHONE)) && + !wcd_swch_level_remove(mbhc) && !mbhc->btn_press_intr) { pr_debug("%s: cable is %sheadset\n", __func__,