diff options
Diffstat (limited to 'sound/pci/via82xx.c')
-rw-r--r-- | sound/pci/via82xx.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index b5afab48943e..0eb7245dd362 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -2242,9 +2242,10 @@ static int snd_via82xx_chip_init(struct via82xx *chip) | |||
2242 | /* | 2242 | /* |
2243 | * power management | 2243 | * power management |
2244 | */ | 2244 | */ |
2245 | static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | 2245 | static int snd_via82xx_suspend(struct device *dev) |
2246 | { | 2246 | { |
2247 | struct snd_card *card = pci_get_drvdata(pci); | 2247 | struct pci_dev *pci = to_pci_dev(dev); |
2248 | struct snd_card *card = dev_get_drvdata(dev); | ||
2248 | struct via82xx *chip = card->private_data; | 2249 | struct via82xx *chip = card->private_data; |
2249 | int i; | 2250 | int i; |
2250 | 2251 | ||
@@ -2265,13 +2266,14 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2265 | 2266 | ||
2266 | pci_disable_device(pci); | 2267 | pci_disable_device(pci); |
2267 | pci_save_state(pci); | 2268 | pci_save_state(pci); |
2268 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2269 | pci_set_power_state(pci, PCI_D3hot); |
2269 | return 0; | 2270 | return 0; |
2270 | } | 2271 | } |
2271 | 2272 | ||
2272 | static int snd_via82xx_resume(struct pci_dev *pci) | 2273 | static int snd_via82xx_resume(struct device *dev) |
2273 | { | 2274 | { |
2274 | struct snd_card *card = pci_get_drvdata(pci); | 2275 | struct pci_dev *pci = to_pci_dev(dev); |
2276 | struct snd_card *card = dev_get_drvdata(dev); | ||
2275 | struct via82xx *chip = card->private_data; | 2277 | struct via82xx *chip = card->private_data; |
2276 | int i; | 2278 | int i; |
2277 | 2279 | ||
@@ -2306,6 +2308,11 @@ static int snd_via82xx_resume(struct pci_dev *pci) | |||
2306 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2308 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2307 | return 0; | 2309 | return 0; |
2308 | } | 2310 | } |
2311 | |||
2312 | static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); | ||
2313 | #define SND_VIA82XX_PM_OPS &snd_via82xx_pm | ||
2314 | #else | ||
2315 | #define SND_VIA82XX_PM_OPS NULL | ||
2309 | #endif /* CONFIG_PM */ | 2316 | #endif /* CONFIG_PM */ |
2310 | 2317 | ||
2311 | static int snd_via82xx_free(struct via82xx *chip) | 2318 | static int snd_via82xx_free(struct via82xx *chip) |
@@ -2624,10 +2631,9 @@ static struct pci_driver via82xx_driver = { | |||
2624 | .id_table = snd_via82xx_ids, | 2631 | .id_table = snd_via82xx_ids, |
2625 | .probe = snd_via82xx_probe, | 2632 | .probe = snd_via82xx_probe, |
2626 | .remove = __devexit_p(snd_via82xx_remove), | 2633 | .remove = __devexit_p(snd_via82xx_remove), |
2627 | #ifdef CONFIG_PM | 2634 | .driver = { |
2628 | .suspend = snd_via82xx_suspend, | 2635 | .pm = SND_VIA82XX_PM_OPS, |
2629 | .resume = snd_via82xx_resume, | 2636 | }, |
2630 | #endif | ||
2631 | }; | 2637 | }; |
2632 | 2638 | ||
2633 | module_pci_driver(via82xx_driver); | 2639 | module_pci_driver(via82xx_driver); |