diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-03-13 03:07:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-03-13 03:12:33 -0400 |
commit | 28aa165cc52fa686a55a2a2052fdddad0fbde5eb (patch) | |
tree | a445f5a0f8ad0915aece24b36c957d100f5cd77c | |
parent | bd483d4c6c65c1c48483f2f81c603d42b39ce83b (diff) |
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: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | include/sound/ymfpci.h | 2 | ||||
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index 444cd6ba0ba7..41199664666b 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h | |||
@@ -366,6 +366,8 @@ struct snd_ymfpci { | |||
366 | #ifdef CONFIG_PM | 366 | #ifdef CONFIG_PM |
367 | u32 *saved_regs; | 367 | u32 *saved_regs; |
368 | u32 saved_ydsxgr_mode; | 368 | u32 saved_ydsxgr_mode; |
369 | u16 saved_dsxg_legacy; | ||
370 | u16 saved_dsxg_elegacy; | ||
369 | #endif | 371 | #endif |
370 | }; | 372 | }; |
371 | 373 | ||
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 03ee4e365311..a3a2eababc01 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -2310,6 +2310,10 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state) | |||
2310 | for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) | 2310 | for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++) |
2311 | chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]); | 2311 | chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]); |
2312 | chip->saved_ydsxgr_mode = snd_ymfpci_readl(chip, YDSXGR_MODE); | 2312 | chip->saved_ydsxgr_mode = snd_ymfpci_readl(chip, YDSXGR_MODE); |
2313 | pci_read_config_word(chip->pci, PCIR_DSXG_LEGACY, | ||
2314 | &chip->saved_dsxg_legacy); | ||
2315 | pci_read_config_word(chip->pci, PCIR_DSXG_ELEGACY, | ||
2316 | &chip->saved_dsxg_elegacy); | ||
2313 | snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); | 2317 | snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); |
2314 | snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); | 2318 | snd_ymfpci_writel(chip, YDSXGR_BUF441OUTVOL, 0); |
2315 | snd_ymfpci_disable_dsp(chip); | 2319 | snd_ymfpci_disable_dsp(chip); |
@@ -2344,6 +2348,11 @@ int snd_ymfpci_resume(struct pci_dev *pci) | |||
2344 | 2348 | ||
2345 | snd_ac97_resume(chip->ac97); | 2349 | snd_ac97_resume(chip->ac97); |
2346 | 2350 | ||
2351 | pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY, | ||
2352 | chip->saved_dsxg_legacy); | ||
2353 | pci_write_config_word(chip->pci, PCIR_DSXG_ELEGACY, | ||
2354 | chip->saved_dsxg_elegacy); | ||
2355 | |||
2347 | /* start hw again */ | 2356 | /* start hw again */ |
2348 | if (chip->start_count > 0) { | 2357 | if (chip->start_count > 0) { |
2349 | spin_lock_irq(&chip->reg_lock); | 2358 | spin_lock_irq(&chip->reg_lock); |