aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/trident
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/trident
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/trident')
-rw-r--r--sound/pci/trident/trident_main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 0d478871808d..1fbc4321122f 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3966,15 +3966,9 @@ int snd_trident_suspend(struct pci_dev *pci, pm_message_t state)
3966 snd_ac97_suspend(trident->ac97); 3966 snd_ac97_suspend(trident->ac97);
3967 snd_ac97_suspend(trident->ac97_sec); 3967 snd_ac97_suspend(trident->ac97_sec);
3968 3968
3969 switch (trident->device) {
3970 case TRIDENT_DEVICE_ID_DX:
3971 case TRIDENT_DEVICE_ID_NX:
3972 break; /* TODO */
3973 case TRIDENT_DEVICE_ID_SI7018:
3974 break;
3975 }
3976 pci_disable_device(pci); 3969 pci_disable_device(pci);
3977 pci_save_state(pci); 3970 pci_save_state(pci);
3971 pci_set_power_state(pci, pci_choose_state(pci, state));
3978 return 0; 3972 return 0;
3979} 3973}
3980 3974
@@ -3983,9 +3977,15 @@ int snd_trident_resume(struct pci_dev *pci)
3983 struct snd_card *card = pci_get_drvdata(pci); 3977 struct snd_card *card = pci_get_drvdata(pci);
3984 struct snd_trident *trident = card->private_data; 3978 struct snd_trident *trident = card->private_data;
3985 3979
3980 pci_set_power_state(pci, PCI_D0);
3986 pci_restore_state(pci); 3981 pci_restore_state(pci);
3987 pci_enable_device(pci); 3982 if (pci_enable_device(pci) < 0) {
3988 pci_set_master(pci); /* to be sure */ 3983 printk(KERN_ERR "trident: pci_enable_device failed, "
3984 "disabling device\n");
3985 snd_card_disconnect(card);
3986 return -EIO;
3987 }
3988 pci_set_master(pci);
3989 3989
3990 switch (trident->device) { 3990 switch (trident->device) {
3991 case TRIDENT_DEVICE_ID_DX: 3991 case TRIDENT_DEVICE_ID_DX: