diff options
Diffstat (limited to 'sound/pci/ali5451/ali5451.c')
-rw-r--r-- | sound/pci/ali5451/ali5451.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 9dfc27bf6cc6..ee895f3c8605 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -1884,9 +1884,10 @@ static int __devinit snd_ali_mixer(struct snd_ali * codec) | |||
1884 | } | 1884 | } |
1885 | 1885 | ||
1886 | #ifdef CONFIG_PM | 1886 | #ifdef CONFIG_PM |
1887 | static int ali_suspend(struct pci_dev *pci, pm_message_t state) | 1887 | static int ali_suspend(struct device *dev) |
1888 | { | 1888 | { |
1889 | struct snd_card *card = pci_get_drvdata(pci); | 1889 | struct pci_dev *pci = to_pci_dev(dev); |
1890 | struct snd_card *card = dev_get_drvdata(dev); | ||
1890 | struct snd_ali *chip = card->private_data; | 1891 | struct snd_ali *chip = card->private_data; |
1891 | struct snd_ali_image *im; | 1892 | struct snd_ali_image *im; |
1892 | int i, j; | 1893 | int i, j; |
@@ -1929,13 +1930,14 @@ static int ali_suspend(struct pci_dev *pci, pm_message_t state) | |||
1929 | 1930 | ||
1930 | pci_disable_device(pci); | 1931 | pci_disable_device(pci); |
1931 | pci_save_state(pci); | 1932 | pci_save_state(pci); |
1932 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1933 | pci_set_power_state(pci, PCI_D3hot); |
1933 | return 0; | 1934 | return 0; |
1934 | } | 1935 | } |
1935 | 1936 | ||
1936 | static int ali_resume(struct pci_dev *pci) | 1937 | static int ali_resume(struct device *dev) |
1937 | { | 1938 | { |
1938 | struct snd_card *card = pci_get_drvdata(pci); | 1939 | struct pci_dev *pci = to_pci_dev(dev); |
1940 | struct snd_card *card = dev_get_drvdata(dev); | ||
1939 | struct snd_ali *chip = card->private_data; | 1941 | struct snd_ali *chip = card->private_data; |
1940 | struct snd_ali_image *im; | 1942 | struct snd_ali_image *im; |
1941 | int i, j; | 1943 | int i, j; |
@@ -1982,6 +1984,11 @@ static int ali_resume(struct pci_dev *pci) | |||
1982 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1984 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1983 | return 0; | 1985 | return 0; |
1984 | } | 1986 | } |
1987 | |||
1988 | static SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume); | ||
1989 | #define ALI_PM_OPS &ali_pm | ||
1990 | #else | ||
1991 | #define ALI_PM_OPS NULL | ||
1985 | #endif /* CONFIG_PM */ | 1992 | #endif /* CONFIG_PM */ |
1986 | 1993 | ||
1987 | static int snd_ali_free(struct snd_ali * codec) | 1994 | static int snd_ali_free(struct snd_ali * codec) |
@@ -2299,10 +2306,9 @@ static struct pci_driver ali5451_driver = { | |||
2299 | .id_table = snd_ali_ids, | 2306 | .id_table = snd_ali_ids, |
2300 | .probe = snd_ali_probe, | 2307 | .probe = snd_ali_probe, |
2301 | .remove = __devexit_p(snd_ali_remove), | 2308 | .remove = __devexit_p(snd_ali_remove), |
2302 | #ifdef CONFIG_PM | 2309 | .driver = { |
2303 | .suspend = ali_suspend, | 2310 | .pm = ALI_PM_OPS, |
2304 | .resume = ali_resume, | 2311 | }, |
2305 | #endif | ||
2306 | }; | 2312 | }; |
2307 | 2313 | ||
2308 | module_pci_driver(ali5451_driver); | 2314 | module_pci_driver(ali5451_driver); |