aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.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/maestro3.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/maestro3.c')
-rw-r--r--sound/pci/maestro3.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 05605f474a72..8cab342bbaaf 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2589,12 +2589,9 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2589 chip->suspend_mem[index++] = 2589 chip->suspend_mem[index++] =
2590 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i); 2590 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
2591 2591
2592 /* power down apci registers */
2593 snd_m3_outw(chip, 0xffff, 0x54);
2594 snd_m3_outw(chip, 0xffff, 0x56);
2595
2596 pci_disable_device(pci); 2592 pci_disable_device(pci);
2597 pci_save_state(pci); 2593 pci_save_state(pci);
2594 pci_set_power_state(pci, pci_choose_state(pci, state));
2598 return 0; 2595 return 0;
2599} 2596}
2600 2597
@@ -2607,8 +2604,14 @@ static int m3_resume(struct pci_dev *pci)
2607 if (chip->suspend_mem == NULL) 2604 if (chip->suspend_mem == NULL)
2608 return 0; 2605 return 0;
2609 2606
2607 pci_set_power_state(pci, PCI_D0);
2610 pci_restore_state(pci); 2608 pci_restore_state(pci);
2611 pci_enable_device(pci); 2609 if (pci_enable_device(pci) < 0) {
2610 printk(KERN_ERR "maestor3: pci_enable_device failed, "
2611 "disabling device\n");
2612 snd_card_disconnect(card);
2613 return -EIO;
2614 }
2612 pci_set_master(pci); 2615 pci_set_master(pci);
2613 2616
2614 /* first lets just bring everything back. .*/ 2617 /* first lets just bring everything back. .*/