aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/nm256
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/nm256
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/nm256')
-rw-r--r--sound/pci/nm256/nm256.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index b1bbdb9e3b7b..945d21bf187e 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1390,6 +1390,7 @@ static int nm256_suspend(struct pci_dev *pci, pm_message_t state)
1390 chip->coeffs_current = 0; 1390 chip->coeffs_current = 0;
1391 pci_disable_device(pci); 1391 pci_disable_device(pci);
1392 pci_save_state(pci); 1392 pci_save_state(pci);
1393 pci_set_power_state(pci, pci_choose_state(pci, state));
1393 return 0; 1394 return 0;
1394} 1395}
1395 1396
@@ -1401,8 +1402,17 @@ static int nm256_resume(struct pci_dev *pci)
1401 1402
1402 /* Perform a full reset on the hardware */ 1403 /* Perform a full reset on the hardware */
1403 chip->in_resume = 1; 1404 chip->in_resume = 1;
1405
1406 pci_set_power_state(pci, PCI_D0);
1404 pci_restore_state(pci); 1407 pci_restore_state(pci);
1405 pci_enable_device(pci); 1408 if (pci_enable_device(pci) < 0) {
1409 printk(KERN_ERR "nm256: pci_enable_device failed, "
1410 "disabling device\n");
1411 snd_card_disconnect(card);
1412 return -EIO;
1413 }
1414 pci_set_master(pci);
1415
1406 snd_nm256_init_chip(chip); 1416 snd_nm256_init_chip(chip);
1407 1417
1408 /* restore ac97 */ 1418 /* restore ac97 */