aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio
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/cs5535audio
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/cs5535audio')
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c5
-rw-r--r--sound/pci/cs5535audio/cs5535audio.h5
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pm.c13
3 files changed, 12 insertions, 11 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 2c9697cf0a1a..51f64ba5facf 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -400,8 +400,9 @@ static struct pci_driver cs5535audio_driver = {
400 .probe = snd_cs5535audio_probe, 400 .probe = snd_cs5535audio_probe,
401 .remove = __devexit_p(snd_cs5535audio_remove), 401 .remove = __devexit_p(snd_cs5535audio_remove),
402#ifdef CONFIG_PM 402#ifdef CONFIG_PM
403 .suspend = snd_cs5535audio_suspend, 403 .driver = {
404 .resume = snd_cs5535audio_resume, 404 .pm = &snd_cs5535audio_pm,
405 },
405#endif 406#endif
406}; 407};
407 408
diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h
index 51966d782a3c..bb3cc641130c 100644
--- a/sound/pci/cs5535audio/cs5535audio.h
+++ b/sound/pci/cs5535audio/cs5535audio.h
@@ -94,10 +94,7 @@ struct cs5535audio {
94 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS]; 94 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
95}; 95};
96 96
97#ifdef CONFIG_PM 97extern const struct dev_pm_ops snd_cs5535audio_pm;
98int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state);
99int snd_cs5535audio_resume(struct pci_dev *pci);
100#endif
101 98
102#ifdef CONFIG_OLPC 99#ifdef CONFIG_OLPC
103void __devinit olpc_prequirks(struct snd_card *card, 100void __devinit olpc_prequirks(struct snd_card *card,
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 185b00088320..6c34def5986d 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -55,9 +55,10 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
55 55
56} 56}
57 57
58int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state) 58static int snd_cs5535audio_suspend(struct device *dev)
59{ 59{
60 struct snd_card *card = pci_get_drvdata(pci); 60 struct pci_dev *pci = to_pci_dev(dev);
61 struct snd_card *card = dev_get_drvdata(dev);
61 struct cs5535audio *cs5535au = card->private_data; 62 struct cs5535audio *cs5535au = card->private_data;
62 int i; 63 int i;
63 64
@@ -77,13 +78,14 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
77 return -EIO; 78 return -EIO;
78 } 79 }
79 pci_disable_device(pci); 80 pci_disable_device(pci);
80 pci_set_power_state(pci, pci_choose_state(pci, state)); 81 pci_set_power_state(pci, PCI_D3hot);
81 return 0; 82 return 0;
82} 83}
83 84
84int snd_cs5535audio_resume(struct pci_dev *pci) 85static int snd_cs5535audio_resume(struct device *dev)
85{ 86{
86 struct snd_card *card = pci_get_drvdata(pci); 87 struct pci_dev *pci = to_pci_dev(dev);
88 struct snd_card *card = dev_get_drvdata(dev);
87 struct cs5535audio *cs5535au = card->private_data; 89 struct cs5535audio *cs5535au = card->private_data;
88 u32 tmp; 90 u32 tmp;
89 int timeout; 91 int timeout;
@@ -129,3 +131,4 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
129 return 0; 131 return 0;
130} 132}
131 133
134SIMPLE_DEV_PM_OPS(snd_cs5535audio_pm, snd_cs5535audio_suspend, snd_cs5535audio_resume);