aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.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/maestro3.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/maestro3.c')
-rw-r--r--sound/pci/maestro3.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index deef21399586..36008a943aa3 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2459,9 +2459,10 @@ static int snd_m3_free(struct snd_m3 *chip)
2459 * APM support 2459 * APM support
2460 */ 2460 */
2461#ifdef CONFIG_PM 2461#ifdef CONFIG_PM
2462static int m3_suspend(struct pci_dev *pci, pm_message_t state) 2462static int m3_suspend(struct device *dev)
2463{ 2463{
2464 struct snd_card *card = pci_get_drvdata(pci); 2464 struct pci_dev *pci = to_pci_dev(dev);
2465 struct snd_card *card = dev_get_drvdata(dev);
2465 struct snd_m3 *chip = card->private_data; 2466 struct snd_m3 *chip = card->private_data;
2466 int i, dsp_index; 2467 int i, dsp_index;
2467 2468
@@ -2489,13 +2490,14 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2489 2490
2490 pci_disable_device(pci); 2491 pci_disable_device(pci);
2491 pci_save_state(pci); 2492 pci_save_state(pci);
2492 pci_set_power_state(pci, pci_choose_state(pci, state)); 2493 pci_set_power_state(pci, PCI_D3hot);
2493 return 0; 2494 return 0;
2494} 2495}
2495 2496
2496static int m3_resume(struct pci_dev *pci) 2497static int m3_resume(struct device *dev)
2497{ 2498{
2498 struct snd_card *card = pci_get_drvdata(pci); 2499 struct pci_dev *pci = to_pci_dev(dev);
2500 struct snd_card *card = dev_get_drvdata(dev);
2499 struct snd_m3 *chip = card->private_data; 2501 struct snd_m3 *chip = card->private_data;
2500 int i, dsp_index; 2502 int i, dsp_index;
2501 2503
@@ -2546,6 +2548,11 @@ static int m3_resume(struct pci_dev *pci)
2546 chip->in_suspend = 0; 2548 chip->in_suspend = 0;
2547 return 0; 2549 return 0;
2548} 2550}
2551
2552static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume);
2553#define M3_PM_OPS &m3_pm
2554#else
2555#define M3_PM_OPS NULL
2549#endif /* CONFIG_PM */ 2556#endif /* CONFIG_PM */
2550 2557
2551#ifdef CONFIG_SND_MAESTRO3_INPUT 2558#ifdef CONFIG_SND_MAESTRO3_INPUT
@@ -2842,10 +2849,9 @@ static struct pci_driver m3_driver = {
2842 .id_table = snd_m3_ids, 2849 .id_table = snd_m3_ids,
2843 .probe = snd_m3_probe, 2850 .probe = snd_m3_probe,
2844 .remove = __devexit_p(snd_m3_remove), 2851 .remove = __devexit_p(snd_m3_remove),
2845#ifdef CONFIG_PM 2852 .driver = {
2846 .suspend = m3_suspend, 2853 .pm = M3_PM_OPS,
2847 .resume = m3_resume, 2854 },
2848#endif
2849}; 2855};
2850 2856
2851module_pci_driver(m3_driver); 2857module_pci_driver(m3_driver);