aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/riptide/riptide.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/riptide/riptide.c')
-rw-r--r--sound/pci/riptide/riptide.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index cbeb3f77350c..760ee467cd9a 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1151,9 +1151,10 @@ static void riptide_handleirq(unsigned long dev_id)
1151} 1151}
1152 1152
1153#ifdef CONFIG_PM 1153#ifdef CONFIG_PM
1154static int riptide_suspend(struct pci_dev *pci, pm_message_t state) 1154static int riptide_suspend(struct device *dev)
1155{ 1155{
1156 struct snd_card *card = pci_get_drvdata(pci); 1156 struct pci_dev *pci = to_pci_dev(dev);
1157 struct snd_card *card = dev_get_drvdata(dev);
1157 struct snd_riptide *chip = card->private_data; 1158 struct snd_riptide *chip = card->private_data;
1158 1159
1159 chip->in_suspend = 1; 1160 chip->in_suspend = 1;
@@ -1162,13 +1163,14 @@ static int riptide_suspend(struct pci_dev *pci, pm_message_t state)
1162 snd_ac97_suspend(chip->ac97); 1163 snd_ac97_suspend(chip->ac97);
1163 pci_disable_device(pci); 1164 pci_disable_device(pci);
1164 pci_save_state(pci); 1165 pci_save_state(pci);
1165 pci_set_power_state(pci, pci_choose_state(pci, state)); 1166 pci_set_power_state(pci, PCI_D3hot);
1166 return 0; 1167 return 0;
1167} 1168}
1168 1169
1169static int riptide_resume(struct pci_dev *pci) 1170static int riptide_resume(struct device *dev)
1170{ 1171{
1171 struct snd_card *card = pci_get_drvdata(pci); 1172 struct pci_dev *pci = to_pci_dev(dev);
1173 struct snd_card *card = dev_get_drvdata(dev);
1172 struct snd_riptide *chip = card->private_data; 1174 struct snd_riptide *chip = card->private_data;
1173 1175
1174 pci_set_power_state(pci, PCI_D0); 1176 pci_set_power_state(pci, PCI_D0);
@@ -1186,7 +1188,12 @@ static int riptide_resume(struct pci_dev *pci)
1186 chip->in_suspend = 0; 1188 chip->in_suspend = 0;
1187 return 0; 1189 return 0;
1188} 1190}
1189#endif 1191
1192static SIMPLE_DEV_PM_OPS(riptide_pm, riptide_suspend, riptide_resume);
1193#define RIPTIDE_PM_OPS &riptide_pm
1194#else
1195#define RIPTIDE_PM_OPS NULL
1196#endif /* CONFIG_PM */
1190 1197
1191static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip) 1198static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip)
1192{ 1199{
@@ -2180,10 +2187,9 @@ static struct pci_driver driver = {
2180 .id_table = snd_riptide_ids, 2187 .id_table = snd_riptide_ids,
2181 .probe = snd_card_riptide_probe, 2188 .probe = snd_card_riptide_probe,
2182 .remove = __devexit_p(snd_card_riptide_remove), 2189 .remove = __devexit_p(snd_card_riptide_remove),
2183#ifdef CONFIG_PM 2190 .driver = {
2184 .suspend = riptide_suspend, 2191 .pm = RIPTIDE_PM_OPS,
2185 .resume = riptide_resume, 2192 },
2186#endif
2187}; 2193};
2188 2194
2189#ifdef SUPPORT_JOYSTICK 2195#ifdef SUPPORT_JOYSTICK