diff options
Diffstat (limited to 'sound/pci/fm801.c')
-rw-r--r-- | sound/pci/fm801.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index b32e8024ea86..522c8706f244 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1369,9 +1369,10 @@ static unsigned char saved_regs[] = { | |||
1369 | FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL, | 1369 | FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL, |
1370 | }; | 1370 | }; |
1371 | 1371 | ||
1372 | static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | 1372 | static int snd_fm801_suspend(struct device *dev) |
1373 | { | 1373 | { |
1374 | struct snd_card *card = pci_get_drvdata(pci); | 1374 | struct pci_dev *pci = to_pci_dev(dev); |
1375 | struct snd_card *card = dev_get_drvdata(dev); | ||
1375 | struct fm801 *chip = card->private_data; | 1376 | struct fm801 *chip = card->private_data; |
1376 | int i; | 1377 | int i; |
1377 | 1378 | ||
@@ -1385,13 +1386,14 @@ static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | |||
1385 | 1386 | ||
1386 | pci_disable_device(pci); | 1387 | pci_disable_device(pci); |
1387 | pci_save_state(pci); | 1388 | pci_save_state(pci); |
1388 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1389 | pci_set_power_state(pci, PCI_D3hot); |
1389 | return 0; | 1390 | return 0; |
1390 | } | 1391 | } |
1391 | 1392 | ||
1392 | static int snd_fm801_resume(struct pci_dev *pci) | 1393 | static int snd_fm801_resume(struct device *dev) |
1393 | { | 1394 | { |
1394 | struct snd_card *card = pci_get_drvdata(pci); | 1395 | struct pci_dev *pci = to_pci_dev(dev); |
1396 | struct snd_card *card = dev_get_drvdata(dev); | ||
1395 | struct fm801 *chip = card->private_data; | 1397 | struct fm801 *chip = card->private_data; |
1396 | int i; | 1398 | int i; |
1397 | 1399 | ||
@@ -1414,17 +1416,21 @@ static int snd_fm801_resume(struct pci_dev *pci) | |||
1414 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1416 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1415 | return 0; | 1417 | return 0; |
1416 | } | 1418 | } |
1417 | #endif | 1419 | |
1420 | static SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume); | ||
1421 | #define SND_FM801_PM_OPS &snd_fm801_pm | ||
1422 | #else | ||
1423 | #define SND_FM801_PM_OPS NULL | ||
1424 | #endif /* CONFIG_PM */ | ||
1418 | 1425 | ||
1419 | static struct pci_driver fm801_driver = { | 1426 | static struct pci_driver fm801_driver = { |
1420 | .name = KBUILD_MODNAME, | 1427 | .name = KBUILD_MODNAME, |
1421 | .id_table = snd_fm801_ids, | 1428 | .id_table = snd_fm801_ids, |
1422 | .probe = snd_card_fm801_probe, | 1429 | .probe = snd_card_fm801_probe, |
1423 | .remove = __devexit_p(snd_card_fm801_remove), | 1430 | .remove = __devexit_p(snd_card_fm801_remove), |
1424 | #ifdef CONFIG_PM | 1431 | .driver = { |
1425 | .suspend = snd_fm801_suspend, | 1432 | .pm = SND_FM801_PM_OPS, |
1426 | .resume = snd_fm801_resume, | 1433 | }, |
1427 | #endif | ||
1428 | }; | 1434 | }; |
1429 | 1435 | ||
1430 | module_pci_driver(fm801_driver); | 1436 | module_pci_driver(fm801_driver); |