From: Ondrej Zary Date: Thu, 3 Apr 2014 21:09:37 +0000 (+0200) Subject: ALSA: ice1712: restore AK4xxx volumes on resume X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=6e61246f5aeaede80e7a00e8b1de7ae07b1315e7;p=openwrt%2Fstaging%2Fblogic.git ALSA: ice1712: restore AK4xxx volumes on resume Also restore AK4xxx mixer volumes on resume for M-Audio ICE1712-based cards. This fixes incorrect (sound working) zero mixer volumes after resume. Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index b3eed8d6bfc5..496dbd0ad5db 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c @@ -579,7 +579,8 @@ static struct snd_ak4xxx_private akm_vx442_priv = { #ifdef CONFIG_PM_SLEEP static int snd_ice1712_delta_resume(struct snd_ice1712 *ice) { - unsigned char akm_backup[AK4XXX_IMAGE_SIZE]; + unsigned char akm_img_bak[AK4XXX_IMAGE_SIZE]; + unsigned char akm_vol_bak[AK4XXX_IMAGE_SIZE]; /* init spdif */ switch (ice->eeprom.subvendor) { @@ -604,9 +605,11 @@ static int snd_ice1712_delta_resume(struct snd_ice1712 *ice) /* init codec and restore registers */ if (ice->akm_codecs) { - memcpy(akm_backup, ice->akm->images, sizeof(akm_backup)); + memcpy(akm_img_bak, ice->akm->images, sizeof(akm_img_bak)); + memcpy(akm_vol_bak, ice->akm->volumes, sizeof(akm_vol_bak)); snd_akm4xxx_init(ice->akm); - memcpy(ice->akm->images, akm_backup, sizeof(akm_backup)); + memcpy(ice->akm->images, akm_img_bak, sizeof(akm_img_bak)); + memcpy(ice->akm->volumes, akm_vol_bak, sizeof(akm_vol_bak)); snd_akm4xxx_reset(ice->akm, 0); }