aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/delta.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/delta.c')
-rw-r--r--sound/pci/ice1712/delta.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index 9e28cc12969b..ed2144eee38a 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -425,7 +425,8 @@ static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kco
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (snd_i2c_sendbytes(ice->cs8427, &reg, 1) != 1)
- snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg);
+ dev_err(ice->card->dev,
+ "unable to send register 0x%x byte to CS8427\n", reg);
snd_i2c_readbytes(ice->cs8427, &reg, 1);
ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0;
return 0;
@@ -575,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;
@@ -621,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;
@@ -637,7 +666,7 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice)
case ICE1712_SUBDEVICE_VX442:
case ICE1712_SUBDEVICE_DELTA66E:
if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) {
- snd_printk(KERN_ERR "unable to create I2C bus\n");
+ dev_err(ice->card->dev, "unable to create I2C bus\n");
return err;
}
ice->i2c->private_data = ice;