aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/als4000.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/als4000.c')
-rw-r--r--sound/pci/als4000.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 7d7f2598c748..0eeca49c5754 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -988,9 +988,10 @@ static void __devexit snd_card_als4000_remove(struct pci_dev *pci)
988} 988}
989 989
990#ifdef CONFIG_PM 990#ifdef CONFIG_PM
991static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state) 991static int snd_als4000_suspend(struct device *dev)
992{ 992{
993 struct snd_card *card = pci_get_drvdata(pci); 993 struct pci_dev *pci = to_pci_dev(dev);
994 struct snd_card *card = dev_get_drvdata(dev);
994 struct snd_card_als4000 *acard = card->private_data; 995 struct snd_card_als4000 *acard = card->private_data;
995 struct snd_sb *chip = acard->chip; 996 struct snd_sb *chip = acard->chip;
996 997
@@ -1001,13 +1002,14 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
1001 1002
1002 pci_disable_device(pci); 1003 pci_disable_device(pci);
1003 pci_save_state(pci); 1004 pci_save_state(pci);
1004 pci_set_power_state(pci, pci_choose_state(pci, state)); 1005 pci_set_power_state(pci, PCI_D3hot);
1005 return 0; 1006 return 0;
1006} 1007}
1007 1008
1008static int snd_als4000_resume(struct pci_dev *pci) 1009static int snd_als4000_resume(struct device *dev)
1009{ 1010{
1010 struct snd_card *card = pci_get_drvdata(pci); 1011 struct pci_dev *pci = to_pci_dev(dev);
1012 struct snd_card *card = dev_get_drvdata(dev);
1011 struct snd_card_als4000 *acard = card->private_data; 1013 struct snd_card_als4000 *acard = card->private_data;
1012 struct snd_sb *chip = acard->chip; 1014 struct snd_sb *chip = acard->chip;
1013 1015
@@ -1033,18 +1035,21 @@ static int snd_als4000_resume(struct pci_dev *pci)
1033 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 1035 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
1034 return 0; 1036 return 0;
1035} 1037}
1036#endif /* CONFIG_PM */
1037 1038
1039static SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume);
1040#define SND_ALS4000_PM_OPS &snd_als4000_pm
1041#else
1042#define SND_ALS4000_PM_OPS NULL
1043#endif /* CONFIG_PM */
1038 1044
1039static struct pci_driver als4000_driver = { 1045static struct pci_driver als4000_driver = {
1040 .name = KBUILD_MODNAME, 1046 .name = KBUILD_MODNAME,
1041 .id_table = snd_als4000_ids, 1047 .id_table = snd_als4000_ids,
1042 .probe = snd_card_als4000_probe, 1048 .probe = snd_card_als4000_probe,
1043 .remove = __devexit_p(snd_card_als4000_remove), 1049 .remove = __devexit_p(snd_card_als4000_remove),
1044#ifdef CONFIG_PM 1050 .driver = {
1045 .suspend = snd_als4000_suspend, 1051 .pm = SND_ALS4000_PM_OPS,
1046 .resume = snd_als4000_resume, 1052 },
1047#endif
1048}; 1053};
1049 1054
1050module_pci_driver(als4000_driver); 1055module_pci_driver(als4000_driver);