diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2014-03-30 23:37:31 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-03-31 12:26:57 +0200 |
commit | 8c1d843460f42417d6b9553147a1a04ca1470602 (patch) | |
tree | be6c79efd71bc1f4a67e82512021b49ff91aa026 /sound/pci/ice1712/delta.c | |
parent | ca051e8a678b22f507a9e10fa536e1d9337d8b0d (diff) | |
download | op-kernel-dev-8c1d843460f42417d6b9553147a1a04ca1470602.zip op-kernel-dev-8c1d843460f42417d6b9553147a1a04ca1470602.tar.gz |
ALSA: ice1712: Add suspend support for M-Audio ICE1712-based cards
Add suspend support for M-Audio cards based on ICE1712 chip.
Tested with M-Audio Audiophile 24/96. S/PDIF will probably not work.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712/delta.c')
-rw-r--r-- | sound/pci/ice1712/delta.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index 98e5e95..ed2144e 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c @@ -576,6 +576,30 @@ static struct snd_ak4xxx_private akm_vx442_priv = { .mask_flags = 0, }; +#ifdef CONFIG_PM_SLEEP +static int snd_ice1712_delta_resume(struct snd_ice1712 *ice) +{ + unsigned char akm_backup[AK4XXX_IMAGE_SIZE]; + /* init codec and restore registers */ + if (ice->akm_codecs) { + memcpy(akm_backup, ice->akm->images, sizeof(akm_backup)); + snd_akm4xxx_init(ice->akm); + memcpy(ice->akm->images, akm_backup, sizeof(akm_backup)); + snd_akm4xxx_reset(ice->akm, 0); + } + + return 0; +} + +static int snd_ice1712_delta_suspend(struct snd_ice1712 *ice) +{ + if (ice->akm_codecs) /* reset & mute codec */ + snd_akm4xxx_reset(ice->akm, 1); + + return 0; +} +#endif + static int snd_ice1712_delta_init(struct snd_ice1712 *ice) { int err; @@ -622,7 +646,11 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice) ice->num_total_adcs = 4; break; } - +#ifdef CONFIG_PM_SLEEP + ice->pm_resume = snd_ice1712_delta_resume; + ice->pm_suspend = snd_ice1712_delta_suspend; + ice->pm_suspend_enabled = 1; +#endif /* initialize the SPI clock to high */ tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); tmp |= ICE1712_DELTA_AP_CCLK; |