Commit 28aa165c authored by Takashi Iwai's avatar Takashi Iwai

ALSA: ymfpci - Fix legacy registers on S3/S4 resume

We need to resume two legacy registers to recover MIDI/FM functionality
on S3/S4 resume, too.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bd483d4c
...@@ -366,6 +366,8 @@ struct snd_ymfpci { ...@@ -366,6 +366,8 @@ struct snd_ymfpci {
#ifdef CONFIG_PM #ifdef CONFIG_PM
u32 *saved_regs; u32 *saved_regs;
u32 saved_ydsxgr_mode; u32 saved_ydsxgr_mode;
u16 saved_dsxg_legacy;
u16 saved_dsxg_elegacy;
#endif #endif
}; };
......
...@@ -2310,6 +2310,10 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state) ...@@ -2310,6 +2310,10 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++)
chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]); chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]);
chip->saved_ydsxgr_mode = snd_ymfpci_readl(chip, YDSXGR_MODE); chip->saved_ydsxgr_mode = snd_ymfpci_readl(chip, YDSXGR_MODE);
pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY,
&chip->saved_dsxg_legacy);
pci_read_config_word(chip->pci, PCIR_DSXG_ELEGACY,
&chip->saved_dsxg_elegacy);
snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0);
snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0);
snd_ymfpci_disable_dsp(chip); snd_ymfpci_disable_dsp(chip);
...@@ -2344,6 +2348,11 @@ int snd_ymfpci_resume(struct pci_dev *pci) ...@@ -2344,6 +2348,11 @@ int snd_ymfpci_resume(struct pci_dev *pci)
snd_ac97_resume(chip->ac97); snd_ac97_resume(chip->ac97);
pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY,
chip->saved_dsxg_legacy);
pci_write_config_word(chip->pci, PCIR_DSXG_ELEGACY,
chip->saved_dsxg_elegacy);
/* start hw again */ /* start hw again */
if (chip->start_count > 0) { if (chip->start_count > 0) {
spin_lock_irq(&chip->reg_lock); spin_lock_irq(&chip->reg_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment