From: Manuel Lauss Date: Thu, 3 Jul 2008 07:33:10 +0000 (+0200) Subject: ALSA: ASoC: AC97 codec PM X-Git-Tag: v2.6.27-rc1~1111^2~40 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3f775987030cf7ff922765c18ddd0d311b4b46ef;p=linux-2.6-omap-h63xx.git ALSA: ASoC: AC97 codec PM Simple suspend/resume for AC97 ASoC codec. Signed-off-by: Manuel Lauss Acked-by: Liam Girdwood Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 300d007f233..e4516f3ce64 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -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);