aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/atiixp_modem.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/atiixp_modem.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/atiixp_modem.c')
-rw-r--r--sound/pci/atiixp_modem.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 30a4fd96ce73..79e204ec623f 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -1117,9 +1117,10 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
1117/* 1117/*
1118 * power management 1118 * power management
1119 */ 1119 */
1120static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) 1120static int snd_atiixp_suspend(struct device *dev)
1121{ 1121{
1122 struct snd_card *card = pci_get_drvdata(pci); 1122 struct pci_dev *pci = to_pci_dev(dev);
1123 struct snd_card *card = dev_get_drvdata(dev);
1123 struct atiixp_modem *chip = card->private_data; 1124 struct atiixp_modem *chip = card->private_data;
1124 int i; 1125 int i;
1125 1126
@@ -1133,13 +1134,14 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
1133 1134
1134 pci_disable_device(pci); 1135 pci_disable_device(pci);
1135 pci_save_state(pci); 1136 pci_save_state(pci);
1136 pci_set_power_state(pci, pci_choose_state(pci, state)); 1137 pci_set_power_state(pci, PCI_D3hot);
1137 return 0; 1138 return 0;
1138} 1139}
1139 1140
1140static int snd_atiixp_resume(struct pci_dev *pci) 1141static int snd_atiixp_resume(struct device *dev)
1141{ 1142{
1142 struct snd_card *card = pci_get_drvdata(pci); 1143 struct pci_dev *pci = to_pci_dev(dev);
1144 struct snd_card *card = dev_get_drvdata(dev);
1143 struct atiixp_modem *chip = card->private_data; 1145 struct atiixp_modem *chip = card->private_data;
1144 int i; 1146 int i;
1145 1147
@@ -1162,8 +1164,12 @@ static int snd_atiixp_resume(struct pci_dev *pci)
1162 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 1164 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
1163 return 0; 1165 return 0;
1164} 1166}
1165#endif /* CONFIG_PM */
1166 1167
1168static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume);
1169#define SND_ATIIXP_PM_OPS &snd_atiixp_pm
1170#else
1171#define SND_ATIIXP_PM_OPS NULL
1172#endif /* CONFIG_PM */
1167 1173
1168#ifdef CONFIG_PROC_FS 1174#ifdef CONFIG_PROC_FS
1169/* 1175/*
@@ -1336,10 +1342,9 @@ static struct pci_driver atiixp_modem_driver = {
1336 .id_table = snd_atiixp_ids, 1342 .id_table = snd_atiixp_ids,
1337 .probe = snd_atiixp_probe, 1343 .probe = snd_atiixp_probe,
1338 .remove = __devexit_p(snd_atiixp_remove), 1344 .remove = __devexit_p(snd_atiixp_remove),
1339#ifdef CONFIG_PM 1345 .driver = {
1340 .suspend = snd_atiixp_suspend, 1346 .pm = SND_ATIIXP_PM_OPS,
1341 .resume = snd_atiixp_resume, 1347 },
1342#endif
1343}; 1348};
1344 1349
1345module_pci_driver(atiixp_modem_driver); 1350module_pci_driver(atiixp_modem_driver);