aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/als300.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/als300.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/als300.c')
-rw-r--r--sound/pci/als300.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 59d65388faf5..68c4469c6d19 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -766,9 +766,10 @@ static int __devinit snd_als300_create(struct snd_card *card,
766} 766}
767 767
768#ifdef CONFIG_PM 768#ifdef CONFIG_PM
769static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state) 769static int snd_als300_suspend(struct device *dev)
770{ 770{
771 struct snd_card *card = pci_get_drvdata(pci); 771 struct pci_dev *pci = to_pci_dev(dev);
772 struct snd_card *card = dev_get_drvdata(dev);
772 struct snd_als300 *chip = card->private_data; 773 struct snd_als300 *chip = card->private_data;
773 774
774 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 775 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -777,13 +778,14 @@ static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state)
777 778
778 pci_disable_device(pci); 779 pci_disable_device(pci);
779 pci_save_state(pci); 780 pci_save_state(pci);
780 pci_set_power_state(pci, pci_choose_state(pci, state)); 781 pci_set_power_state(pci, PCI_D3hot);
781 return 0; 782 return 0;
782} 783}
783 784
784static int snd_als300_resume(struct pci_dev *pci) 785static int snd_als300_resume(struct device *dev)
785{ 786{
786 struct snd_card *card = pci_get_drvdata(pci); 787 struct pci_dev *pci = to_pci_dev(dev);
788 struct snd_card *card = dev_get_drvdata(dev);
787 struct snd_als300 *chip = card->private_data; 789 struct snd_als300 *chip = card->private_data;
788 790
789 pci_set_power_state(pci, PCI_D0); 791 pci_set_power_state(pci, PCI_D0);
@@ -802,6 +804,11 @@ static int snd_als300_resume(struct pci_dev *pci)
802 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 804 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
803 return 0; 805 return 0;
804} 806}
807
808static SIMPLE_DEV_PM_OPS(snd_als300_pm, snd_als300_suspend, snd_als300_resume);
809#define SND_ALS300_PM_OPS &snd_als300_pm
810#else
811#define SND_ALS300_PM_OPS NULL
805#endif 812#endif
806 813
807static int __devinit snd_als300_probe(struct pci_dev *pci, 814static int __devinit snd_als300_probe(struct pci_dev *pci,
@@ -857,10 +864,9 @@ static struct pci_driver als300_driver = {
857 .id_table = snd_als300_ids, 864 .id_table = snd_als300_ids,
858 .probe = snd_als300_probe, 865 .probe = snd_als300_probe,
859 .remove = __devexit_p(snd_als300_remove), 866 .remove = __devexit_p(snd_als300_remove),
860#ifdef CONFIG_PM 867 .driver = {
861 .suspend = snd_als300_suspend, 868 .pm = SND_ALS300_PM_OPS,
862 .resume = snd_als300_resume, 869 },
863#endif
864}; 870};
865 871
866module_pci_driver(als300_driver); 872module_pci_driver(als300_driver);