ASoC: Fix WM8958 default microphone detection argument ordering
Subsystems (3)
PATCH 1/2 ASoC: Fix WM8958 default microphone detection argument ordering
Signed-off-by Mark Brown <[email protected]>
--- sound/soc/codecs/wm8994.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
sound/soc/codecs/wm8994.c +2 -3
@@ -3012,11 +3012,10 @@ static void wm8958_default_micdet(u16 status, void *data) report |=SND_JACK_BTN_5 ; done: -snd_soc_jack_report (wm8994->micdet[0 ].jack, +snd_soc_jack_report (wm8994->micdet[0 ].jack, report,SND_JACK_BTN_0 |SND_JACK_BTN_1 |SND_JACK_BTN_2 |SND_JACK_BTN_3 |SND_JACK_BTN_4 |SND_JACK_BTN_5 | -SND_JACK_MICROPHONE |SND_JACK_VIDEOOUT , - report); +SND_JACK_MICROPHONE |SND_JACK_VIDEOOUT ); }/**
Signature · 1 line
1.7.2.3
PATCH 2/2 ASoC: Simplify default WM8958 jack detection code
The default WM8958 jack detection handler implements a full set of buttons and also support for video detection. Support for multi-button jacks is fairly system specific and will usually require some tuning for headsets so simplify the implementation to only report a simple short to ground button, leaving multi-button headsets to be handled by system specific code.
Signed-off-by Mark Brown <[email protected]>
--- sound/soc/codecs/wm8994.c | 38 ++++---------------------------------- 1 files changed, 4 insertions(+), 34 deletions(-)
sound/soc/codecs/wm8994.c +4 -34
@@ -102,8 +102,6 @@ struct wm8994_priv {wm8958_micdet_cb jack_cb;void *jack_cb_data; -bool jack_is_mic; -bool jack_is_video;int micdet_irq;int revision;
@@ -2976,46 +2974,18 @@ static void wm8958_default_micdet(u16 status, void *data)int report =0 ;/* If nothing present then clear our statuses */ -if (!(status &WM8958_MICD_STS )) { - wm8994->jack_is_video = false; - wm8994->jack_is_mic = false; +if (!(status &WM8958_MICD_STS )) goto done; - } - -/* Assume anything over 475 ohms is a microphone and remember -* that we've seen one (since buttons override it) */ -if (status &0x600 ) - wm8994->jack_is_mic = true; -if (wm8994->jack_is_mic) - report |=SND_JACK_MICROPHONE ; -/* Video has an impedence of approximately 75 ohms; assume -* this isn't used as a button and remember it since buttons -* override it. */ -if (status &0x40 ) - wm8994->jack_is_video = true; -if (wm8994->jack_is_video) - report |=SND_JACK_VIDEOOUT ; + report =SND_JACK_MICROPHONE ;/* Everything else is buttons; just assign slots */ -if (status &0x4 ) +if (status &0x1c0 ) report |=SND_JACK_BTN_0 ; -if (status &0x8 ) - report |=SND_JACK_BTN_1 ; -if (status &0x10 ) - report |=SND_JACK_BTN_2 ; -if (status &0x20 ) - report |=SND_JACK_BTN_3 ; -if (status &0x80 ) - report |=SND_JACK_BTN_4 ; -if (status &0x100 ) - report |=SND_JACK_BTN_5 ; done:snd_soc_jack_report (wm8994->micdet[0 ].jack, report, -SND_JACK_BTN_0 |SND_JACK_BTN_1 |SND_JACK_BTN_2 | -SND_JACK_BTN_3 |SND_JACK_BTN_4 |SND_JACK_BTN_5 | -SND_JACK_MICROPHONE |SND_JACK_VIDEOOUT ); +SND_JACK_BTN_0 |SND_JACK_MICROPHONE ); }/**
Signature · 1 line
1.7.2.3
Quoted 13 lines · Mark Brown
Signed-off-by Mark Brown <[email protected]>--- sound/soc/codecs/wm8994.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)sound/soc/codecs/wm8994.c +0
-0@@ -3012,11 +3012,10 @@ static void wm8958_default_micdet(u16 status, void *data) report |=SND_JACK_BTN_5 ; done:
sound/soc/codecs/wm8994.c static void wm8958_default_micdet(u16 status, void *data) · line 3021
Quoted 10 lines
sound/soc/codecs/wm8994.c +2
-3-snd_soc_jack_report (wm8994->micdet[0 ].jack, +snd_soc_jack_report (wm8994->micdet[0 ].jack, report,SND_JACK_BTN_0 |SND_JACK_BTN_1 |SND_JACK_BTN_2 |SND_JACK_BTN_3 |SND_JACK_BTN_4 |SND_JACK_BTN_5 | -SND_JACK_MICROPHONE |SND_JACK_VIDEOOUT , - report); +SND_JACK_MICROPHONE |SND_JACK_VIDEOOUT ); }/**
both
Acked-by Liam Girdwood <[email protected]>