aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2014-03-30 17:37:31 -0400
committerTakashi Iwai <tiwai@suse.de>2014-03-31 06:26:57 -0400
commit8c1d843460f42417d6b9553147a1a04ca1470602 (patch)
treebe6c79efd71bc1f4a67e82512021b49ff91aa026 /sound/pci/ice1712
parentca051e8a678b22f507a9e10fa536e1d9337d8b0d (diff)
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')
-rw-r--r--sound/pci/ice1712/delta.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index 98e5e955261e..ed2144eee38a 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 = {
576 .mask_flags = 0, 576 .mask_flags = 0,
577}; 577};
578 578
579#ifdef CONFIG_PM_SLEEP
580static int snd_ice1712_delta_resume(struct snd_ice1712 *ice)
581{
582 unsigned char akm_backup[AK4XXX_IMAGE_SIZE];
583 /* init codec and restore registers */
584 if (ice->akm_codecs) {
585 memcpy(akm_backup, ice->akm->images, sizeof(akm_backup));
586 snd_akm4xxx_init(ice->akm);
587 memcpy(ice->akm->images, akm_backup, sizeof(akm_backup));
588 snd_akm4xxx_reset(ice->akm, 0);
589 }
590
591 return 0;
592}
593
594static int snd_ice1712_delta_suspend(struct snd_ice1712 *ice)
595{
596 if (ice->akm_codecs) /* reset & mute codec */
597 snd_akm4xxx_reset(ice->akm, 1);
598
599 return 0;
600}
601#endif
602
579static int snd_ice1712_delta_init(struct snd_ice1712 *ice) 603static int snd_ice1712_delta_init(struct snd_ice1712 *ice)
580{ 604{
581 int err; 605 int err;
@@ -622,7 +646,11 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice)
622 ice->num_total_adcs = 4; 646 ice->num_total_adcs = 4;
623 break; 647 break;
624 } 648 }
625 649#ifdef CONFIG_PM_SLEEP
650 ice->pm_resume = snd_ice1712_delta_resume;
651 ice->pm_suspend = snd_ice1712_delta_suspend;
652 ice->pm_suspend_enabled = 1;
653#endif
626 /* initialize the SPI clock to high */ 654 /* initialize the SPI clock to high */
627 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); 655 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
628 tmp |= ICE1712_DELTA_AP_CCLK; 656 tmp |= ICE1712_DELTA_AP_CCLK;