diff options
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index a01a00d1cf4d..bed9f34f4efe 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -2793,9 +2793,10 @@ static void __devexit snd_vt1724_remove(struct pci_dev *pci) | |||
2793 | } | 2793 | } |
2794 | 2794 | ||
2795 | #ifdef CONFIG_PM | 2795 | #ifdef CONFIG_PM |
2796 | static int snd_vt1724_suspend(struct pci_dev *pci, pm_message_t state) | 2796 | static int snd_vt1724_suspend(struct device *dev) |
2797 | { | 2797 | { |
2798 | struct snd_card *card = pci_get_drvdata(pci); | 2798 | struct pci_dev *pci = to_pci_dev(dev); |
2799 | struct snd_card *card = dev_get_drvdata(dev); | ||
2799 | struct snd_ice1712 *ice = card->private_data; | 2800 | struct snd_ice1712 *ice = card->private_data; |
2800 | 2801 | ||
2801 | if (!ice->pm_suspend_enabled) | 2802 | if (!ice->pm_suspend_enabled) |
@@ -2820,13 +2821,14 @@ static int snd_vt1724_suspend(struct pci_dev *pci, pm_message_t state) | |||
2820 | 2821 | ||
2821 | pci_disable_device(pci); | 2822 | pci_disable_device(pci); |
2822 | pci_save_state(pci); | 2823 | pci_save_state(pci); |
2823 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2824 | pci_set_power_state(pci, PCI_D3hot); |
2824 | return 0; | 2825 | return 0; |
2825 | } | 2826 | } |
2826 | 2827 | ||
2827 | static int snd_vt1724_resume(struct pci_dev *pci) | 2828 | static int snd_vt1724_resume(struct device *dev) |
2828 | { | 2829 | { |
2829 | struct snd_card *card = pci_get_drvdata(pci); | 2830 | struct pci_dev *pci = to_pci_dev(dev); |
2831 | struct snd_card *card = dev_get_drvdata(dev); | ||
2830 | struct snd_ice1712 *ice = card->private_data; | 2832 | struct snd_ice1712 *ice = card->private_data; |
2831 | 2833 | ||
2832 | if (!ice->pm_suspend_enabled) | 2834 | if (!ice->pm_suspend_enabled) |
@@ -2871,17 +2873,21 @@ static int snd_vt1724_resume(struct pci_dev *pci) | |||
2871 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2873 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2872 | return 0; | 2874 | return 0; |
2873 | } | 2875 | } |
2874 | #endif | 2876 | |
2877 | static SIMPLE_DEV_PM_OPS(snd_vt1724_pm, snd_vt1724_suspend, snd_vt1724_resume); | ||
2878 | #define SND_VT1724_PM_OPS &snd_vt1724_pm | ||
2879 | #else | ||
2880 | #define SND_VT1724_PM_OPS NULL | ||
2881 | #endif /* CONFIG_PM */ | ||
2875 | 2882 | ||
2876 | static struct pci_driver vt1724_driver = { | 2883 | static struct pci_driver vt1724_driver = { |
2877 | .name = KBUILD_MODNAME, | 2884 | .name = KBUILD_MODNAME, |
2878 | .id_table = snd_vt1724_ids, | 2885 | .id_table = snd_vt1724_ids, |
2879 | .probe = snd_vt1724_probe, | 2886 | .probe = snd_vt1724_probe, |
2880 | .remove = __devexit_p(snd_vt1724_remove), | 2887 | .remove = __devexit_p(snd_vt1724_remove), |
2881 | #ifdef CONFIG_PM | 2888 | .driver = { |
2882 | .suspend = snd_vt1724_suspend, | 2889 | .pm = SND_VT1724_PM_OPS, |
2883 | .resume = snd_vt1724_resume, | 2890 | }, |
2884 | #endif | ||
2885 | }; | 2891 | }; |
2886 | 2892 | ||
2887 | module_pci_driver(vt1724_driver); | 2893 | module_pci_driver(vt1724_driver); |