[alsa-devel] [PATCH 5/7] ASoC: Enable SYSCLK last when enabling WM8962 mic detection

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Nov 1 19:40:40 CET 2011


Ensure everything is set up before we start detecting.

Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm8962.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 7f0e6dff..e3ca7b1 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3672,8 +3672,6 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack)
 	if (jack) {
 		irq_mask = 0;
 		enable = WM8962_MICDET_ENA;
-
-		snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK");
 	} else {
 		irq_mask = WM8962_MICD_EINT | WM8962_MICSCD_EINT;
 		enable = 0;
@@ -3688,6 +3686,9 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack)
 	snd_soc_jack_report(wm8962->jack, 0,
 			    SND_JACK_MICROPHONE | SND_JACK_BTN_0);
 
+	if (jack)
+		snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK");
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(wm8962_mic_detect);
-- 
1.7.7.1



More information about the Alsa-devel mailing list