aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;