aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/via82xx.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-10-11 12:52:53 -0400
committerJaroslav Kysela <perex@suse.cz>2006-10-22 04:51:10 -0400
commit30b35399ceb2398d05837863476dcb12f12f3a82 (patch)
tree14a7cfad1c5d28d207bb1be8addb86ead33f7b63 /sound/pci/via82xx.c
parentc06134d73cdc02bb8ab1fad180f6da1f28d2e049 (diff)
[ALSA] Various fixes for suspend/resume of ALSA PCI drivers
- Check the return value of pci_enable_device() and request_irq() in the suspend. If any error occurs there, disable the device using snd_card_disconnect(). - Call pci_set_power_state() properly with pci_choose_state(). - Fix the order to call pci_set_power_state(). - Removed obsolete house-made PM codes in some drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/via82xx.c')
-rw-r--r--sound/pci/via82xx.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index e6990e0bbf23..92b0736c0fdb 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -2185,9 +2185,9 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state)
2185 chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); 2185 chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10);
2186 } 2186 }
2187 2187
2188 pci_set_power_state(pci, PCI_D3hot);
2189 pci_disable_device(pci); 2188 pci_disable_device(pci);
2190 pci_save_state(pci); 2189 pci_save_state(pci);
2190 pci_set_power_state(pci, pci_choose_state(pci, state));
2191 return 0; 2191 return 0;
2192} 2192}
2193 2193
@@ -2197,9 +2197,15 @@ static int snd_via82xx_resume(struct pci_dev *pci)
2197 struct via82xx *chip = card->private_data; 2197 struct via82xx *chip = card->private_data;
2198 int i; 2198 int i;
2199 2199
2200 pci_restore_state(pci);
2201 pci_enable_device(pci);
2202 pci_set_power_state(pci, PCI_D0); 2200 pci_set_power_state(pci, PCI_D0);
2201 pci_restore_state(pci);
2202 if (pci_enable_device(pci) < 0) {
2203 printk(KERN_ERR "via82xx: pci_enable_device failed, "
2204 "disabling device\n");
2205 snd_card_disconnect(card);
2206 return -EIO;
2207 }
2208 pci_set_master(pci);
2203 2209
2204 snd_via82xx_chip_init(chip); 2210 snd_via82xx_chip_init(chip);
2205 2211