ASoC: Ensure SYSCLK is enabled for WM8958 accessory detection
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 29 Nov 2011 14:36:17 +0000 (14:36 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 29 Nov 2011 17:23:29 +0000 (17:23 +0000)
Ensure SYSCLK is enabled while running accessory detection on WM8958.
It is always required so there is no sense in requiring machine drivers
to individually do this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8994.c

index 5ea0c3c15254c24bc10e804b4848262183e541ee..0a16de743dd8dff9c8e095f50936bbe165d48589 100644 (file)
@@ -3016,6 +3016,8 @@ int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
                        cb_data = codec;
                }
 
+               snd_soc_dapm_force_enable_pin(&codec->dapm, "CLK_SYS");
+
                wm8994->micdet[0].jack = jack;
                wm8994->jack_cb = cb;
                wm8994->jack_cb_data = cb_data;
@@ -3025,6 +3027,7 @@ int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
        } else {
                snd_soc_update_bits(codec, WM8958_MIC_DETECT_1,
                                    WM8958_MICD_ENA, 0);
+               snd_soc_dapm_disable_pin(&codec->dapm, "CLK_SYS");
        }
 
        return 0;