aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-19 02:21:40 -0400
committerTakashi Iwai <tiwai@suse.de>2012-07-19 02:21:57 -0400
commit1558eb838ff502faafacf26b6a711dbaae796009 (patch)
tree8049ea20a214033369725ed58b8b4a3ca4110887 /sound/pci/maestro3.c
parent4609ed6b1f0ab9f11a9d0361573b53d9d057c440 (diff)
parent81fcb170852d58d7ebd8101a8ef970c82056426e (diff)
Merge branch 'topic/pm-convert' into for-next
This merges the changes for converting to new PM ops for platform and some other drivers. Also move some header files to local places from the public include/sound.
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 adb3b4c7917..c85d1ffcc95 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2391,9 +2391,10 @@ static int snd_m3_free(struct snd_m3 *chip)
2391 * APM support 2391 * APM support
2392 */ 2392 */
2393#ifdef CONFIG_PM 2393#ifdef CONFIG_PM
2394static int m3_suspend(struct pci_dev *pci, pm_message_t state) 2394static int m3_suspend(struct device *dev)
2395{ 2395{
2396 struct snd_card *card = pci_get_drvdata(pci); 2396 struct pci_dev *pci = to_pci_dev(dev);
2397 struct snd_card *card = dev_get_drvdata(dev);
2397 struct snd_m3 *chip = card->private_data; 2398 struct snd_m3 *chip = card->private_data;
2398 int i, dsp_index; 2399 int i, dsp_index;
2399 2400
@@ -2421,13 +2422,14 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2421 2422
2422 pci_disable_device(pci); 2423 pci_disable_device(pci);
2423 pci_save_state(pci); 2424 pci_save_state(pci);
2424 pci_set_power_state(pci, pci_choose_state(pci, state)); 2425 pci_set_power_state(pci, PCI_D3hot);
2425 return 0; 2426 return 0;
2426} 2427}
2427 2428
2428static int m3_resume(struct pci_dev *pci) 2429static int m3_resume(struct device *dev)
2429{ 2430{
2430 struct snd_card *card = pci_get_drvdata(pci); 2431 struct pci_dev *pci = to_pci_dev(dev);
2432 struct snd_card *card = dev_get_drvdata(dev);
2431 struct snd_m3 *chip = card->private_data; 2433 struct snd_m3 *chip = card->private_data;
2432 int i, dsp_index; 2434 int i, dsp_index;
2433 2435
@@ -2478,6 +2480,11 @@ static int m3_resume(struct pci_dev *pci)
2478 chip->in_suspend = 0; 2480 chip->in_suspend = 0;
2479 return 0; 2481 return 0;
2480} 2482}
2483
2484static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume);
2485#define M3_PM_OPS &m3_pm
2486#else
2487#define M3_PM_OPS NULL
2481#endif /* CONFIG_PM */ 2488#endif /* CONFIG_PM */
2482 2489
2483#ifdef CONFIG_SND_MAESTRO3_INPUT 2490#ifdef CONFIG_SND_MAESTRO3_INPUT
@@ -2774,10 +2781,9 @@ static struct pci_driver m3_driver = {
2774 .id_table = snd_m3_ids, 2781 .id_table = snd_m3_ids,
2775 .probe = snd_m3_probe, 2782 .probe = snd_m3_probe,
2776 .remove = __devexit_p(snd_m3_remove), 2783 .remove = __devexit_p(snd_m3_remove),
2777#ifdef CONFIG_PM 2784 .driver = {
2778 .suspend = m3_suspend, 2785 .pm = M3_PM_OPS,
2779 .resume = m3_resume, 2786 },
2780#endif
2781}; 2787};
2782 2788
2783module_pci_driver(m3_driver); 2789module_pci_driver(m3_driver);