diff options
Diffstat (limited to 'sound/pci/via82xx_modem.c')
-rw-r--r-- | sound/pci/via82xx_modem.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 59fd47ed0a31..e886bc16999d 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -1023,9 +1023,10 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip) | |||
1023 | /* | 1023 | /* |
1024 | * power management | 1024 | * power management |
1025 | */ | 1025 | */ |
1026 | static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | 1026 | static int snd_via82xx_suspend(struct device *dev) |
1027 | { | 1027 | { |
1028 | struct snd_card *card = pci_get_drvdata(pci); | 1028 | struct pci_dev *pci = to_pci_dev(dev); |
1029 | struct snd_card *card = dev_get_drvdata(dev); | ||
1029 | struct via82xx_modem *chip = card->private_data; | 1030 | struct via82xx_modem *chip = card->private_data; |
1030 | int i; | 1031 | int i; |
1031 | 1032 | ||
@@ -1039,13 +1040,14 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
1039 | 1040 | ||
1040 | pci_disable_device(pci); | 1041 | pci_disable_device(pci); |
1041 | pci_save_state(pci); | 1042 | pci_save_state(pci); |
1042 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1043 | pci_set_power_state(pci, PCI_D3hot); |
1043 | return 0; | 1044 | return 0; |
1044 | } | 1045 | } |
1045 | 1046 | ||
1046 | static int snd_via82xx_resume(struct pci_dev *pci) | 1047 | static int snd_via82xx_resume(struct device *dev) |
1047 | { | 1048 | { |
1048 | struct snd_card *card = pci_get_drvdata(pci); | 1049 | struct pci_dev *pci = to_pci_dev(dev); |
1050 | struct snd_card *card = dev_get_drvdata(dev); | ||
1049 | struct via82xx_modem *chip = card->private_data; | 1051 | struct via82xx_modem *chip = card->private_data; |
1050 | int i; | 1052 | int i; |
1051 | 1053 | ||
@@ -1069,6 +1071,11 @@ static int snd_via82xx_resume(struct pci_dev *pci) | |||
1069 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1071 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1070 | return 0; | 1072 | return 0; |
1071 | } | 1073 | } |
1074 | |||
1075 | static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); | ||
1076 | #define SND_VIA82XX_PM_OPS &snd_via82xx_pm | ||
1077 | #else | ||
1078 | #define SND_VIA82XX_PM_OPS NULL | ||
1072 | #endif /* CONFIG_PM */ | 1079 | #endif /* CONFIG_PM */ |
1073 | 1080 | ||
1074 | static int snd_via82xx_free(struct via82xx_modem *chip) | 1081 | static int snd_via82xx_free(struct via82xx_modem *chip) |
@@ -1228,10 +1235,9 @@ static struct pci_driver via82xx_modem_driver = { | |||
1228 | .id_table = snd_via82xx_modem_ids, | 1235 | .id_table = snd_via82xx_modem_ids, |
1229 | .probe = snd_via82xx_probe, | 1236 | .probe = snd_via82xx_probe, |
1230 | .remove = __devexit_p(snd_via82xx_remove), | 1237 | .remove = __devexit_p(snd_via82xx_remove), |
1231 | #ifdef CONFIG_PM | 1238 | .driver = { |
1232 | .suspend = snd_via82xx_suspend, | 1239 | .pm = SND_VIA82XX_PM_OPS, |
1233 | .resume = snd_via82xx_resume, | 1240 | }, |
1234 | #endif | ||
1235 | }; | 1241 | }; |
1236 | 1242 | ||
1237 | module_pci_driver(via82xx_modem_driver); | 1243 | module_pci_driver(via82xx_modem_driver); |