]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: ASoC: AC97 codec PM
authorManuel Lauss <mano@roarinelk.homelinux.net>
Thu, 3 Jul 2008 07:33:10 +0000 (09:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 10 Jul 2008 07:32:20 +0000 (09:32 +0200)
Simple suspend/resume for AC97 ASoC codec.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Acked-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/codecs/ac97.c

index 300d007f2339feef14fe0b3543003fe63aec42c9..e4516f3ce64c922e0d5866a78b0183289910cb25 100644 (file)
@@ -144,9 +144,34 @@ static int ac97_soc_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_PM
+static int ac97_soc_suspend(struct platform_device *pdev, pm_message_t msg)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+
+       snd_ac97_suspend(socdev->codec->ac97);
+
+       return 0;
+}
+
+static int ac97_soc_resume(struct platform_device *pdev)
+{
+       struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+
+       snd_ac97_resume(socdev->codec->ac97);
+
+       return 0;
+}
+#else
+#define ac97_soc_suspend NULL
+#define ac97_soc_resume NULL
+#endif
+
 struct snd_soc_codec_device soc_codec_dev_ac97 = {
        .probe =        ac97_soc_probe,
        .remove =       ac97_soc_remove,
+       .suspend =      ac97_soc_suspend,
+       .resume =       ac97_soc_resume,
 };
 EXPORT_SYMBOL_GPL(soc_codec_dev_ac97);