aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/nm256
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-02 09:20:37 -0400
committerTakashi Iwai <tiwai@suse.de>2012-07-03 02:23:03 -0400
commit68cb2b559278858ef9f3a7722f95df88797c7840 (patch)
tree3dd568aac5e1004ffd1e8400aa5a50ca6a11ad01 /sound/pci/nm256
parent284e7ca75f96a18f182cce38ba76ee724fb97e16 (diff)
ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy suspend/resume ops. Since we change vx222, vx_core and vxpocket have to be converted, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/nm256')
-rw-r--r--sound/pci/nm256/nm256.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 8159b05ee94d..465cff25b146 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1382,9 +1382,10 @@ snd_nm256_peek_for_sig(struct nm256 *chip)
1382 * APM event handler, so the card is properly reinitialized after a power 1382 * APM event handler, so the card is properly reinitialized after a power
1383 * event. 1383 * event.
1384 */ 1384 */
1385static int nm256_suspend(struct pci_dev *pci, pm_message_t state) 1385static int nm256_suspend(struct device *dev)
1386{ 1386{
1387 struct snd_card *card = pci_get_drvdata(pci); 1387 struct pci_dev *pci = to_pci_dev(dev);
1388 struct snd_card *card = dev_get_drvdata(dev);
1388 struct nm256 *chip = card->private_data; 1389 struct nm256 *chip = card->private_data;
1389 1390
1390 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 1391 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -1393,13 +1394,14 @@ static int nm256_suspend(struct pci_dev *pci, pm_message_t state)
1393 chip->coeffs_current = 0; 1394 chip->coeffs_current = 0;
1394 pci_disable_device(pci); 1395 pci_disable_device(pci);
1395 pci_save_state(pci); 1396 pci_save_state(pci);
1396 pci_set_power_state(pci, pci_choose_state(pci, state)); 1397 pci_set_power_state(pci, PCI_D3hot);
1397 return 0; 1398 return 0;
1398} 1399}
1399 1400
1400static int nm256_resume(struct pci_dev *pci) 1401static int nm256_resume(struct device *dev)
1401{ 1402{
1402 struct snd_card *card = pci_get_drvdata(pci); 1403 struct pci_dev *pci = to_pci_dev(dev);
1404 struct snd_card *card = dev_get_drvdata(dev);
1403 struct nm256 *chip = card->private_data; 1405 struct nm256 *chip = card->private_data;
1404 int i; 1406 int i;
1405 1407
@@ -1434,6 +1436,11 @@ static int nm256_resume(struct pci_dev *pci)
1434 chip->in_resume = 0; 1436 chip->in_resume = 0;
1435 return 0; 1437 return 0;
1436} 1438}
1439
1440static SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume);
1441#define NM256_PM_OPS &nm256_pm
1442#else
1443#define NM256_PM_OPS NULL
1437#endif /* CONFIG_PM */ 1444#endif /* CONFIG_PM */
1438 1445
1439static int snd_nm256_free(struct nm256 *chip) 1446static int snd_nm256_free(struct nm256 *chip)
@@ -1747,10 +1754,9 @@ static struct pci_driver nm256_driver = {
1747 .id_table = snd_nm256_ids, 1754 .id_table = snd_nm256_ids,
1748 .probe = snd_nm256_probe, 1755 .probe = snd_nm256_probe,
1749 .remove = __devexit_p(snd_nm256_remove), 1756 .remove = __devexit_p(snd_nm256_remove),
1750#ifdef CONFIG_PM 1757 .driver = {
1751 .suspend = nm256_suspend, 1758 .pm = NM256_PM_OPS,
1752 .resume = nm256_resume, 1759 },
1753#endif
1754}; 1760};
1755 1761
1756module_pci_driver(nm256_driver); 1762module_pci_driver(nm256_driver);