aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/sis7019.c
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/sis7019.c
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/sis7019.c')
-rw-r--r--sound/pci/sis7019.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 1552642765d6..512434efcc31 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1209,9 +1209,10 @@ static int sis_chip_init(struct sis7019 *sis)
1209} 1209}
1210 1210
1211#ifdef CONFIG_PM 1211#ifdef CONFIG_PM
1212static int sis_suspend(struct pci_dev *pci, pm_message_t state) 1212static int sis_suspend(struct device *dev)
1213{ 1213{
1214 struct snd_card *card = pci_get_drvdata(pci); 1214 struct pci_dev *pci = to_pci_dev(dev);
1215 struct snd_card *card = dev_get_drvdata(dev);
1215 struct sis7019 *sis = card->private_data; 1216 struct sis7019 *sis = card->private_data;
1216 void __iomem *ioaddr = sis->ioaddr; 1217 void __iomem *ioaddr = sis->ioaddr;
1217 int i; 1218 int i;
@@ -1241,13 +1242,14 @@ static int sis_suspend(struct pci_dev *pci, pm_message_t state)
1241 1242
1242 pci_disable_device(pci); 1243 pci_disable_device(pci);
1243 pci_save_state(pci); 1244 pci_save_state(pci);
1244 pci_set_power_state(pci, pci_choose_state(pci, state)); 1245 pci_set_power_state(pci, PCI_D3hot);
1245 return 0; 1246 return 0;
1246} 1247}
1247 1248
1248static int sis_resume(struct pci_dev *pci) 1249static int sis_resume(struct device *dev)
1249{ 1250{
1250 struct snd_card *card = pci_get_drvdata(pci); 1251 struct pci_dev *pci = to_pci_dev(dev);
1252 struct snd_card *card = dev_get_drvdata(dev);
1251 struct sis7019 *sis = card->private_data; 1253 struct sis7019 *sis = card->private_data;
1252 void __iomem *ioaddr = sis->ioaddr; 1254 void __iomem *ioaddr = sis->ioaddr;
1253 int i; 1255 int i;
@@ -1298,6 +1300,11 @@ error:
1298 snd_card_disconnect(card); 1300 snd_card_disconnect(card);
1299 return -EIO; 1301 return -EIO;
1300} 1302}
1303
1304static SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume);
1305#define SIS_PM_OPS &sis_pm
1306#else
1307#define SIS_PM_OPS NULL
1301#endif /* CONFIG_PM */ 1308#endif /* CONFIG_PM */
1302 1309
1303static int sis_alloc_suspend(struct sis7019 *sis) 1310static int sis_alloc_suspend(struct sis7019 *sis)
@@ -1481,11 +1488,9 @@ static struct pci_driver sis7019_driver = {
1481 .id_table = snd_sis7019_ids, 1488 .id_table = snd_sis7019_ids,
1482 .probe = snd_sis7019_probe, 1489 .probe = snd_sis7019_probe,
1483 .remove = __devexit_p(snd_sis7019_remove), 1490 .remove = __devexit_p(snd_sis7019_remove),
1484 1491 .driver = {
1485#ifdef CONFIG_PM 1492 .pm = SIS_PM_OPS,
1486 .suspend = sis_suspend, 1493 },
1487 .resume = sis_resume,
1488#endif
1489}; 1494};
1490 1495
1491module_pci_driver(sis7019_driver); 1496module_pci_driver(sis7019_driver);