summaryrefslogtreecommitdiff
path: root/sound/isa/ad1816a/ad1816a.c
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2012-08-20 01:27:26 +0400
committerTakashi Iwai <tiwai@suse.de>2012-08-20 13:12:56 +0400
commit6f0fa66051e92f361bd293432466f5e62832adbf (patch)
tree1eefb8c91a9d9551d0bb7e694ac9d0231de0e958 /sound/isa/ad1816a/ad1816a.c
parentc86b6b452a6b2a80a2c9ffa3c8f7d80eea0fa196 (diff)
downloadlinux-6f0fa66051e92f361bd293432466f5e62832adbf.tar.xz
ALSA: snd-ad1816a: Implement suspend/resume
Implement suspend/resume support for AD1816 chips. Tested with Terratec SoundSystem Base-1. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/ad1816a/ad1816a.c')
-rw-r--r--sound/isa/ad1816a/ad1816a.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 1a374e61ab2b..2c2f829c3fd7 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -244,13 +244,37 @@ static void __devexit snd_ad1816a_pnp_remove(struct pnp_card_link * pcard)
pnp_set_card_drvdata(pcard, NULL);
}
+#ifdef CONFIG_PM
+static int snd_ad1816a_pnp_suspend(struct pnp_card_link *pcard,
+ pm_message_t state)
+{
+ struct snd_card *card = pnp_get_card_drvdata(pcard);
+
+ snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+ snd_ad1816a_suspend(card->private_data);
+ return 0;
+}
+
+static int snd_ad1816a_pnp_resume(struct pnp_card_link *pcard)
+{
+ struct snd_card *card = pnp_get_card_drvdata(pcard);
+
+ snd_ad1816a_resume(card->private_data);
+ snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+ return 0;
+}
+#endif
+
static struct pnp_card_driver ad1816a_pnpc_driver = {
.flags = PNP_DRIVER_RES_DISABLE,
.name = "ad1816a",
.id_table = snd_ad1816a_pnpids,
.probe = snd_ad1816a_pnp_detect,
.remove = __devexit_p(snd_ad1816a_pnp_remove),
- /* FIXME: suspend/resume */
+#ifdef CONFIG_PM
+ .suspend = snd_ad1816a_pnp_suspend,
+ .resume = snd_ad1816a_pnp_resume,
+#endif
};
static int __init alsa_card_ad1816a_init(void)