summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeleswarapu Nagaradhesh <nagaradh@codeaurora.org>2016-03-23 12:10:37 +0530
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-06 12:06:18 -0700
commitc4ab23b3121d441e4eba746491cb853aaa54540b (patch)
tree27e852edad322c52fa01c854f97bdd8730f65183
parentc72b107db637e57af6e8f3cfc6b8f3b614d3101e (diff)
ASoC: wcd-mbhc: correct headphone detection
Characteristics of 3pole extn cable is, MIC is grounded and HPHL and HPHR are floating. In current SW, if there is GND_MIC SWAP with button press cable is reported as unsupported. Hence report cable as headset if there is GND_MIC SWAP with button press. CRs-Fixed: 963833 Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org> Change-Id: Ie6b467292661358699fcab6263653139cda87c33
-rw-r--r--sound/soc/codecs/wcd-mbhc-v2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index af6eee12d05a..85c48b38e3db 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -1355,6 +1355,11 @@ report:
pr_debug("%s: Switch level is low\n", __func__);
goto exit;
}
+ if (plug_type == MBHC_PLUG_TYPE_GND_MIC_SWAP && mbhc->btn_press_intr) {
+ pr_debug("%s: insertion of headphone with swap\n", __func__);
+ wcd_cancel_btn_work(mbhc);
+ plug_type = MBHC_PLUG_TYPE_HEADPHONE;
+ }
pr_debug("%s: Valid plug found, plug type %d wrk_cmpt %d btn_intr %d\n",
__func__, plug_type, wrk_complete,
mbhc->btn_press_intr);