From: Mark Brown Date: Mon, 6 Feb 2012 12:07:08 +0000 (+0000) Subject: ASoC: wm8994: Enabling VMID should take a runtime PM reference X-Git-Tag: v3.2.6~28 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e9ee45b83b21448a8e27309456430890b5fa1ff2;p=karo-tx-linux.git ASoC: wm8994: Enabling VMID should take a runtime PM reference commit db966f8abb9ba74f7d5a7230f51572f52c31c4e5 upstream. We can enable VMID independently of the bias in some use cases so we need to ensure that the core device is powered up. Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index d0c545b73d78..a3d6bd8099ce 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -729,6 +729,8 @@ static void vmid_reference(struct snd_soc_codec *codec) { struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); + pm_runtime_get_sync(codec->dev); + wm8994->vmid_refcount++; dev_dbg(codec->dev, "Referencing VMID, refcount is now %d\n", @@ -796,6 +798,8 @@ static void vmid_dereference(struct snd_soc_codec *codec) WM8994_VMID_BUF_ENA | WM8994_VMID_RAMP_MASK, 0); } + + pm_runtime_put(codec->dev); } static int vmid_event(struct snd_soc_dapm_widget *w,