diff options
Diffstat (limited to 'sound/pci/es1938.c')
-rw-r--r-- | sound/pci/es1938.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index a41106d745ca..dbb81807bc1a 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1469,9 +1469,10 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = { | |||
1469 | }; | 1469 | }; |
1470 | 1470 | ||
1471 | 1471 | ||
1472 | static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | 1472 | static int es1938_suspend(struct device *dev) |
1473 | { | 1473 | { |
1474 | struct snd_card *card = pci_get_drvdata(pci); | 1474 | struct pci_dev *pci = to_pci_dev(dev); |
1475 | struct snd_card *card = dev_get_drvdata(dev); | ||
1475 | struct es1938 *chip = card->private_data; | 1476 | struct es1938 *chip = card->private_data; |
1476 | unsigned char *s, *d; | 1477 | unsigned char *s, *d; |
1477 | 1478 | ||
@@ -1489,13 +1490,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | |||
1489 | } | 1490 | } |
1490 | pci_disable_device(pci); | 1491 | pci_disable_device(pci); |
1491 | pci_save_state(pci); | 1492 | pci_save_state(pci); |
1492 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1493 | pci_set_power_state(pci, PCI_D3hot); |
1493 | return 0; | 1494 | return 0; |
1494 | } | 1495 | } |
1495 | 1496 | ||
1496 | static int es1938_resume(struct pci_dev *pci) | 1497 | static int es1938_resume(struct device *dev) |
1497 | { | 1498 | { |
1498 | struct snd_card *card = pci_get_drvdata(pci); | 1499 | struct pci_dev *pci = to_pci_dev(dev); |
1500 | struct snd_card *card = dev_get_drvdata(dev); | ||
1499 | struct es1938 *chip = card->private_data; | 1501 | struct es1938 *chip = card->private_data; |
1500 | unsigned char *s, *d; | 1502 | unsigned char *s, *d; |
1501 | 1503 | ||
@@ -1529,6 +1531,11 @@ static int es1938_resume(struct pci_dev *pci) | |||
1529 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1531 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1530 | return 0; | 1532 | return 0; |
1531 | } | 1533 | } |
1534 | |||
1535 | static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); | ||
1536 | #define ES1938_PM_OPS &es1938_pm | ||
1537 | #else | ||
1538 | #define ES1938_PM_OPS NULL | ||
1532 | #endif /* CONFIG_PM */ | 1539 | #endif /* CONFIG_PM */ |
1533 | 1540 | ||
1534 | #ifdef SUPPORT_JOYSTICK | 1541 | #ifdef SUPPORT_JOYSTICK |
@@ -1882,10 +1889,9 @@ static struct pci_driver es1938_driver = { | |||
1882 | .id_table = snd_es1938_ids, | 1889 | .id_table = snd_es1938_ids, |
1883 | .probe = snd_es1938_probe, | 1890 | .probe = snd_es1938_probe, |
1884 | .remove = __devexit_p(snd_es1938_remove), | 1891 | .remove = __devexit_p(snd_es1938_remove), |
1885 | #ifdef CONFIG_PM | 1892 | .driver = { |
1886 | .suspend = es1938_suspend, | 1893 | .pm = ES1938_PM_OPS, |
1887 | .resume = es1938_resume, | 1894 | }, |
1888 | #endif | ||
1889 | }; | 1895 | }; |
1890 | 1896 | ||
1891 | module_pci_driver(es1938_driver); | 1897 | module_pci_driver(es1938_driver); |