aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/es1968.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/es1968.c')
-rw-r--r--sound/pci/es1968.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 52b5c0bf90c1..fb4c90b99c00 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2381,9 +2381,10 @@ static void snd_es1968_start_irq(struct es1968 *chip)
2381/* 2381/*
2382 * PM support 2382 * PM support
2383 */ 2383 */
2384static int es1968_suspend(struct pci_dev *pci, pm_message_t state) 2384static int es1968_suspend(struct device *dev)
2385{ 2385{
2386 struct snd_card *card = pci_get_drvdata(pci); 2386 struct pci_dev *pci = to_pci_dev(dev);
2387 struct snd_card *card = dev_get_drvdata(dev);
2387 struct es1968 *chip = card->private_data; 2388 struct es1968 *chip = card->private_data;
2388 2389
2389 if (! chip->do_pm) 2390 if (! chip->do_pm)
@@ -2398,13 +2399,14 @@ static int es1968_suspend(struct pci_dev *pci, pm_message_t state)
2398 2399
2399 pci_disable_device(pci); 2400 pci_disable_device(pci);
2400 pci_save_state(pci); 2401 pci_save_state(pci);
2401 pci_set_power_state(pci, pci_choose_state(pci, state)); 2402 pci_set_power_state(pci, PCI_D3hot);
2402 return 0; 2403 return 0;
2403} 2404}
2404 2405
2405static int es1968_resume(struct pci_dev *pci) 2406static int es1968_resume(struct device *dev)
2406{ 2407{
2407 struct snd_card *card = pci_get_drvdata(pci); 2408 struct pci_dev *pci = to_pci_dev(dev);
2409 struct snd_card *card = dev_get_drvdata(dev);
2408 struct es1968 *chip = card->private_data; 2410 struct es1968 *chip = card->private_data;
2409 struct esschan *es; 2411 struct esschan *es;
2410 2412
@@ -2454,6 +2456,11 @@ static int es1968_resume(struct pci_dev *pci)
2454 chip->in_suspend = 0; 2456 chip->in_suspend = 0;
2455 return 0; 2457 return 0;
2456} 2458}
2459
2460static SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume);
2461#define ES1968_PM_OPS &es1968_pm
2462#else
2463#define ES1968_PM_OPS NULL
2457#endif /* CONFIG_PM */ 2464#endif /* CONFIG_PM */
2458 2465
2459#ifdef SUPPORT_JOYSTICK 2466#ifdef SUPPORT_JOYSTICK
@@ -2903,10 +2910,9 @@ static struct pci_driver es1968_driver = {
2903 .id_table = snd_es1968_ids, 2910 .id_table = snd_es1968_ids,
2904 .probe = snd_es1968_probe, 2911 .probe = snd_es1968_probe,
2905 .remove = __devexit_p(snd_es1968_remove), 2912 .remove = __devexit_p(snd_es1968_remove),
2906#ifdef CONFIG_PM 2913 .driver = {
2907 .suspend = es1968_suspend, 2914 .pm = ES1968_PM_OPS,
2908 .resume = es1968_resume, 2915 },
2909#endif
2910}; 2916};
2911 2917
2912module_pci_driver(es1968_driver); 2918module_pci_driver(es1968_driver);