diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-22 12:37:01 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-22 13:22:56 -0400 |
commit | 69266866a5790080d7fe80094b28d670ff8aa765 (patch) | |
tree | 87ec1a8956b5192f89c0cea046db694e3a6d37a0 /sound/soc/codecs/wm8903.c | |
parent | f06bce9c8c54354ea4ff96852bd92e10204c8cfb (diff) |
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>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r-- | sound/soc/codecs/wm8903.c | 23 |
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, | |||
1465 | int det, int shrt) | 1465 | int det, int shrt) |
1466 | { | 1466 | { |
1467 | struct wm8903_priv *wm8903 = codec->private_data; | 1467 | struct wm8903_priv *wm8903 = codec->private_data; |
1468 | int irq_mask = 0; | 1468 | int irq_mask = WM8903_MICDET_EINT | WM8903_MICSHRT_EINT; |
1469 | 1469 | ||
1470 | dev_dbg(codec->dev, "Enabling microphone detection: %x %x\n", | 1470 | dev_dbg(codec->dev, "Enabling microphone detection: %x %x\n", |
1471 | det, shrt); | 1471 | det, shrt); |
@@ -1485,16 +1485,17 @@ int wm8903_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
1485 | WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, | 1485 | WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, |
1486 | irq_mask); | 1486 | irq_mask); |
1487 | 1487 | ||
1488 | /* Enable mic detection, this may not have been set through | 1488 | if (det && shrt) { |
1489 | * platform data (eg, if the defaults are OK). */ | 1489 | /* Enable mic detection, this may not have been set through |
1490 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, | 1490 | * platform data (eg, if the defaults are OK). */ |
1491 | WM8903_WSEQ_ENA, WM8903_WSEQ_ENA); | 1491 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, |
1492 | snd_soc_update_bits(codec, WM8903_MIC_BIAS_CONTROL_0, | 1492 | WM8903_WSEQ_ENA, WM8903_WSEQ_ENA); |
1493 | WM8903_MICDET_ENA, WM8903_MICDET_ENA); | 1493 | snd_soc_update_bits(codec, WM8903_MIC_BIAS_CONTROL_0, |
1494 | 1494 | WM8903_MICDET_ENA, WM8903_MICDET_ENA); | |
1495 | /* Force the microphone bias on; this will trigger an initial | 1495 | } else { |
1496 | * detection. */ | 1496 | snd_soc_update_bits(codec, WM8903_MIC_BIAS_CONTROL_0, |
1497 | snd_soc_dapm_force_enable_pin(codec, "Mic Bias"); | 1497 | WM8903_MICDET_ENA, 0); |
1498 | } | ||
1498 | 1499 | ||
1499 | return 0; | 1500 | return 0; |
1500 | } | 1501 | } |