summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-22 16:37:01 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-22 17:22:56 +0000
commit69266866a5790080d7fe80094b28d670ff8aa765 (patch)
tree87ec1a8956b5192f89c0cea046db694e3a6d37a0
parentf06bce9c8c54354ea4ff96852bd92e10204c8cfb (diff)
downloadlinux-69266866a5790080d7fe80094b28d670ff8aa765.tar.gz
linux-69266866a5790080d7fe80094b28d670ff8aa765.tar.bz2
linux-69266866a5790080d7fe80094b28d670ff8aa765.zip
ASoC: Allow WM8903 mic detect disable and don't force bias on
Don't force enable the microphone bias on WM8903 when doing jack detection, and don't force enable microphone bias. This allows platforms to only enable microphone detection when a jack has been inserted. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--sound/soc/codecs/wm8903.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index b5427b47d6fd..134b17532f23 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1465,7 +1465,7 @@ int wm8903_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
int det, int shrt)
{
struct wm8903_priv *wm8903 = codec->private_data;
- int irq_mask = 0;
+ int irq_mask = WM8903_MICDET_EINT | WM8903_MICSHRT_EINT;
dev_dbg(codec->dev, "Enabling microphone detection: %x %x\n",
det, shrt);
@@ -1485,16 +1485,17 @@ int wm8903_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
WM8903_MICDET_EINT | WM8903_MICSHRT_EINT,
irq_mask);
- /* Enable mic detection, this may not have been set through
- * platform data (eg, if the defaults are OK). */
- snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
- WM8903_WSEQ_ENA, WM8903_WSEQ_ENA);
- snd_soc_update_bits(codec, WM8903_MIC_BIAS_CONTROL_0,
- WM8903_MICDET_ENA, WM8903_MICDET_ENA);
-
- /* Force the microphone bias on; this will trigger an initial
- * detection. */
- snd_soc_dapm_force_enable_pin(codec, "Mic Bias");
+ if (det && shrt) {
+ /* Enable mic detection, this may not have been set through
+ * platform data (eg, if the defaults are OK). */
+ snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
+ WM8903_WSEQ_ENA, WM8903_WSEQ_ENA);
+ snd_soc_update_bits(codec, WM8903_MIC_BIAS_CONTROL_0,
+ WM8903_MICDET_ENA, WM8903_MICDET_ENA);
+ } else {
+ snd_soc_update_bits(codec, WM8903_MIC_BIAS_CONTROL_0,
+ WM8903_MICDET_ENA, 0);
+ }
return 0;
}