summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-01 20:46:34 +0100
committerMark Brown <broonie@linaro.org>2013-07-15 11:12:57 +0100
commit57e265c8d71fb94c130bfb31f589cc9e97fb3928 (patch)
treed05e19ca43294acf35bd612ad068dbf8d7979976 /sound/soc/codecs/wm8994.c
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
downloadop-kernel-dev-57e265c8d71fb94c130bfb31f589cc9e97fb3928.zip
op-kernel-dev-57e265c8d71fb94c130bfb31f589cc9e97fb3928.tar.gz
ASoC: wm8994: Move runtime PM init to platform device init
As well as being better style this allows the device to idle when there is no audio card instantaited which is probably what we want. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r--sound/soc/codecs/wm8994.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 1d4b1ec..02c320f 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -4014,9 +4014,6 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
wm8994->micdet_irq = control->pdata.micdet_irq;
- pm_runtime_enable(codec->dev);
- pm_runtime_idle(codec->dev);
-
/* By default use idle_bias_off, will override for WM8994 */
codec->dapm.idle_bias_off = 1;
@@ -4389,8 +4386,6 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec)
wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF);
- pm_runtime_disable(codec->dev);
-
for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++)
wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i,
&wm8994->fll_locked[i]);
@@ -4449,6 +4444,9 @@ static int wm8994_probe(struct platform_device *pdev)
wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent);
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_idle(&pdev->dev);
+
return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8994,
wm8994_dai, ARRAY_SIZE(wm8994_dai));
}
@@ -4456,6 +4454,8 @@ static int wm8994_probe(struct platform_device *pdev)
static int wm8994_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+
return 0;
}
OpenPOWER on IntegriCloud