diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-21 16:23:35 +0000 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-04-30 11:03:51 +0200 |
commit | 8cc4f6d8498b45d6de4cf2e106299a81364de315 (patch) | |
tree | 99faf0ac139bb039cd619459495063943e6f3275 /sound | |
parent | e8ffd9f962ecc6b7dde9e0cd1e438ac35b183347 (diff) | |
download | kernel_samsung_espresso10-8cc4f6d8498b45d6de4cf2e106299a81364de315.zip kernel_samsung_espresso10-8cc4f6d8498b45d6de4cf2e106299a81364de315.tar.gz kernel_samsung_espresso10-8cc4f6d8498b45d6de4cf2e106299a81364de315.tar.bz2 |
ASoC: wm8994: Support external capacitors on MICBIAS2 with jack detection
When an external capacitor is connected to MICBIAS2 on devices with
jack detection (which is not required but may be done in some systems)
then the loading may mean that better performance is obtained when
the microphone bias is enabled normally rather than using the low power
mode. Provide platform data allowing systems to indicate if they require
this.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 4dc815c..bbf0fa7 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3194,6 +3194,14 @@ static void wm8958_default_micdet(u16 status, void *data) wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_JACK); + + if (wm8994->pdata->jd_ext_cap) { + mutex_lock(&codec->mutex); + snd_soc_dapm_disable_pin(&codec->dapm, + "MICBIAS2"); + snd_soc_dapm_sync(&codec->dapm); + mutex_unlock(&codec->mutex); + } } } @@ -3249,6 +3257,15 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) snd_soc_update_bits(codec, WM8958_MICBIAS2, WM8958_MICB2_DISCH, 0); + /* If required for an external cap force MICBIAS on */ + if (wm8994->pdata->jd_ext_cap) { + mutex_lock(&codec->mutex); + snd_soc_dapm_force_enable_pin(&codec->dapm, + "MICBIAS2"); + snd_soc_dapm_sync(&codec->dapm); + mutex_unlock(&codec->mutex); + } + /* * Start off measument of microphone impedence to find * out what's actually there. @@ -3263,6 +3280,13 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) snd_soc_update_bits(codec, WM8958_MICBIAS2, WM8958_MICB2_DISCH, WM8958_MICB2_DISCH); + if (wm8994->pdata->jd_ext_cap) { + mutex_lock(&codec->mutex); + snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS2"); + snd_soc_dapm_sync(&codec->dapm); + mutex_unlock(&codec->mutex); + } + snd_soc_jack_report(wm8994->micdet[0].jack, 0, SND_JACK_MECHANICAL | SND_JACK_HEADSET | wm8994->btn_mask); |