From: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date: Thu, 26 Jan 2012 18:33:24 +0000 (+0000)
Subject: ASoC: wm8994: Report any low impedance accessory as a headphone
X-Git-Tag: firefly_0821_release~3680^2~2691^2~52^2~25^2~191
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7c08b51f2fbb76b768d78ca6b0e13155d2c1e811;p=firefly-linux-kernel-4.4.55.git

ASoC: wm8994: Report any low impedance accessory as a headphone

Report any accessory with a low impedance as a headphone, previously
anything other than a short or microphone would not be reported at all.
The most likely reason is a microphone with incorrect polarity.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index b047bfada709..11ca19b72d7d 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3089,7 +3089,7 @@ static void wm8958_default_micdet(u16 status, void *data)
 	}
 
 
-	if (wm8994->mic_detecting && status & 0x4) {
+	if (wm8994->mic_detecting && status & 0xfc) {
 		dev_dbg(codec->dev, "Detected headphone\n");
 		wm8994->mic_detecting = false;