diff options
59 files changed, 496 insertions, 325 deletions
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h index e3005a674a24..34a2dd1614fa 100644 --- a/include/sound/cs46xx.h +++ b/include/sound/cs46xx.h | |||
@@ -1730,8 +1730,7 @@ int snd_cs46xx_create(struct snd_card *card, | |||
1730 | struct pci_dev *pci, | 1730 | struct pci_dev *pci, |
1731 | int external_amp, int thinkpad, | 1731 | int external_amp, int thinkpad, |
1732 | struct snd_cs46xx **rcodec); | 1732 | struct snd_cs46xx **rcodec); |
1733 | int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state); | 1733 | extern const struct dev_pm_ops snd_cs46xx_pm; |
1734 | int snd_cs46xx_resume(struct pci_dev *pci); | ||
1735 | 1734 | ||
1736 | int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); | 1735 | int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); |
1737 | int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); | 1736 | int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); |
diff --git a/include/sound/trident.h b/include/sound/trident.h index 9f191a0a1e19..06f0478103db 100644 --- a/include/sound/trident.h +++ b/include/sound/trident.h | |||
@@ -430,8 +430,7 @@ void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voi | |||
430 | void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice); | 430 | void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice); |
431 | void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice); | 431 | void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice); |
432 | void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice); | 432 | void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice); |
433 | int snd_trident_suspend(struct pci_dev *pci, pm_message_t state); | 433 | extern const struct dev_pm_ops snd_trident_pm; |
434 | int snd_trident_resume(struct pci_dev *pci); | ||
435 | 434 | ||
436 | /* TLB memory allocation */ | 435 | /* TLB memory allocation */ |
437 | struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident, | 436 | struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident, |
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 5456343ebe4c..4f67c762cd74 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h | |||
@@ -341,7 +341,7 @@ int vx_change_frequency(struct vx_core *chip); | |||
341 | /* | 341 | /* |
342 | * PM | 342 | * PM |
343 | */ | 343 | */ |
344 | int snd_vx_suspend(struct vx_core *card, pm_message_t state); | 344 | int snd_vx_suspend(struct vx_core *card); |
345 | int snd_vx_resume(struct vx_core *card); | 345 | int snd_vx_resume(struct vx_core *card); |
346 | 346 | ||
347 | /* | 347 | /* |
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index 41199664666b..238f118de6e1 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h | |||
@@ -377,8 +377,7 @@ int snd_ymfpci_create(struct snd_card *card, | |||
377 | struct snd_ymfpci ** rcodec); | 377 | struct snd_ymfpci ** rcodec); |
378 | void snd_ymfpci_free_gameport(struct snd_ymfpci *chip); | 378 | void snd_ymfpci_free_gameport(struct snd_ymfpci *chip); |
379 | 379 | ||
380 | int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state); | 380 | extern const struct dev_pm_ops snd_ymfpci_pm; |
381 | int snd_ymfpci_resume(struct pci_dev *pci); | ||
382 | 381 | ||
383 | int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | 382 | int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); |
384 | int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | 383 | int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); |
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index b8e515999bc2..de5055a3b0d0 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c | |||
@@ -725,7 +725,7 @@ EXPORT_SYMBOL(snd_vx_dsp_load); | |||
725 | /* | 725 | /* |
726 | * suspend | 726 | * suspend |
727 | */ | 727 | */ |
728 | int snd_vx_suspend(struct vx_core *chip, pm_message_t state) | 728 | int snd_vx_suspend(struct vx_core *chip) |
729 | { | 729 | { |
730 | unsigned int i; | 730 | unsigned int i; |
731 | 731 | ||
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); |
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 |
769 | static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state) | 769 | static 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 | ||
784 | static int snd_als300_resume(struct pci_dev *pci) | 785 | static 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 | |||
808 | static 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 | ||
807 | static int __devinit snd_als300_probe(struct pci_dev *pci, | 814 | static 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 | ||
866 | module_pci_driver(als300_driver); | 872 | module_pci_driver(als300_driver); |
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index 7d7f2598c748..0eeca49c5754 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c | |||
@@ -988,9 +988,10 @@ static void __devexit snd_card_als4000_remove(struct pci_dev *pci) | |||
988 | } | 988 | } |
989 | 989 | ||
990 | #ifdef CONFIG_PM | 990 | #ifdef CONFIG_PM |
991 | static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state) | 991 | static int snd_als4000_suspend(struct device *dev) |
992 | { | 992 | { |
993 | struct snd_card *card = pci_get_drvdata(pci); | 993 | struct pci_dev *pci = to_pci_dev(dev); |
994 | struct snd_card *card = dev_get_drvdata(dev); | ||
994 | struct snd_card_als4000 *acard = card->private_data; | 995 | struct snd_card_als4000 *acard = card->private_data; |
995 | struct snd_sb *chip = acard->chip; | 996 | struct snd_sb *chip = acard->chip; |
996 | 997 | ||
@@ -1001,13 +1002,14 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state) | |||
1001 | 1002 | ||
1002 | pci_disable_device(pci); | 1003 | pci_disable_device(pci); |
1003 | pci_save_state(pci); | 1004 | pci_save_state(pci); |
1004 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1005 | pci_set_power_state(pci, PCI_D3hot); |
1005 | return 0; | 1006 | return 0; |
1006 | } | 1007 | } |
1007 | 1008 | ||
1008 | static int snd_als4000_resume(struct pci_dev *pci) | 1009 | static int snd_als4000_resume(struct device *dev) |
1009 | { | 1010 | { |
1010 | struct snd_card *card = pci_get_drvdata(pci); | 1011 | struct pci_dev *pci = to_pci_dev(dev); |
1012 | struct snd_card *card = dev_get_drvdata(dev); | ||
1011 | struct snd_card_als4000 *acard = card->private_data; | 1013 | struct snd_card_als4000 *acard = card->private_data; |
1012 | struct snd_sb *chip = acard->chip; | 1014 | struct snd_sb *chip = acard->chip; |
1013 | 1015 | ||
@@ -1033,18 +1035,21 @@ static int snd_als4000_resume(struct pci_dev *pci) | |||
1033 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1035 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1034 | return 0; | 1036 | return 0; |
1035 | } | 1037 | } |
1036 | #endif /* CONFIG_PM */ | ||
1037 | 1038 | ||
1039 | static SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume); | ||
1040 | #define SND_ALS4000_PM_OPS &snd_als4000_pm | ||
1041 | #else | ||
1042 | #define SND_ALS4000_PM_OPS NULL | ||
1043 | #endif /* CONFIG_PM */ | ||
1038 | 1044 | ||
1039 | static struct pci_driver als4000_driver = { | 1045 | static struct pci_driver als4000_driver = { |
1040 | .name = KBUILD_MODNAME, | 1046 | .name = KBUILD_MODNAME, |
1041 | .id_table = snd_als4000_ids, | 1047 | .id_table = snd_als4000_ids, |
1042 | .probe = snd_card_als4000_probe, | 1048 | .probe = snd_card_als4000_probe, |
1043 | .remove = __devexit_p(snd_card_als4000_remove), | 1049 | .remove = __devexit_p(snd_card_als4000_remove), |
1044 | #ifdef CONFIG_PM | 1050 | .driver = { |
1045 | .suspend = snd_als4000_suspend, | 1051 | .pm = SND_ALS4000_PM_OPS, |
1046 | .resume = snd_als4000_resume, | 1052 | }, |
1047 | #endif | ||
1048 | }; | 1053 | }; |
1049 | 1054 | ||
1050 | module_pci_driver(als4000_driver); | 1055 | module_pci_driver(als4000_driver); |
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 156a94f8a123..31020d2a868b 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -1462,9 +1462,10 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock, | |||
1462 | /* | 1462 | /* |
1463 | * power management | 1463 | * power management |
1464 | */ | 1464 | */ |
1465 | static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | 1465 | static int snd_atiixp_suspend(struct device *dev) |
1466 | { | 1466 | { |
1467 | struct snd_card *card = pci_get_drvdata(pci); | 1467 | struct pci_dev *pci = to_pci_dev(dev); |
1468 | struct snd_card *card = dev_get_drvdata(dev); | ||
1468 | struct atiixp *chip = card->private_data; | 1469 | struct atiixp *chip = card->private_data; |
1469 | int i; | 1470 | int i; |
1470 | 1471 | ||
@@ -1484,13 +1485,14 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | |||
1484 | 1485 | ||
1485 | pci_disable_device(pci); | 1486 | pci_disable_device(pci); |
1486 | pci_save_state(pci); | 1487 | pci_save_state(pci); |
1487 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1488 | pci_set_power_state(pci, PCI_D3hot); |
1488 | return 0; | 1489 | return 0; |
1489 | } | 1490 | } |
1490 | 1491 | ||
1491 | static int snd_atiixp_resume(struct pci_dev *pci) | 1492 | static int snd_atiixp_resume(struct device *dev) |
1492 | { | 1493 | { |
1493 | struct snd_card *card = pci_get_drvdata(pci); | 1494 | struct pci_dev *pci = to_pci_dev(dev); |
1495 | struct snd_card *card = dev_get_drvdata(dev); | ||
1494 | struct atiixp *chip = card->private_data; | 1496 | struct atiixp *chip = card->private_data; |
1495 | int i; | 1497 | int i; |
1496 | 1498 | ||
@@ -1526,6 +1528,11 @@ static int snd_atiixp_resume(struct pci_dev *pci) | |||
1526 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1528 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1527 | return 0; | 1529 | return 0; |
1528 | } | 1530 | } |
1531 | |||
1532 | static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); | ||
1533 | #define SND_ATIIXP_PM_OPS &snd_atiixp_pm | ||
1534 | #else | ||
1535 | #define SND_ATIIXP_PM_OPS NULL | ||
1529 | #endif /* CONFIG_PM */ | 1536 | #endif /* CONFIG_PM */ |
1530 | 1537 | ||
1531 | 1538 | ||
@@ -1705,10 +1712,9 @@ static struct pci_driver atiixp_driver = { | |||
1705 | .id_table = snd_atiixp_ids, | 1712 | .id_table = snd_atiixp_ids, |
1706 | .probe = snd_atiixp_probe, | 1713 | .probe = snd_atiixp_probe, |
1707 | .remove = __devexit_p(snd_atiixp_remove), | 1714 | .remove = __devexit_p(snd_atiixp_remove), |
1708 | #ifdef CONFIG_PM | 1715 | .driver = { |
1709 | .suspend = snd_atiixp_suspend, | 1716 | .pm = SND_ATIIXP_PM_OPS, |
1710 | .resume = snd_atiixp_resume, | 1717 | }, |
1711 | #endif | ||
1712 | }; | 1718 | }; |
1713 | 1719 | ||
1714 | module_pci_driver(atiixp_driver); | 1720 | module_pci_driver(atiixp_driver); |
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 30a4fd96ce73..79e204ec623f 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c | |||
@@ -1117,9 +1117,10 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock) | |||
1117 | /* | 1117 | /* |
1118 | * power management | 1118 | * power management |
1119 | */ | 1119 | */ |
1120 | static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | 1120 | static int snd_atiixp_suspend(struct device *dev) |
1121 | { | 1121 | { |
1122 | struct snd_card *card = pci_get_drvdata(pci); | 1122 | struct pci_dev *pci = to_pci_dev(dev); |
1123 | struct snd_card *card = dev_get_drvdata(dev); | ||
1123 | struct atiixp_modem *chip = card->private_data; | 1124 | struct atiixp_modem *chip = card->private_data; |
1124 | int i; | 1125 | int i; |
1125 | 1126 | ||
@@ -1133,13 +1134,14 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state) | |||
1133 | 1134 | ||
1134 | pci_disable_device(pci); | 1135 | pci_disable_device(pci); |
1135 | pci_save_state(pci); | 1136 | pci_save_state(pci); |
1136 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1137 | pci_set_power_state(pci, PCI_D3hot); |
1137 | return 0; | 1138 | return 0; |
1138 | } | 1139 | } |
1139 | 1140 | ||
1140 | static int snd_atiixp_resume(struct pci_dev *pci) | 1141 | static int snd_atiixp_resume(struct device *dev) |
1141 | { | 1142 | { |
1142 | struct snd_card *card = pci_get_drvdata(pci); | 1143 | struct pci_dev *pci = to_pci_dev(dev); |
1144 | struct snd_card *card = dev_get_drvdata(dev); | ||
1143 | struct atiixp_modem *chip = card->private_data; | 1145 | struct atiixp_modem *chip = card->private_data; |
1144 | int i; | 1146 | int i; |
1145 | 1147 | ||
@@ -1162,8 +1164,12 @@ static int snd_atiixp_resume(struct pci_dev *pci) | |||
1162 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1164 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1163 | return 0; | 1165 | return 0; |
1164 | } | 1166 | } |
1165 | #endif /* CONFIG_PM */ | ||
1166 | 1167 | ||
1168 | static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); | ||
1169 | #define SND_ATIIXP_PM_OPS &snd_atiixp_pm | ||
1170 | #else | ||
1171 | #define SND_ATIIXP_PM_OPS NULL | ||
1172 | #endif /* CONFIG_PM */ | ||
1167 | 1173 | ||
1168 | #ifdef CONFIG_PROC_FS | 1174 | #ifdef CONFIG_PROC_FS |
1169 | /* | 1175 | /* |
@@ -1336,10 +1342,9 @@ static struct pci_driver atiixp_modem_driver = { | |||
1336 | .id_table = snd_atiixp_ids, | 1342 | .id_table = snd_atiixp_ids, |
1337 | .probe = snd_atiixp_probe, | 1343 | .probe = snd_atiixp_probe, |
1338 | .remove = __devexit_p(snd_atiixp_remove), | 1344 | .remove = __devexit_p(snd_atiixp_remove), |
1339 | #ifdef CONFIG_PM | 1345 | .driver = { |
1340 | .suspend = snd_atiixp_suspend, | 1346 | .pm = SND_ATIIXP_PM_OPS, |
1341 | .resume = snd_atiixp_resume, | 1347 | }, |
1342 | #endif | ||
1343 | }; | 1348 | }; |
1344 | 1349 | ||
1345 | module_pci_driver(atiixp_modem_driver); | 1350 | module_pci_driver(atiixp_modem_driver); |
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index f0b4d7493af5..4dddd871548b 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -2794,9 +2794,10 @@ snd_azf3328_resume_ac97(const struct snd_azf3328 *chip) | |||
2794 | } | 2794 | } |
2795 | 2795 | ||
2796 | static int | 2796 | static int |
2797 | snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state) | 2797 | snd_azf3328_suspend(struct device *dev) |
2798 | { | 2798 | { |
2799 | struct snd_card *card = pci_get_drvdata(pci); | 2799 | struct pci_dev *pci = to_pci_dev(dev); |
2800 | struct snd_card *card = dev_get_drvdata(dev); | ||
2800 | struct snd_azf3328 *chip = card->private_data; | 2801 | struct snd_azf3328 *chip = card->private_data; |
2801 | u16 *saved_regs_ctrl_u16; | 2802 | u16 *saved_regs_ctrl_u16; |
2802 | 2803 | ||
@@ -2824,14 +2825,15 @@ snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state) | |||
2824 | 2825 | ||
2825 | pci_disable_device(pci); | 2826 | pci_disable_device(pci); |
2826 | pci_save_state(pci); | 2827 | pci_save_state(pci); |
2827 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2828 | pci_set_power_state(pci, PCI_D3hot); |
2828 | return 0; | 2829 | return 0; |
2829 | } | 2830 | } |
2830 | 2831 | ||
2831 | static int | 2832 | static int |
2832 | snd_azf3328_resume(struct pci_dev *pci) | 2833 | snd_azf3328_resume(struct device *dev) |
2833 | { | 2834 | { |
2834 | struct snd_card *card = pci_get_drvdata(pci); | 2835 | struct pci_dev *pci = to_pci_dev(dev); |
2836 | struct snd_card *card = dev_get_drvdata(dev); | ||
2835 | const struct snd_azf3328 *chip = card->private_data; | 2837 | const struct snd_azf3328 *chip = card->private_data; |
2836 | 2838 | ||
2837 | pci_set_power_state(pci, PCI_D0); | 2839 | pci_set_power_state(pci, PCI_D0); |
@@ -2859,18 +2861,21 @@ snd_azf3328_resume(struct pci_dev *pci) | |||
2859 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2861 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2860 | return 0; | 2862 | return 0; |
2861 | } | 2863 | } |
2862 | #endif /* CONFIG_PM */ | ||
2863 | 2864 | ||
2865 | static SIMPLE_DEV_PM_OPS(snd_azf3328_pm, snd_azf3328_suspend, snd_azf3328_resume); | ||
2866 | #define SND_AZF3328_PM_OPS &snd_azf3328_pm | ||
2867 | #else | ||
2868 | #define SND_AZF3328_PM_OPS NULL | ||
2869 | #endif /* CONFIG_PM */ | ||
2864 | 2870 | ||
2865 | static struct pci_driver azf3328_driver = { | 2871 | static struct pci_driver azf3328_driver = { |
2866 | .name = KBUILD_MODNAME, | 2872 | .name = KBUILD_MODNAME, |
2867 | .id_table = snd_azf3328_ids, | 2873 | .id_table = snd_azf3328_ids, |
2868 | .probe = snd_azf3328_probe, | 2874 | .probe = snd_azf3328_probe, |
2869 | .remove = __devexit_p(snd_azf3328_remove), | 2875 | .remove = __devexit_p(snd_azf3328_remove), |
2870 | #ifdef CONFIG_PM | 2876 | .driver = { |
2871 | .suspend = snd_azf3328_suspend, | 2877 | .pm = SND_AZF3328_PM_OPS, |
2872 | .resume = snd_azf3328_resume, | 2878 | }, |
2873 | #endif | ||
2874 | }; | 2879 | }; |
2875 | 2880 | ||
2876 | module_pci_driver(azf3328_driver); | 2881 | module_pci_driver(azf3328_driver); |
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index e76d68a7081f..83277b747b36 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -1872,9 +1872,10 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci) | |||
1872 | } | 1872 | } |
1873 | 1873 | ||
1874 | #ifdef CONFIG_PM | 1874 | #ifdef CONFIG_PM |
1875 | static int snd_ca0106_suspend(struct pci_dev *pci, pm_message_t state) | 1875 | static int snd_ca0106_suspend(struct device *dev) |
1876 | { | 1876 | { |
1877 | struct snd_card *card = pci_get_drvdata(pci); | 1877 | struct pci_dev *pci = to_pci_dev(dev); |
1878 | struct snd_card *card = dev_get_drvdata(dev); | ||
1878 | struct snd_ca0106 *chip = card->private_data; | 1879 | struct snd_ca0106 *chip = card->private_data; |
1879 | int i; | 1880 | int i; |
1880 | 1881 | ||
@@ -1889,13 +1890,14 @@ static int snd_ca0106_suspend(struct pci_dev *pci, pm_message_t state) | |||
1889 | 1890 | ||
1890 | pci_disable_device(pci); | 1891 | pci_disable_device(pci); |
1891 | pci_save_state(pci); | 1892 | pci_save_state(pci); |
1892 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1893 | pci_set_power_state(pci, PCI_D3hot); |
1893 | return 0; | 1894 | return 0; |
1894 | } | 1895 | } |
1895 | 1896 | ||
1896 | static int snd_ca0106_resume(struct pci_dev *pci) | 1897 | static int snd_ca0106_resume(struct device *dev) |
1897 | { | 1898 | { |
1898 | struct snd_card *card = pci_get_drvdata(pci); | 1899 | struct pci_dev *pci = to_pci_dev(dev); |
1900 | struct snd_card *card = dev_get_drvdata(dev); | ||
1899 | struct snd_ca0106 *chip = card->private_data; | 1901 | struct snd_ca0106 *chip = card->private_data; |
1900 | int i; | 1902 | int i; |
1901 | 1903 | ||
@@ -1922,6 +1924,11 @@ static int snd_ca0106_resume(struct pci_dev *pci) | |||
1922 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1924 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1923 | return 0; | 1925 | return 0; |
1924 | } | 1926 | } |
1927 | |||
1928 | static SIMPLE_DEV_PM_OPS(snd_ca0106_pm, snd_ca0106_suspend, snd_ca0106_resume); | ||
1929 | #define SND_CA0106_PM_OPS &snd_ca0106_pm | ||
1930 | #else | ||
1931 | #define SND_CA0106_PM_OPS NULL | ||
1925 | #endif | 1932 | #endif |
1926 | 1933 | ||
1927 | // PCI IDs | 1934 | // PCI IDs |
@@ -1937,10 +1944,9 @@ static struct pci_driver ca0106_driver = { | |||
1937 | .id_table = snd_ca0106_ids, | 1944 | .id_table = snd_ca0106_ids, |
1938 | .probe = snd_ca0106_probe, | 1945 | .probe = snd_ca0106_probe, |
1939 | .remove = __devexit_p(snd_ca0106_remove), | 1946 | .remove = __devexit_p(snd_ca0106_remove), |
1940 | #ifdef CONFIG_PM | 1947 | .driver = { |
1941 | .suspend = snd_ca0106_suspend, | 1948 | .pm = SND_CA0106_PM_OPS, |
1942 | .resume = snd_ca0106_resume, | 1949 | }, |
1943 | #endif | ||
1944 | }; | 1950 | }; |
1945 | 1951 | ||
1946 | module_pci_driver(ca0106_driver); | 1952 | module_pci_driver(ca0106_driver); |
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 3815bd4c6779..b7d6f2b886ef 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -3338,9 +3338,10 @@ static unsigned char saved_mixers[] = { | |||
3338 | SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, | 3338 | SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, |
3339 | }; | 3339 | }; |
3340 | 3340 | ||
3341 | static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state) | 3341 | static int snd_cmipci_suspend(struct device *dev) |
3342 | { | 3342 | { |
3343 | struct snd_card *card = pci_get_drvdata(pci); | 3343 | struct pci_dev *pci = to_pci_dev(dev); |
3344 | struct snd_card *card = dev_get_drvdata(dev); | ||
3344 | struct cmipci *cm = card->private_data; | 3345 | struct cmipci *cm = card->private_data; |
3345 | int i; | 3346 | int i; |
3346 | 3347 | ||
@@ -3361,13 +3362,14 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state) | |||
3361 | 3362 | ||
3362 | pci_disable_device(pci); | 3363 | pci_disable_device(pci); |
3363 | pci_save_state(pci); | 3364 | pci_save_state(pci); |
3364 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 3365 | pci_set_power_state(pci, PCI_D3hot); |
3365 | return 0; | 3366 | return 0; |
3366 | } | 3367 | } |
3367 | 3368 | ||
3368 | static int snd_cmipci_resume(struct pci_dev *pci) | 3369 | static int snd_cmipci_resume(struct device *dev) |
3369 | { | 3370 | { |
3370 | struct snd_card *card = pci_get_drvdata(pci); | 3371 | struct pci_dev *pci = to_pci_dev(dev); |
3372 | struct snd_card *card = dev_get_drvdata(dev); | ||
3371 | struct cmipci *cm = card->private_data; | 3373 | struct cmipci *cm = card->private_data; |
3372 | int i; | 3374 | int i; |
3373 | 3375 | ||
@@ -3396,6 +3398,11 @@ static int snd_cmipci_resume(struct pci_dev *pci) | |||
3396 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 3398 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
3397 | return 0; | 3399 | return 0; |
3398 | } | 3400 | } |
3401 | |||
3402 | static SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume); | ||
3403 | #define SND_CMIPCI_PM_OPS &snd_cmipci_pm | ||
3404 | #else | ||
3405 | #define SND_CMIPCI_PM_OPS NULL | ||
3399 | #endif /* CONFIG_PM */ | 3406 | #endif /* CONFIG_PM */ |
3400 | 3407 | ||
3401 | static struct pci_driver cmipci_driver = { | 3408 | static struct pci_driver cmipci_driver = { |
@@ -3403,10 +3410,9 @@ static struct pci_driver cmipci_driver = { | |||
3403 | .id_table = snd_cmipci_ids, | 3410 | .id_table = snd_cmipci_ids, |
3404 | .probe = snd_cmipci_probe, | 3411 | .probe = snd_cmipci_probe, |
3405 | .remove = __devexit_p(snd_cmipci_remove), | 3412 | .remove = __devexit_p(snd_cmipci_remove), |
3406 | #ifdef CONFIG_PM | 3413 | .driver = { |
3407 | .suspend = snd_cmipci_suspend, | 3414 | .pm = SND_CMIPCI_PM_OPS, |
3408 | .resume = snd_cmipci_resume, | 3415 | }, |
3409 | #endif | ||
3410 | }; | 3416 | }; |
3411 | 3417 | ||
3412 | module_pci_driver(cmipci_driver); | 3418 | module_pci_driver(cmipci_driver); |
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 33506ee569bd..45a8317085f4 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c | |||
@@ -1997,9 +1997,10 @@ static int saved_regs[SUSPEND_REGISTERS] = { | |||
1997 | 1997 | ||
1998 | #define CLKCR1_CKRA 0x00010000L | 1998 | #define CLKCR1_CKRA 0x00010000L |
1999 | 1999 | ||
2000 | static int cs4281_suspend(struct pci_dev *pci, pm_message_t state) | 2000 | static int cs4281_suspend(struct device *dev) |
2001 | { | 2001 | { |
2002 | struct snd_card *card = pci_get_drvdata(pci); | 2002 | struct pci_dev *pci = to_pci_dev(dev); |
2003 | struct snd_card *card = dev_get_drvdata(dev); | ||
2003 | struct cs4281 *chip = card->private_data; | 2004 | struct cs4281 *chip = card->private_data; |
2004 | u32 ulCLK; | 2005 | u32 ulCLK; |
2005 | unsigned int i; | 2006 | unsigned int i; |
@@ -2040,13 +2041,14 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state) | |||
2040 | 2041 | ||
2041 | pci_disable_device(pci); | 2042 | pci_disable_device(pci); |
2042 | pci_save_state(pci); | 2043 | pci_save_state(pci); |
2043 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2044 | pci_set_power_state(pci, PCI_D3hot); |
2044 | return 0; | 2045 | return 0; |
2045 | } | 2046 | } |
2046 | 2047 | ||
2047 | static int cs4281_resume(struct pci_dev *pci) | 2048 | static int cs4281_resume(struct device *dev) |
2048 | { | 2049 | { |
2049 | struct snd_card *card = pci_get_drvdata(pci); | 2050 | struct pci_dev *pci = to_pci_dev(dev); |
2051 | struct snd_card *card = dev_get_drvdata(dev); | ||
2050 | struct cs4281 *chip = card->private_data; | 2052 | struct cs4281 *chip = card->private_data; |
2051 | unsigned int i; | 2053 | unsigned int i; |
2052 | u32 ulCLK; | 2054 | u32 ulCLK; |
@@ -2082,6 +2084,11 @@ static int cs4281_resume(struct pci_dev *pci) | |||
2082 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2084 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2083 | return 0; | 2085 | return 0; |
2084 | } | 2086 | } |
2087 | |||
2088 | static SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume); | ||
2089 | #define CS4281_PM_OPS &cs4281_pm | ||
2090 | #else | ||
2091 | #define CS4281_PM_OPS NULL | ||
2085 | #endif /* CONFIG_PM */ | 2092 | #endif /* CONFIG_PM */ |
2086 | 2093 | ||
2087 | static struct pci_driver cs4281_driver = { | 2094 | static struct pci_driver cs4281_driver = { |
@@ -2089,10 +2096,9 @@ static struct pci_driver cs4281_driver = { | |||
2089 | .id_table = snd_cs4281_ids, | 2096 | .id_table = snd_cs4281_ids, |
2090 | .probe = snd_cs4281_probe, | 2097 | .probe = snd_cs4281_probe, |
2091 | .remove = __devexit_p(snd_cs4281_remove), | 2098 | .remove = __devexit_p(snd_cs4281_remove), |
2092 | #ifdef CONFIG_PM | 2099 | .driver = { |
2093 | .suspend = cs4281_suspend, | 2100 | .pm = CS4281_PM_OPS, |
2094 | .resume = cs4281_resume, | 2101 | }, |
2095 | #endif | ||
2096 | }; | 2102 | }; |
2097 | 2103 | ||
2098 | module_pci_driver(cs4281_driver); | 2104 | module_pci_driver(cs4281_driver); |
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c index 6cc7404e0e8f..00e03bc9a762 100644 --- a/sound/pci/cs46xx/cs46xx.c +++ b/sound/pci/cs46xx/cs46xx.c | |||
@@ -167,8 +167,9 @@ static struct pci_driver cs46xx_driver = { | |||
167 | .probe = snd_card_cs46xx_probe, | 167 | .probe = snd_card_cs46xx_probe, |
168 | .remove = __devexit_p(snd_card_cs46xx_remove), | 168 | .remove = __devexit_p(snd_card_cs46xx_remove), |
169 | #ifdef CONFIG_PM | 169 | #ifdef CONFIG_PM |
170 | .suspend = snd_cs46xx_suspend, | 170 | .driver = { |
171 | .resume = snd_cs46xx_resume, | 171 | .pm = &snd_cs46xx_pm, |
172 | }, | ||
172 | #endif | 173 | #endif |
173 | }; | 174 | }; |
174 | 175 | ||
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 4fa53161b094..28b9747becc9 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -3599,9 +3599,10 @@ static unsigned int saved_regs[] = { | |||
3599 | BA1_CVOL, | 3599 | BA1_CVOL, |
3600 | }; | 3600 | }; |
3601 | 3601 | ||
3602 | int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state) | 3602 | static int snd_cs46xx_suspend(struct device *dev) |
3603 | { | 3603 | { |
3604 | struct snd_card *card = pci_get_drvdata(pci); | 3604 | struct pci_dev *pci = to_pci_dev(dev); |
3605 | struct snd_card *card = dev_get_drvdata(dev); | ||
3605 | struct snd_cs46xx *chip = card->private_data; | 3606 | struct snd_cs46xx *chip = card->private_data; |
3606 | int i, amp_saved; | 3607 | int i, amp_saved; |
3607 | 3608 | ||
@@ -3628,13 +3629,14 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
3628 | 3629 | ||
3629 | pci_disable_device(pci); | 3630 | pci_disable_device(pci); |
3630 | pci_save_state(pci); | 3631 | pci_save_state(pci); |
3631 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 3632 | pci_set_power_state(pci, PCI_D3hot); |
3632 | return 0; | 3633 | return 0; |
3633 | } | 3634 | } |
3634 | 3635 | ||
3635 | int snd_cs46xx_resume(struct pci_dev *pci) | 3636 | static int snd_cs46xx_resume(struct device *dev) |
3636 | { | 3637 | { |
3637 | struct snd_card *card = pci_get_drvdata(pci); | 3638 | struct pci_dev *pci = to_pci_dev(dev); |
3639 | struct snd_card *card = dev_get_drvdata(dev); | ||
3638 | struct snd_cs46xx *chip = card->private_data; | 3640 | struct snd_cs46xx *chip = card->private_data; |
3639 | int amp_saved; | 3641 | int amp_saved; |
3640 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 3642 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
@@ -3707,6 +3709,8 @@ int snd_cs46xx_resume(struct pci_dev *pci) | |||
3707 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 3709 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
3708 | return 0; | 3710 | return 0; |
3709 | } | 3711 | } |
3712 | |||
3713 | SIMPLE_DEV_PM_OPS(snd_cs46xx_pm, snd_cs46xx_suspend, snd_cs46xx_resume); | ||
3710 | #endif /* CONFIG_PM */ | 3714 | #endif /* CONFIG_PM */ |
3711 | 3715 | ||
3712 | 3716 | ||
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 2c9697cf0a1a..51f64ba5facf 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c | |||
@@ -400,8 +400,9 @@ static struct pci_driver cs5535audio_driver = { | |||
400 | .probe = snd_cs5535audio_probe, | 400 | .probe = snd_cs5535audio_probe, |
401 | .remove = __devexit_p(snd_cs5535audio_remove), | 401 | .remove = __devexit_p(snd_cs5535audio_remove), |
402 | #ifdef CONFIG_PM | 402 | #ifdef CONFIG_PM |
403 | .suspend = snd_cs5535audio_suspend, | 403 | .driver = { |
404 | .resume = snd_cs5535audio_resume, | 404 | .pm = &snd_cs5535audio_pm, |
405 | }, | ||
405 | #endif | 406 | #endif |
406 | }; | 407 | }; |
407 | 408 | ||
diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h index 51966d782a3c..bb3cc641130c 100644 --- a/sound/pci/cs5535audio/cs5535audio.h +++ b/sound/pci/cs5535audio/cs5535audio.h | |||
@@ -94,10 +94,7 @@ struct cs5535audio { | |||
94 | struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS]; | 94 | struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS]; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | #ifdef CONFIG_PM | 97 | extern const struct dev_pm_ops snd_cs5535audio_pm; |
98 | int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state); | ||
99 | int snd_cs5535audio_resume(struct pci_dev *pci); | ||
100 | #endif | ||
101 | 98 | ||
102 | #ifdef CONFIG_OLPC | 99 | #ifdef CONFIG_OLPC |
103 | void __devinit olpc_prequirks(struct snd_card *card, | 100 | void __devinit olpc_prequirks(struct snd_card *card, |
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c index 185b00088320..6c34def5986d 100644 --- a/sound/pci/cs5535audio/cs5535audio_pm.c +++ b/sound/pci/cs5535audio/cs5535audio_pm.c | |||
@@ -55,9 +55,10 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au) | |||
55 | 55 | ||
56 | } | 56 | } |
57 | 57 | ||
58 | int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state) | 58 | static int snd_cs5535audio_suspend(struct device *dev) |
59 | { | 59 | { |
60 | struct snd_card *card = pci_get_drvdata(pci); | 60 | struct pci_dev *pci = to_pci_dev(dev); |
61 | struct snd_card *card = dev_get_drvdata(dev); | ||
61 | struct cs5535audio *cs5535au = card->private_data; | 62 | struct cs5535audio *cs5535au = card->private_data; |
62 | int i; | 63 | int i; |
63 | 64 | ||
@@ -77,13 +78,14 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state) | |||
77 | return -EIO; | 78 | return -EIO; |
78 | } | 79 | } |
79 | pci_disable_device(pci); | 80 | pci_disable_device(pci); |
80 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 81 | pci_set_power_state(pci, PCI_D3hot); |
81 | return 0; | 82 | return 0; |
82 | } | 83 | } |
83 | 84 | ||
84 | int snd_cs5535audio_resume(struct pci_dev *pci) | 85 | static int snd_cs5535audio_resume(struct device *dev) |
85 | { | 86 | { |
86 | struct snd_card *card = pci_get_drvdata(pci); | 87 | struct pci_dev *pci = to_pci_dev(dev); |
88 | struct snd_card *card = dev_get_drvdata(dev); | ||
87 | struct cs5535audio *cs5535au = card->private_data; | 89 | struct cs5535audio *cs5535au = card->private_data; |
88 | u32 tmp; | 90 | u32 tmp; |
89 | int timeout; | 91 | int timeout; |
@@ -129,3 +131,4 @@ int snd_cs5535audio_resume(struct pci_dev *pci) | |||
129 | return 0; | 131 | return 0; |
130 | } | 132 | } |
131 | 133 | ||
134 | SIMPLE_DEV_PM_OPS(snd_cs5535audio_pm, snd_cs5535audio_suspend, snd_cs5535audio_resume); | ||
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index d8a4423539ce..8e40262d4117 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
@@ -1537,7 +1537,7 @@ static void atc_connect_resources(struct ct_atc *atc) | |||
1537 | } | 1537 | } |
1538 | 1538 | ||
1539 | #ifdef CONFIG_PM | 1539 | #ifdef CONFIG_PM |
1540 | static int atc_suspend(struct ct_atc *atc, pm_message_t state) | 1540 | static int atc_suspend(struct ct_atc *atc) |
1541 | { | 1541 | { |
1542 | int i; | 1542 | int i; |
1543 | struct hw *hw = atc->hw; | 1543 | struct hw *hw = atc->hw; |
@@ -1553,7 +1553,7 @@ static int atc_suspend(struct ct_atc *atc, pm_message_t state) | |||
1553 | 1553 | ||
1554 | atc_release_resources(atc); | 1554 | atc_release_resources(atc); |
1555 | 1555 | ||
1556 | hw->suspend(hw, state); | 1556 | hw->suspend(hw); |
1557 | 1557 | ||
1558 | return 0; | 1558 | return 0; |
1559 | } | 1559 | } |
diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h index 3a0def656af0..653e813ad142 100644 --- a/sound/pci/ctxfi/ctatc.h +++ b/sound/pci/ctxfi/ctatc.h | |||
@@ -144,7 +144,7 @@ struct ct_atc { | |||
144 | struct ct_timer *timer; | 144 | struct ct_timer *timer; |
145 | 145 | ||
146 | #ifdef CONFIG_PM | 146 | #ifdef CONFIG_PM |
147 | int (*suspend)(struct ct_atc *atc, pm_message_t state); | 147 | int (*suspend)(struct ct_atc *atc); |
148 | int (*resume)(struct ct_atc *atc); | 148 | int (*resume)(struct ct_atc *atc); |
149 | #define NUM_PCMS (NUM_CTALSADEVS - 1) | 149 | #define NUM_PCMS (NUM_CTALSADEVS - 1) |
150 | struct snd_pcm *pcms[NUM_PCMS]; | 150 | struct snd_pcm *pcms[NUM_PCMS]; |
diff --git a/sound/pci/ctxfi/cthardware.h b/sound/pci/ctxfi/cthardware.h index 908315bec3b4..c56fe533b3f3 100644 --- a/sound/pci/ctxfi/cthardware.h +++ b/sound/pci/ctxfi/cthardware.h | |||
@@ -73,7 +73,7 @@ struct hw { | |||
73 | int (*card_stop)(struct hw *hw); | 73 | int (*card_stop)(struct hw *hw); |
74 | int (*pll_init)(struct hw *hw, unsigned int rsr); | 74 | int (*pll_init)(struct hw *hw, unsigned int rsr); |
75 | #ifdef CONFIG_PM | 75 | #ifdef CONFIG_PM |
76 | int (*suspend)(struct hw *hw, pm_message_t state); | 76 | int (*suspend)(struct hw *hw); |
77 | int (*resume)(struct hw *hw, struct card_conf *info); | 77 | int (*resume)(struct hw *hw, struct card_conf *info); |
78 | #endif | 78 | #endif |
79 | int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source); | 79 | int (*is_adc_source_selected)(struct hw *hw, enum ADCSRC source); |
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index a7df19791f5a..dc1969bc67d4 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c | |||
@@ -2086,7 +2086,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
2086 | } | 2086 | } |
2087 | 2087 | ||
2088 | #ifdef CONFIG_PM | 2088 | #ifdef CONFIG_PM |
2089 | static int hw_suspend(struct hw *hw, pm_message_t state) | 2089 | static int hw_suspend(struct hw *hw) |
2090 | { | 2090 | { |
2091 | struct pci_dev *pci = hw->pci; | 2091 | struct pci_dev *pci = hw->pci; |
2092 | 2092 | ||
@@ -2099,7 +2099,7 @@ static int hw_suspend(struct hw *hw, pm_message_t state) | |||
2099 | 2099 | ||
2100 | pci_disable_device(pci); | 2100 | pci_disable_device(pci); |
2101 | pci_save_state(pci); | 2101 | pci_save_state(pci); |
2102 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2102 | pci_set_power_state(pci, PCI_D3hot); |
2103 | 2103 | ||
2104 | return 0; | 2104 | return 0; |
2105 | } | 2105 | } |
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index d6c54b524bfa..9d1231dc4ae2 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c | |||
@@ -2202,7 +2202,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) | |||
2202 | } | 2202 | } |
2203 | 2203 | ||
2204 | #ifdef CONFIG_PM | 2204 | #ifdef CONFIG_PM |
2205 | static int hw_suspend(struct hw *hw, pm_message_t state) | 2205 | static int hw_suspend(struct hw *hw) |
2206 | { | 2206 | { |
2207 | struct pci_dev *pci = hw->pci; | 2207 | struct pci_dev *pci = hw->pci; |
2208 | 2208 | ||
@@ -2210,7 +2210,7 @@ static int hw_suspend(struct hw *hw, pm_message_t state) | |||
2210 | 2210 | ||
2211 | pci_disable_device(pci); | 2211 | pci_disable_device(pci); |
2212 | pci_save_state(pci); | 2212 | pci_save_state(pci); |
2213 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2213 | pci_set_power_state(pci, PCI_D3hot); |
2214 | 2214 | ||
2215 | return 0; | 2215 | return 0; |
2216 | } | 2216 | } |
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c index 75aa2c338410..e002183ef8b2 100644 --- a/sound/pci/ctxfi/xfi.c +++ b/sound/pci/ctxfi/xfi.c | |||
@@ -126,21 +126,26 @@ static void __devexit ct_card_remove(struct pci_dev *pci) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | #ifdef CONFIG_PM | 128 | #ifdef CONFIG_PM |
129 | static int ct_card_suspend(struct pci_dev *pci, pm_message_t state) | 129 | static int ct_card_suspend(struct device *dev) |
130 | { | 130 | { |
131 | struct snd_card *card = pci_get_drvdata(pci); | 131 | struct snd_card *card = dev_get_drvdata(dev); |
132 | struct ct_atc *atc = card->private_data; | 132 | struct ct_atc *atc = card->private_data; |
133 | 133 | ||
134 | return atc->suspend(atc, state); | 134 | return atc->suspend(atc); |
135 | } | 135 | } |
136 | 136 | ||
137 | static int ct_card_resume(struct pci_dev *pci) | 137 | static int ct_card_resume(struct device *dev) |
138 | { | 138 | { |
139 | struct snd_card *card = pci_get_drvdata(pci); | 139 | struct snd_card *card = dev_get_drvdata(dev); |
140 | struct ct_atc *atc = card->private_data; | 140 | struct ct_atc *atc = card->private_data; |
141 | 141 | ||
142 | return atc->resume(atc); | 142 | return atc->resume(atc); |
143 | } | 143 | } |
144 | |||
145 | static SIMPLE_DEV_PM_OPS(ct_card_pm, ct_card_suspend, ct_card_resume); | ||
146 | #define CT_CARD_PM_OPS &ct_card_pm | ||
147 | #else | ||
148 | #define CT_CARD_PM_OPS NULL | ||
144 | #endif | 149 | #endif |
145 | 150 | ||
146 | static struct pci_driver ct_driver = { | 151 | static struct pci_driver ct_driver = { |
@@ -148,10 +153,9 @@ static struct pci_driver ct_driver = { | |||
148 | .id_table = ct_pci_dev_ids, | 153 | .id_table = ct_pci_dev_ids, |
149 | .probe = ct_card_probe, | 154 | .probe = ct_card_probe, |
150 | .remove = __devexit_p(ct_card_remove), | 155 | .remove = __devexit_p(ct_card_remove), |
151 | #ifdef CONFIG_PM | 156 | .driver = { |
152 | .suspend = ct_card_suspend, | 157 | .pm = CT_CARD_PM_OPS, |
153 | .resume = ct_card_resume, | 158 | }, |
154 | #endif | ||
155 | }; | 159 | }; |
156 | 160 | ||
157 | module_pci_driver(ct_driver); | 161 | module_pci_driver(ct_driver); |
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 0f8eda1dafdb..0ff754f180d0 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -2205,9 +2205,10 @@ ctl_error: | |||
2205 | 2205 | ||
2206 | #if defined(CONFIG_PM) | 2206 | #if defined(CONFIG_PM) |
2207 | 2207 | ||
2208 | static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state) | 2208 | static int snd_echo_suspend(struct device *dev) |
2209 | { | 2209 | { |
2210 | struct echoaudio *chip = pci_get_drvdata(pci); | 2210 | struct pci_dev *pci = to_pci_dev(dev); |
2211 | struct echoaudio *chip = dev_get_drvdata(dev); | ||
2211 | 2212 | ||
2212 | DE_INIT(("suspend start\n")); | 2213 | DE_INIT(("suspend start\n")); |
2213 | snd_pcm_suspend_all(chip->analog_pcm); | 2214 | snd_pcm_suspend_all(chip->analog_pcm); |
@@ -2242,9 +2243,10 @@ static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state) | |||
2242 | 2243 | ||
2243 | 2244 | ||
2244 | 2245 | ||
2245 | static int snd_echo_resume(struct pci_dev *pci) | 2246 | static int snd_echo_resume(struct device *dev) |
2246 | { | 2247 | { |
2247 | struct echoaudio *chip = pci_get_drvdata(pci); | 2248 | struct pci_dev *pci = to_pci_dev(dev); |
2249 | struct echoaudio *chip = dev_get_drvdata(dev); | ||
2248 | struct comm_page *commpage, *commpage_bak; | 2250 | struct comm_page *commpage, *commpage_bak; |
2249 | u32 pipe_alloc_mask; | 2251 | u32 pipe_alloc_mask; |
2250 | int err; | 2252 | int err; |
@@ -2307,10 +2309,13 @@ static int snd_echo_resume(struct pci_dev *pci) | |||
2307 | return 0; | 2309 | return 0; |
2308 | } | 2310 | } |
2309 | 2311 | ||
2312 | static SIMPLE_DEV_PM_OPS(snd_echo_pm, snd_echo_suspend, snd_echo_resume); | ||
2313 | #define SND_ECHO_PM_OPS &snd_echo_pm | ||
2314 | #else | ||
2315 | #define SND_ECHO_PM_OPS NULL | ||
2310 | #endif /* CONFIG_PM */ | 2316 | #endif /* CONFIG_PM */ |
2311 | 2317 | ||
2312 | 2318 | ||
2313 | |||
2314 | static void __devexit snd_echo_remove(struct pci_dev *pci) | 2319 | static void __devexit snd_echo_remove(struct pci_dev *pci) |
2315 | { | 2320 | { |
2316 | struct echoaudio *chip; | 2321 | struct echoaudio *chip; |
@@ -2333,10 +2338,9 @@ static struct pci_driver echo_driver = { | |||
2333 | .id_table = snd_echo_ids, | 2338 | .id_table = snd_echo_ids, |
2334 | .probe = snd_echo_probe, | 2339 | .probe = snd_echo_probe, |
2335 | .remove = __devexit_p(snd_echo_remove), | 2340 | .remove = __devexit_p(snd_echo_remove), |
2336 | #ifdef CONFIG_PM | 2341 | .driver = { |
2337 | .suspend = snd_echo_suspend, | 2342 | .pm = SND_ECHO_PM_OPS, |
2338 | .resume = snd_echo_resume, | 2343 | }, |
2339 | #endif /* CONFIG_PM */ | ||
2340 | }; | 2344 | }; |
2341 | 2345 | ||
2342 | module_pci_driver(echo_driver); | 2346 | module_pci_driver(echo_driver); |
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index 7fdbbe4d9965..ddac4e6d660d 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c | |||
@@ -207,9 +207,10 @@ static void __devexit snd_card_emu10k1_remove(struct pci_dev *pci) | |||
207 | 207 | ||
208 | 208 | ||
209 | #ifdef CONFIG_PM | 209 | #ifdef CONFIG_PM |
210 | static int snd_emu10k1_suspend(struct pci_dev *pci, pm_message_t state) | 210 | static int snd_emu10k1_suspend(struct device *dev) |
211 | { | 211 | { |
212 | struct snd_card *card = pci_get_drvdata(pci); | 212 | struct pci_dev *pci = to_pci_dev(dev); |
213 | struct snd_card *card = dev_get_drvdata(dev); | ||
213 | struct snd_emu10k1 *emu = card->private_data; | 214 | struct snd_emu10k1 *emu = card->private_data; |
214 | 215 | ||
215 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 216 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -231,13 +232,14 @@ static int snd_emu10k1_suspend(struct pci_dev *pci, pm_message_t state) | |||
231 | 232 | ||
232 | pci_disable_device(pci); | 233 | pci_disable_device(pci); |
233 | pci_save_state(pci); | 234 | pci_save_state(pci); |
234 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 235 | pci_set_power_state(pci, PCI_D3hot); |
235 | return 0; | 236 | return 0; |
236 | } | 237 | } |
237 | 238 | ||
238 | static int snd_emu10k1_resume(struct pci_dev *pci) | 239 | static int snd_emu10k1_resume(struct device *dev) |
239 | { | 240 | { |
240 | struct snd_card *card = pci_get_drvdata(pci); | 241 | struct pci_dev *pci = to_pci_dev(dev); |
242 | struct snd_card *card = dev_get_drvdata(dev); | ||
241 | struct snd_emu10k1 *emu = card->private_data; | 243 | struct snd_emu10k1 *emu = card->private_data; |
242 | 244 | ||
243 | pci_set_power_state(pci, PCI_D0); | 245 | pci_set_power_state(pci, PCI_D0); |
@@ -261,17 +263,21 @@ static int snd_emu10k1_resume(struct pci_dev *pci) | |||
261 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 263 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
262 | return 0; | 264 | return 0; |
263 | } | 265 | } |
264 | #endif | 266 | |
267 | static SIMPLE_DEV_PM_OPS(snd_emu10k1_pm, snd_emu10k1_suspend, snd_emu10k1_resume); | ||
268 | #define SND_EMU10K1_PM_OPS &snd_emu10k1_pm | ||
269 | #else | ||
270 | #define SND_EMU10K1_PM_OPS NULL | ||
271 | #endif /* CONFIG_PM */ | ||
265 | 272 | ||
266 | static struct pci_driver emu10k1_driver = { | 273 | static struct pci_driver emu10k1_driver = { |
267 | .name = KBUILD_MODNAME, | 274 | .name = KBUILD_MODNAME, |
268 | .id_table = snd_emu10k1_ids, | 275 | .id_table = snd_emu10k1_ids, |
269 | .probe = snd_card_emu10k1_probe, | 276 | .probe = snd_card_emu10k1_probe, |
270 | .remove = __devexit_p(snd_card_emu10k1_remove), | 277 | .remove = __devexit_p(snd_card_emu10k1_remove), |
271 | #ifdef CONFIG_PM | 278 | .driver = { |
272 | .suspend = snd_emu10k1_suspend, | 279 | .pm = SND_EMU10K1_PM_OPS, |
273 | .resume = snd_emu10k1_resume, | 280 | }, |
274 | #endif | ||
275 | }; | 281 | }; |
276 | 282 | ||
277 | module_pci_driver(emu10k1_driver); | 283 | module_pci_driver(emu10k1_driver); |
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 3821c81d1c99..f7e6f73186e1 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -2033,9 +2033,10 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq) | |||
2033 | } | 2033 | } |
2034 | 2034 | ||
2035 | #ifdef CONFIG_PM | 2035 | #ifdef CONFIG_PM |
2036 | static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state) | 2036 | static int snd_ensoniq_suspend(struct device *dev) |
2037 | { | 2037 | { |
2038 | struct snd_card *card = pci_get_drvdata(pci); | 2038 | struct pci_dev *pci = to_pci_dev(dev); |
2039 | struct snd_card *card = dev_get_drvdata(dev); | ||
2039 | struct ensoniq *ensoniq = card->private_data; | 2040 | struct ensoniq *ensoniq = card->private_data; |
2040 | 2041 | ||
2041 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2042 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -2058,13 +2059,14 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state) | |||
2058 | 2059 | ||
2059 | pci_disable_device(pci); | 2060 | pci_disable_device(pci); |
2060 | pci_save_state(pci); | 2061 | pci_save_state(pci); |
2061 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2062 | pci_set_power_state(pci, PCI_D3hot); |
2062 | return 0; | 2063 | return 0; |
2063 | } | 2064 | } |
2064 | 2065 | ||
2065 | static int snd_ensoniq_resume(struct pci_dev *pci) | 2066 | static int snd_ensoniq_resume(struct device *dev) |
2066 | { | 2067 | { |
2067 | struct snd_card *card = pci_get_drvdata(pci); | 2068 | struct pci_dev *pci = to_pci_dev(dev); |
2069 | struct snd_card *card = dev_get_drvdata(dev); | ||
2068 | struct ensoniq *ensoniq = card->private_data; | 2070 | struct ensoniq *ensoniq = card->private_data; |
2069 | 2071 | ||
2070 | pci_set_power_state(pci, PCI_D0); | 2072 | pci_set_power_state(pci, PCI_D0); |
@@ -2087,8 +2089,12 @@ static int snd_ensoniq_resume(struct pci_dev *pci) | |||
2087 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2089 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2088 | return 0; | 2090 | return 0; |
2089 | } | 2091 | } |
2090 | #endif /* CONFIG_PM */ | ||
2091 | 2092 | ||
2093 | static SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume); | ||
2094 | #define SND_ENSONIQ_PM_OPS &snd_ensoniq_pm | ||
2095 | #else | ||
2096 | #define SND_ENSONIQ_PM_OPS NULL | ||
2097 | #endif /* CONFIG_PM */ | ||
2092 | 2098 | ||
2093 | static int __devinit snd_ensoniq_create(struct snd_card *card, | 2099 | static int __devinit snd_ensoniq_create(struct snd_card *card, |
2094 | struct pci_dev *pci, | 2100 | struct pci_dev *pci, |
@@ -2493,10 +2499,9 @@ static struct pci_driver ens137x_driver = { | |||
2493 | .id_table = snd_audiopci_ids, | 2499 | .id_table = snd_audiopci_ids, |
2494 | .probe = snd_audiopci_probe, | 2500 | .probe = snd_audiopci_probe, |
2495 | .remove = __devexit_p(snd_audiopci_remove), | 2501 | .remove = __devexit_p(snd_audiopci_remove), |
2496 | #ifdef CONFIG_PM | 2502 | .driver = { |
2497 | .suspend = snd_ensoniq_suspend, | 2503 | .pm = SND_ENSONIQ_PM_OPS, |
2498 | .resume = snd_ensoniq_resume, | 2504 | }, |
2499 | #endif | ||
2500 | }; | 2505 | }; |
2501 | 2506 | ||
2502 | module_pci_driver(ens137x_driver); | 2507 | module_pci_driver(ens137x_driver); |
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 82c8d8c5c52a..227dff70069f 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1474,9 +1474,10 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = { | |||
1474 | }; | 1474 | }; |
1475 | 1475 | ||
1476 | 1476 | ||
1477 | static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | 1477 | static int es1938_suspend(struct device *dev) |
1478 | { | 1478 | { |
1479 | struct snd_card *card = pci_get_drvdata(pci); | 1479 | struct pci_dev *pci = to_pci_dev(dev); |
1480 | struct snd_card *card = dev_get_drvdata(dev); | ||
1480 | struct es1938 *chip = card->private_data; | 1481 | struct es1938 *chip = card->private_data; |
1481 | unsigned char *s, *d; | 1482 | unsigned char *s, *d; |
1482 | 1483 | ||
@@ -1494,13 +1495,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | |||
1494 | } | 1495 | } |
1495 | pci_disable_device(pci); | 1496 | pci_disable_device(pci); |
1496 | pci_save_state(pci); | 1497 | pci_save_state(pci); |
1497 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1498 | pci_set_power_state(pci, PCI_D3hot); |
1498 | return 0; | 1499 | return 0; |
1499 | } | 1500 | } |
1500 | 1501 | ||
1501 | static int es1938_resume(struct pci_dev *pci) | 1502 | static int es1938_resume(struct device *dev) |
1502 | { | 1503 | { |
1503 | struct snd_card *card = pci_get_drvdata(pci); | 1504 | struct pci_dev *pci = to_pci_dev(dev); |
1505 | struct snd_card *card = dev_get_drvdata(dev); | ||
1504 | struct es1938 *chip = card->private_data; | 1506 | struct es1938 *chip = card->private_data; |
1505 | unsigned char *s, *d; | 1507 | unsigned char *s, *d; |
1506 | 1508 | ||
@@ -1534,6 +1536,11 @@ static int es1938_resume(struct pci_dev *pci) | |||
1534 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1536 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1535 | return 0; | 1537 | return 0; |
1536 | } | 1538 | } |
1539 | |||
1540 | static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); | ||
1541 | #define ES1938_PM_OPS &es1938_pm | ||
1542 | #else | ||
1543 | #define ES1938_PM_OPS NULL | ||
1537 | #endif /* CONFIG_PM */ | 1544 | #endif /* CONFIG_PM */ |
1538 | 1545 | ||
1539 | #ifdef SUPPORT_JOYSTICK | 1546 | #ifdef SUPPORT_JOYSTICK |
@@ -1887,10 +1894,9 @@ static struct pci_driver es1938_driver = { | |||
1887 | .id_table = snd_es1938_ids, | 1894 | .id_table = snd_es1938_ids, |
1888 | .probe = snd_es1938_probe, | 1895 | .probe = snd_es1938_probe, |
1889 | .remove = __devexit_p(snd_es1938_remove), | 1896 | .remove = __devexit_p(snd_es1938_remove), |
1890 | #ifdef CONFIG_PM | 1897 | .driver = { |
1891 | .suspend = es1938_suspend, | 1898 | .pm = ES1938_PM_OPS, |
1892 | .resume = es1938_resume, | 1899 | }, |
1893 | #endif | ||
1894 | }; | 1900 | }; |
1895 | 1901 | ||
1896 | module_pci_driver(es1938_driver); | 1902 | module_pci_driver(es1938_driver); |
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 52b5c0bf90c1..fb4c90b99c00 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
@@ -2381,9 +2381,10 @@ static void snd_es1968_start_irq(struct es1968 *chip) | |||
2381 | /* | 2381 | /* |
2382 | * PM support | 2382 | * PM support |
2383 | */ | 2383 | */ |
2384 | static int es1968_suspend(struct pci_dev *pci, pm_message_t state) | 2384 | static int es1968_suspend(struct device *dev) |
2385 | { | 2385 | { |
2386 | struct snd_card *card = pci_get_drvdata(pci); | 2386 | struct pci_dev *pci = to_pci_dev(dev); |
2387 | struct snd_card *card = dev_get_drvdata(dev); | ||
2387 | struct es1968 *chip = card->private_data; | 2388 | struct es1968 *chip = card->private_data; |
2388 | 2389 | ||
2389 | if (! chip->do_pm) | 2390 | if (! chip->do_pm) |
@@ -2398,13 +2399,14 @@ static int es1968_suspend(struct pci_dev *pci, pm_message_t state) | |||
2398 | 2399 | ||
2399 | pci_disable_device(pci); | 2400 | pci_disable_device(pci); |
2400 | pci_save_state(pci); | 2401 | pci_save_state(pci); |
2401 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2402 | pci_set_power_state(pci, PCI_D3hot); |
2402 | return 0; | 2403 | return 0; |
2403 | } | 2404 | } |
2404 | 2405 | ||
2405 | static int es1968_resume(struct pci_dev *pci) | 2406 | static int es1968_resume(struct device *dev) |
2406 | { | 2407 | { |
2407 | struct snd_card *card = pci_get_drvdata(pci); | 2408 | struct pci_dev *pci = to_pci_dev(dev); |
2409 | struct snd_card *card = dev_get_drvdata(dev); | ||
2408 | struct es1968 *chip = card->private_data; | 2410 | struct es1968 *chip = card->private_data; |
2409 | struct esschan *es; | 2411 | struct esschan *es; |
2410 | 2412 | ||
@@ -2454,6 +2456,11 @@ static int es1968_resume(struct pci_dev *pci) | |||
2454 | chip->in_suspend = 0; | 2456 | chip->in_suspend = 0; |
2455 | return 0; | 2457 | return 0; |
2456 | } | 2458 | } |
2459 | |||
2460 | static SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume); | ||
2461 | #define ES1968_PM_OPS &es1968_pm | ||
2462 | #else | ||
2463 | #define ES1968_PM_OPS NULL | ||
2457 | #endif /* CONFIG_PM */ | 2464 | #endif /* CONFIG_PM */ |
2458 | 2465 | ||
2459 | #ifdef SUPPORT_JOYSTICK | 2466 | #ifdef SUPPORT_JOYSTICK |
@@ -2903,10 +2910,9 @@ static struct pci_driver es1968_driver = { | |||
2903 | .id_table = snd_es1968_ids, | 2910 | .id_table = snd_es1968_ids, |
2904 | .probe = snd_es1968_probe, | 2911 | .probe = snd_es1968_probe, |
2905 | .remove = __devexit_p(snd_es1968_remove), | 2912 | .remove = __devexit_p(snd_es1968_remove), |
2906 | #ifdef CONFIG_PM | 2913 | .driver = { |
2907 | .suspend = es1968_suspend, | 2914 | .pm = ES1968_PM_OPS, |
2908 | .resume = es1968_resume, | 2915 | }, |
2909 | #endif | ||
2910 | }; | 2916 | }; |
2911 | 2917 | ||
2912 | module_pci_driver(es1968_driver); | 2918 | module_pci_driver(es1968_driver); |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index b32e8024ea86..522c8706f244 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1369,9 +1369,10 @@ static unsigned char saved_regs[] = { | |||
1369 | FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL, | 1369 | FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL, |
1370 | }; | 1370 | }; |
1371 | 1371 | ||
1372 | static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | 1372 | static int snd_fm801_suspend(struct device *dev) |
1373 | { | 1373 | { |
1374 | struct snd_card *card = pci_get_drvdata(pci); | 1374 | struct pci_dev *pci = to_pci_dev(dev); |
1375 | struct snd_card *card = dev_get_drvdata(dev); | ||
1375 | struct fm801 *chip = card->private_data; | 1376 | struct fm801 *chip = card->private_data; |
1376 | int i; | 1377 | int i; |
1377 | 1378 | ||
@@ -1385,13 +1386,14 @@ static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | |||
1385 | 1386 | ||
1386 | pci_disable_device(pci); | 1387 | pci_disable_device(pci); |
1387 | pci_save_state(pci); | 1388 | pci_save_state(pci); |
1388 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1389 | pci_set_power_state(pci, PCI_D3hot); |
1389 | return 0; | 1390 | return 0; |
1390 | } | 1391 | } |
1391 | 1392 | ||
1392 | static int snd_fm801_resume(struct pci_dev *pci) | 1393 | static int snd_fm801_resume(struct device *dev) |
1393 | { | 1394 | { |
1394 | struct snd_card *card = pci_get_drvdata(pci); | 1395 | struct pci_dev *pci = to_pci_dev(dev); |
1396 | struct snd_card *card = dev_get_drvdata(dev); | ||
1395 | struct fm801 *chip = card->private_data; | 1397 | struct fm801 *chip = card->private_data; |
1396 | int i; | 1398 | int i; |
1397 | 1399 | ||
@@ -1414,17 +1416,21 @@ static int snd_fm801_resume(struct pci_dev *pci) | |||
1414 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1416 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1415 | return 0; | 1417 | return 0; |
1416 | } | 1418 | } |
1417 | #endif | 1419 | |
1420 | static SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume); | ||
1421 | #define SND_FM801_PM_OPS &snd_fm801_pm | ||
1422 | #else | ||
1423 | #define SND_FM801_PM_OPS NULL | ||
1424 | #endif /* CONFIG_PM */ | ||
1418 | 1425 | ||
1419 | static struct pci_driver fm801_driver = { | 1426 | static struct pci_driver fm801_driver = { |
1420 | .name = KBUILD_MODNAME, | 1427 | .name = KBUILD_MODNAME, |
1421 | .id_table = snd_fm801_ids, | 1428 | .id_table = snd_fm801_ids, |
1422 | .probe = snd_card_fm801_probe, | 1429 | .probe = snd_card_fm801_probe, |
1423 | .remove = __devexit_p(snd_card_fm801_remove), | 1430 | .remove = __devexit_p(snd_card_fm801_remove), |
1424 | #ifdef CONFIG_PM | 1431 | .driver = { |
1425 | .suspend = snd_fm801_suspend, | 1432 | .pm = SND_FM801_PM_OPS, |
1426 | .resume = snd_fm801_resume, | 1433 | }, |
1427 | #endif | ||
1428 | }; | 1434 | }; |
1429 | 1435 | ||
1430 | module_pci_driver(fm801_driver); | 1436 | module_pci_driver(fm801_driver); |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 51cb2a2e4fce..f4c274c5144b 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3545,7 +3545,7 @@ static inline void hda_exec_init_verbs(struct hda_codec *codec) {} | |||
3545 | static void hda_call_codec_suspend(struct hda_codec *codec) | 3545 | static void hda_call_codec_suspend(struct hda_codec *codec) |
3546 | { | 3546 | { |
3547 | if (codec->patch_ops.suspend) | 3547 | if (codec->patch_ops.suspend) |
3548 | codec->patch_ops.suspend(codec, PMSG_SUSPEND); | 3548 | codec->patch_ops.suspend(codec); |
3549 | hda_cleanup_all_streams(codec); | 3549 | hda_cleanup_all_streams(codec); |
3550 | hda_set_power_state(codec, | 3550 | hda_set_power_state(codec, |
3551 | codec->afg ? codec->afg : codec->mfg, | 3551 | codec->afg ? codec->afg : codec->mfg, |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 2fdaadbb4326..5aab408dcb6a 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -703,7 +703,7 @@ struct hda_codec_ops { | |||
703 | void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, | 703 | void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, |
704 | unsigned int power_state); | 704 | unsigned int power_state); |
705 | #ifdef CONFIG_PM | 705 | #ifdef CONFIG_PM |
706 | int (*suspend)(struct hda_codec *codec, pm_message_t state); | 706 | int (*suspend)(struct hda_codec *codec); |
707 | int (*resume)(struct hda_codec *codec); | 707 | int (*resume)(struct hda_codec *codec); |
708 | #endif | 708 | #endif |
709 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 709 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 7757536b9d5f..a69ec7448714 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2403,9 +2403,10 @@ static void azx_power_notify(struct hda_bus *bus) | |||
2403 | * power management | 2403 | * power management |
2404 | */ | 2404 | */ |
2405 | 2405 | ||
2406 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) | 2406 | static int azx_suspend(struct device *dev) |
2407 | { | 2407 | { |
2408 | struct snd_card *card = pci_get_drvdata(pci); | 2408 | struct pci_dev *pci = to_pci_dev(dev); |
2409 | struct snd_card *card = dev_get_drvdata(dev); | ||
2409 | struct azx *chip = card->private_data; | 2410 | struct azx *chip = card->private_data; |
2410 | struct azx_pcm *p; | 2411 | struct azx_pcm *p; |
2411 | 2412 | ||
@@ -2424,13 +2425,14 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2424 | pci_disable_msi(chip->pci); | 2425 | pci_disable_msi(chip->pci); |
2425 | pci_disable_device(pci); | 2426 | pci_disable_device(pci); |
2426 | pci_save_state(pci); | 2427 | pci_save_state(pci); |
2427 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2428 | pci_set_power_state(pci, PCI_D3hot); |
2428 | return 0; | 2429 | return 0; |
2429 | } | 2430 | } |
2430 | 2431 | ||
2431 | static int azx_resume(struct pci_dev *pci) | 2432 | static int azx_resume(struct device *dev) |
2432 | { | 2433 | { |
2433 | struct snd_card *card = pci_get_drvdata(pci); | 2434 | struct pci_dev *pci = to_pci_dev(dev); |
2435 | struct snd_card *card = dev_get_drvdata(dev); | ||
2434 | struct azx *chip = card->private_data; | 2436 | struct azx *chip = card->private_data; |
2435 | 2437 | ||
2436 | pci_set_power_state(pci, PCI_D0); | 2438 | pci_set_power_state(pci, PCI_D0); |
@@ -2455,6 +2457,12 @@ static int azx_resume(struct pci_dev *pci) | |||
2455 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2457 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2456 | return 0; | 2458 | return 0; |
2457 | } | 2459 | } |
2460 | static SIMPLE_DEV_PM_OPS(azx_pm, azx_suspend, azx_resume); | ||
2461 | #define AZX_PM_OPS &azx_pm | ||
2462 | #else | ||
2463 | #define azx_suspend(dev) | ||
2464 | #define azx_resume(dev) | ||
2465 | #define AZX_PM_OPS NULL | ||
2458 | #endif /* CONFIG_PM */ | 2466 | #endif /* CONFIG_PM */ |
2459 | 2467 | ||
2460 | 2468 | ||
@@ -2521,13 +2529,13 @@ static void azx_vs_set_state(struct pci_dev *pci, | |||
2521 | disabled ? "Disabling" : "Enabling", | 2529 | disabled ? "Disabling" : "Enabling", |
2522 | pci_name(chip->pci)); | 2530 | pci_name(chip->pci)); |
2523 | if (disabled) { | 2531 | if (disabled) { |
2524 | azx_suspend(pci, PMSG_FREEZE); | 2532 | azx_suspend(&pci->dev); |
2525 | chip->disabled = true; | 2533 | chip->disabled = true; |
2526 | snd_hda_lock_devices(chip->bus); | 2534 | snd_hda_lock_devices(chip->bus); |
2527 | } else { | 2535 | } else { |
2528 | snd_hda_unlock_devices(chip->bus); | 2536 | snd_hda_unlock_devices(chip->bus); |
2529 | chip->disabled = false; | 2537 | chip->disabled = false; |
2530 | azx_resume(pci); | 2538 | azx_resume(&pci->dev); |
2531 | } | 2539 | } |
2532 | } | 2540 | } |
2533 | } | 2541 | } |
@@ -3398,10 +3406,9 @@ static struct pci_driver azx_driver = { | |||
3398 | .id_table = azx_ids, | 3406 | .id_table = azx_ids, |
3399 | .probe = azx_probe, | 3407 | .probe = azx_probe, |
3400 | .remove = __devexit_p(azx_remove), | 3408 | .remove = __devexit_p(azx_remove), |
3401 | #ifdef CONFIG_PM | 3409 | .driver = { |
3402 | .suspend = azx_suspend, | 3410 | .pm = AZX_PM_OPS, |
3403 | .resume = azx_resume, | 3411 | }, |
3404 | #endif | ||
3405 | }; | 3412 | }; |
3406 | 3413 | ||
3407 | module_pci_driver(azx_driver); | 3414 | module_pci_driver(azx_driver); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index d8b2d6dee986..0208fa121e5a 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -642,7 +642,7 @@ static void ad198x_free(struct hda_codec *codec) | |||
642 | } | 642 | } |
643 | 643 | ||
644 | #ifdef CONFIG_PM | 644 | #ifdef CONFIG_PM |
645 | static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) | 645 | static int ad198x_suspend(struct hda_codec *codec) |
646 | { | 646 | { |
647 | ad198x_shutup(codec); | 647 | ad198x_shutup(codec); |
648 | return 0; | 648 | return 0; |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 9647ed4d7929..0c4c1a61b378 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -1892,7 +1892,7 @@ static int cs421x_parse_auto_config(struct hda_codec *codec) | |||
1892 | Manage PDREF, when transitioning to D3hot | 1892 | Manage PDREF, when transitioning to D3hot |
1893 | (DAC,ADC) -> D3, PDREF=1, AFG->D3 | 1893 | (DAC,ADC) -> D3, PDREF=1, AFG->D3 |
1894 | */ | 1894 | */ |
1895 | static int cs421x_suspend(struct hda_codec *codec, pm_message_t state) | 1895 | static int cs421x_suspend(struct hda_codec *codec) |
1896 | { | 1896 | { |
1897 | struct cs_spec *spec = codec->spec; | 1897 | struct cs_spec *spec = codec->spec; |
1898 | unsigned int coef; | 1898 | unsigned int coef; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 2bf99fc1cbf2..14361184ae1e 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -554,7 +554,7 @@ static int conexant_build_controls(struct hda_codec *codec) | |||
554 | } | 554 | } |
555 | 555 | ||
556 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 556 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
557 | static int conexant_suspend(struct hda_codec *codec, pm_message_t state) | 557 | static int conexant_suspend(struct hda_codec *codec) |
558 | { | 558 | { |
559 | snd_hda_shutup_pins(codec); | 559 | snd_hda_shutup_pins(codec); |
560 | return 0; | 560 | return 0; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 5ccf10a4d593..ab2c729b88ea 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2300,7 +2300,7 @@ static void alc_power_eapd(struct hda_codec *codec) | |||
2300 | alc_auto_setup_eapd(codec, false); | 2300 | alc_auto_setup_eapd(codec, false); |
2301 | } | 2301 | } |
2302 | 2302 | ||
2303 | static int alc_suspend(struct hda_codec *codec, pm_message_t state) | 2303 | static int alc_suspend(struct hda_codec *codec) |
2304 | { | 2304 | { |
2305 | struct alc_spec *spec = codec->spec; | 2305 | struct alc_spec *spec = codec->spec; |
2306 | alc_shutup(codec); | 2306 | alc_shutup(codec); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 07675282015a..a1596a3b171c 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4997,7 +4997,7 @@ static int stac92xx_resume(struct hda_codec *codec) | |||
4997 | return 0; | 4997 | return 0; |
4998 | } | 4998 | } |
4999 | 4999 | ||
5000 | static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) | 5000 | static int stac92xx_suspend(struct hda_codec *codec) |
5001 | { | 5001 | { |
5002 | stac92xx_shutup(codec); | 5002 | stac92xx_shutup(codec); |
5003 | return 0; | 5003 | return 0; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 82b368068e08..90645560ed39 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1748,7 +1748,7 @@ static void via_unsol_event(struct hda_codec *codec, | |||
1748 | } | 1748 | } |
1749 | 1749 | ||
1750 | #ifdef CONFIG_PM | 1750 | #ifdef CONFIG_PM |
1751 | static int via_suspend(struct hda_codec *codec, pm_message_t state) | 1751 | static int via_suspend(struct hda_codec *codec) |
1752 | { | 1752 | { |
1753 | struct via_spec *spec = codec->spec; | 1753 | struct via_spec *spec = codec->spec; |
1754 | vt1708_stop_hp_work(spec); | 1754 | vt1708_stop_hp_work(spec); |
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); |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index f4e2dd4da8cf..cd553f592e2d 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -2624,9 +2624,10 @@ static int snd_intel8x0_free(struct intel8x0 *chip) | |||
2624 | /* | 2624 | /* |
2625 | * power management | 2625 | * power management |
2626 | */ | 2626 | */ |
2627 | static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | 2627 | static int intel8x0_suspend(struct device *dev) |
2628 | { | 2628 | { |
2629 | struct snd_card *card = pci_get_drvdata(pci); | 2629 | struct pci_dev *pci = to_pci_dev(dev); |
2630 | struct snd_card *card = dev_get_drvdata(dev); | ||
2630 | struct intel8x0 *chip = card->private_data; | 2631 | struct intel8x0 *chip = card->private_data; |
2631 | int i; | 2632 | int i; |
2632 | 2633 | ||
@@ -2658,13 +2659,14 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | |||
2658 | /* The call below may disable built-in speaker on some laptops | 2659 | /* The call below may disable built-in speaker on some laptops |
2659 | * after S2RAM. So, don't touch it. | 2660 | * after S2RAM. So, don't touch it. |
2660 | */ | 2661 | */ |
2661 | /* pci_set_power_state(pci, pci_choose_state(pci, state)); */ | 2662 | /* pci_set_power_state(pci, PCI_D3hot); */ |
2662 | return 0; | 2663 | return 0; |
2663 | } | 2664 | } |
2664 | 2665 | ||
2665 | static int intel8x0_resume(struct pci_dev *pci) | 2666 | static int intel8x0_resume(struct device *dev) |
2666 | { | 2667 | { |
2667 | struct snd_card *card = pci_get_drvdata(pci); | 2668 | struct pci_dev *pci = to_pci_dev(dev); |
2669 | struct snd_card *card = dev_get_drvdata(dev); | ||
2668 | struct intel8x0 *chip = card->private_data; | 2670 | struct intel8x0 *chip = card->private_data; |
2669 | int i; | 2671 | int i; |
2670 | 2672 | ||
@@ -2734,6 +2736,11 @@ static int intel8x0_resume(struct pci_dev *pci) | |||
2734 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2736 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2735 | return 0; | 2737 | return 0; |
2736 | } | 2738 | } |
2739 | |||
2740 | static SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume); | ||
2741 | #define INTEL8X0_PM_OPS &intel8x0_pm | ||
2742 | #else | ||
2743 | #define INTEL8X0_PM_OPS NULL | ||
2737 | #endif /* CONFIG_PM */ | 2744 | #endif /* CONFIG_PM */ |
2738 | 2745 | ||
2739 | #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ | 2746 | #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ |
@@ -3343,10 +3350,9 @@ static struct pci_driver intel8x0_driver = { | |||
3343 | .id_table = snd_intel8x0_ids, | 3350 | .id_table = snd_intel8x0_ids, |
3344 | .probe = snd_intel8x0_probe, | 3351 | .probe = snd_intel8x0_probe, |
3345 | .remove = __devexit_p(snd_intel8x0_remove), | 3352 | .remove = __devexit_p(snd_intel8x0_remove), |
3346 | #ifdef CONFIG_PM | 3353 | .driver = { |
3347 | .suspend = intel8x0_suspend, | 3354 | .pm = INTEL8X0_PM_OPS, |
3348 | .resume = intel8x0_resume, | 3355 | }, |
3349 | #endif | ||
3350 | }; | 3356 | }; |
3351 | 3357 | ||
3352 | module_pci_driver(intel8x0_driver); | 3358 | module_pci_driver(intel8x0_driver); |
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index fc27a6a69e77..da44bb3f8e7a 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -1012,9 +1012,10 @@ static int snd_intel8x0m_free(struct intel8x0m *chip) | |||
1012 | /* | 1012 | /* |
1013 | * power management | 1013 | * power management |
1014 | */ | 1014 | */ |
1015 | static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state) | 1015 | static int intel8x0m_suspend(struct device *dev) |
1016 | { | 1016 | { |
1017 | struct snd_card *card = pci_get_drvdata(pci); | 1017 | struct pci_dev *pci = to_pci_dev(dev); |
1018 | struct snd_card *card = dev_get_drvdata(dev); | ||
1018 | struct intel8x0m *chip = card->private_data; | 1019 | struct intel8x0m *chip = card->private_data; |
1019 | int i; | 1020 | int i; |
1020 | 1021 | ||
@@ -1028,13 +1029,14 @@ static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state) | |||
1028 | } | 1029 | } |
1029 | pci_disable_device(pci); | 1030 | pci_disable_device(pci); |
1030 | pci_save_state(pci); | 1031 | pci_save_state(pci); |
1031 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1032 | pci_set_power_state(pci, PCI_D3hot); |
1032 | return 0; | 1033 | return 0; |
1033 | } | 1034 | } |
1034 | 1035 | ||
1035 | static int intel8x0m_resume(struct pci_dev *pci) | 1036 | static int intel8x0m_resume(struct device *dev) |
1036 | { | 1037 | { |
1037 | struct snd_card *card = pci_get_drvdata(pci); | 1038 | struct pci_dev *pci = to_pci_dev(dev); |
1039 | struct snd_card *card = dev_get_drvdata(dev); | ||
1038 | struct intel8x0m *chip = card->private_data; | 1040 | struct intel8x0m *chip = card->private_data; |
1039 | 1041 | ||
1040 | pci_set_power_state(pci, PCI_D0); | 1042 | pci_set_power_state(pci, PCI_D0); |
@@ -1060,6 +1062,11 @@ static int intel8x0m_resume(struct pci_dev *pci) | |||
1060 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1062 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1061 | return 0; | 1063 | return 0; |
1062 | } | 1064 | } |
1065 | |||
1066 | static SIMPLE_DEV_PM_OPS(intel8x0m_pm, intel8x0m_suspend, intel8x0m_resume); | ||
1067 | #define INTEL8X0M_PM_OPS &intel8x0m_pm | ||
1068 | #else | ||
1069 | #define INTEL8X0M_PM_OPS NULL | ||
1063 | #endif /* CONFIG_PM */ | 1070 | #endif /* CONFIG_PM */ |
1064 | 1071 | ||
1065 | #ifdef CONFIG_PROC_FS | 1072 | #ifdef CONFIG_PROC_FS |
@@ -1329,10 +1336,9 @@ static struct pci_driver intel8x0m_driver = { | |||
1329 | .id_table = snd_intel8x0m_ids, | 1336 | .id_table = snd_intel8x0m_ids, |
1330 | .probe = snd_intel8x0m_probe, | 1337 | .probe = snd_intel8x0m_probe, |
1331 | .remove = __devexit_p(snd_intel8x0m_remove), | 1338 | .remove = __devexit_p(snd_intel8x0m_remove), |
1332 | #ifdef CONFIG_PM | 1339 | .driver = { |
1333 | .suspend = intel8x0m_suspend, | 1340 | .pm = INTEL8X0M_PM_OPS, |
1334 | .resume = intel8x0m_resume, | 1341 | }, |
1335 | #endif | ||
1336 | }; | 1342 | }; |
1337 | 1343 | ||
1338 | module_pci_driver(intel8x0m_driver); | 1344 | module_pci_driver(intel8x0m_driver); |
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 |
2462 | static int m3_suspend(struct pci_dev *pci, pm_message_t state) | 2462 | static 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 | ||
2496 | static int m3_resume(struct pci_dev *pci) | 2497 | static 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 | |||
2552 | static 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 | ||
2851 | module_pci_driver(m3_driver); | 2857 | module_pci_driver(m3_driver); |
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 8159b05ee94d..465cff25b146 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c | |||
@@ -1382,9 +1382,10 @@ snd_nm256_peek_for_sig(struct nm256 *chip) | |||
1382 | * APM event handler, so the card is properly reinitialized after a power | 1382 | * APM event handler, so the card is properly reinitialized after a power |
1383 | * event. | 1383 | * event. |
1384 | */ | 1384 | */ |
1385 | static int nm256_suspend(struct pci_dev *pci, pm_message_t state) | 1385 | static int nm256_suspend(struct device *dev) |
1386 | { | 1386 | { |
1387 | struct snd_card *card = pci_get_drvdata(pci); | 1387 | struct pci_dev *pci = to_pci_dev(dev); |
1388 | struct snd_card *card = dev_get_drvdata(dev); | ||
1388 | struct nm256 *chip = card->private_data; | 1389 | struct nm256 *chip = card->private_data; |
1389 | 1390 | ||
1390 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1391 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -1393,13 +1394,14 @@ static int nm256_suspend(struct pci_dev *pci, pm_message_t state) | |||
1393 | chip->coeffs_current = 0; | 1394 | chip->coeffs_current = 0; |
1394 | pci_disable_device(pci); | 1395 | pci_disable_device(pci); |
1395 | pci_save_state(pci); | 1396 | pci_save_state(pci); |
1396 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1397 | pci_set_power_state(pci, PCI_D3hot); |
1397 | return 0; | 1398 | return 0; |
1398 | } | 1399 | } |
1399 | 1400 | ||
1400 | static int nm256_resume(struct pci_dev *pci) | 1401 | static int nm256_resume(struct device *dev) |
1401 | { | 1402 | { |
1402 | struct snd_card *card = pci_get_drvdata(pci); | 1403 | struct pci_dev *pci = to_pci_dev(dev); |
1404 | struct snd_card *card = dev_get_drvdata(dev); | ||
1403 | struct nm256 *chip = card->private_data; | 1405 | struct nm256 *chip = card->private_data; |
1404 | int i; | 1406 | int i; |
1405 | 1407 | ||
@@ -1434,6 +1436,11 @@ static int nm256_resume(struct pci_dev *pci) | |||
1434 | chip->in_resume = 0; | 1436 | chip->in_resume = 0; |
1435 | return 0; | 1437 | return 0; |
1436 | } | 1438 | } |
1439 | |||
1440 | static SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume); | ||
1441 | #define NM256_PM_OPS &nm256_pm | ||
1442 | #else | ||
1443 | #define NM256_PM_OPS NULL | ||
1437 | #endif /* CONFIG_PM */ | 1444 | #endif /* CONFIG_PM */ |
1438 | 1445 | ||
1439 | static int snd_nm256_free(struct nm256 *chip) | 1446 | static int snd_nm256_free(struct nm256 *chip) |
@@ -1747,10 +1754,9 @@ static struct pci_driver nm256_driver = { | |||
1747 | .id_table = snd_nm256_ids, | 1754 | .id_table = snd_nm256_ids, |
1748 | .probe = snd_nm256_probe, | 1755 | .probe = snd_nm256_probe, |
1749 | .remove = __devexit_p(snd_nm256_remove), | 1756 | .remove = __devexit_p(snd_nm256_remove), |
1750 | #ifdef CONFIG_PM | 1757 | .driver = { |
1751 | .suspend = nm256_suspend, | 1758 | .pm = NM256_PM_OPS, |
1752 | .resume = nm256_resume, | 1759 | }, |
1753 | #endif | ||
1754 | }; | 1760 | }; |
1755 | 1761 | ||
1756 | module_pci_driver(nm256_driver); | 1762 | module_pci_driver(nm256_driver); |
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 610275bfbaeb..37520a2b4dcf 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -873,8 +873,9 @@ static struct pci_driver oxygen_driver = { | |||
873 | .probe = generic_oxygen_probe, | 873 | .probe = generic_oxygen_probe, |
874 | .remove = __devexit_p(oxygen_pci_remove), | 874 | .remove = __devexit_p(oxygen_pci_remove), |
875 | #ifdef CONFIG_PM | 875 | #ifdef CONFIG_PM |
876 | .suspend = oxygen_pci_suspend, | 876 | .driver = { |
877 | .resume = oxygen_pci_resume, | 877 | .pm = &oxygen_pci_pm, |
878 | }, | ||
878 | #endif | 879 | #endif |
879 | }; | 880 | }; |
880 | 881 | ||
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h index f53897a708b4..7112a89fb8bd 100644 --- a/sound/pci/oxygen/oxygen.h +++ b/sound/pci/oxygen/oxygen.h | |||
@@ -162,8 +162,7 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, | |||
162 | ); | 162 | ); |
163 | void oxygen_pci_remove(struct pci_dev *pci); | 163 | void oxygen_pci_remove(struct pci_dev *pci); |
164 | #ifdef CONFIG_PM | 164 | #ifdef CONFIG_PM |
165 | int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state); | 165 | extern const struct dev_pm_ops oxygen_pci_pm; |
166 | int oxygen_pci_resume(struct pci_dev *pci); | ||
167 | #endif | 166 | #endif |
168 | void oxygen_pci_shutdown(struct pci_dev *pci); | 167 | void oxygen_pci_shutdown(struct pci_dev *pci); |
169 | 168 | ||
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index 92e2d67f16a1..ab8738e21ad1 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -727,9 +727,10 @@ void oxygen_pci_remove(struct pci_dev *pci) | |||
727 | EXPORT_SYMBOL(oxygen_pci_remove); | 727 | EXPORT_SYMBOL(oxygen_pci_remove); |
728 | 728 | ||
729 | #ifdef CONFIG_PM | 729 | #ifdef CONFIG_PM |
730 | int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state) | 730 | static int oxygen_pci_suspend(struct device *dev) |
731 | { | 731 | { |
732 | struct snd_card *card = pci_get_drvdata(pci); | 732 | struct pci_dev *pci = to_pci_dev(dev); |
733 | struct snd_card *card = dev_get_drvdata(dev); | ||
733 | struct oxygen *chip = card->private_data; | 734 | struct oxygen *chip = card->private_data; |
734 | unsigned int i, saved_interrupt_mask; | 735 | unsigned int i, saved_interrupt_mask; |
735 | 736 | ||
@@ -756,10 +757,9 @@ int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state) | |||
756 | 757 | ||
757 | pci_disable_device(pci); | 758 | pci_disable_device(pci); |
758 | pci_save_state(pci); | 759 | pci_save_state(pci); |
759 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 760 | pci_set_power_state(pci, PCI_D3hot); |
760 | return 0; | 761 | return 0; |
761 | } | 762 | } |
762 | EXPORT_SYMBOL(oxygen_pci_suspend); | ||
763 | 763 | ||
764 | static const u32 registers_to_restore[OXYGEN_IO_SIZE / 32] = { | 764 | static const u32 registers_to_restore[OXYGEN_IO_SIZE / 32] = { |
765 | 0xffffffff, 0x00ff077f, 0x00011d08, 0x007f00ff, | 765 | 0xffffffff, 0x00ff077f, 0x00011d08, 0x007f00ff, |
@@ -787,9 +787,10 @@ static void oxygen_restore_ac97(struct oxygen *chip, unsigned int codec) | |||
787 | chip->saved_ac97_registers[codec][i]); | 787 | chip->saved_ac97_registers[codec][i]); |
788 | } | 788 | } |
789 | 789 | ||
790 | int oxygen_pci_resume(struct pci_dev *pci) | 790 | static int oxygen_pci_resume(struct device *dev) |
791 | { | 791 | { |
792 | struct snd_card *card = pci_get_drvdata(pci); | 792 | struct pci_dev *pci = to_pci_dev(dev); |
793 | struct snd_card *card = dev_get_drvdata(dev); | ||
793 | struct oxygen *chip = card->private_data; | 794 | struct oxygen *chip = card->private_data; |
794 | unsigned int i; | 795 | unsigned int i; |
795 | 796 | ||
@@ -820,7 +821,9 @@ int oxygen_pci_resume(struct pci_dev *pci) | |||
820 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 821 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
821 | return 0; | 822 | return 0; |
822 | } | 823 | } |
823 | EXPORT_SYMBOL(oxygen_pci_resume); | 824 | |
825 | SIMPLE_DEV_PM_OPS(oxygen_pci_pm, oxygen_pci_suspend, oxygen_pci_resume); | ||
826 | EXPORT_SYMBOL(oxygen_pci_pm); | ||
824 | #endif /* CONFIG_PM */ | 827 | #endif /* CONFIG_PM */ |
825 | 828 | ||
826 | void oxygen_pci_shutdown(struct pci_dev *pci) | 829 | void oxygen_pci_shutdown(struct pci_dev *pci) |
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index 19962c6d38c3..d3b606b69f3b 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -94,8 +94,9 @@ static struct pci_driver xonar_driver = { | |||
94 | .probe = xonar_probe, | 94 | .probe = xonar_probe, |
95 | .remove = __devexit_p(oxygen_pci_remove), | 95 | .remove = __devexit_p(oxygen_pci_remove), |
96 | #ifdef CONFIG_PM | 96 | #ifdef CONFIG_PM |
97 | .suspend = oxygen_pci_suspend, | 97 | .driver = { |
98 | .resume = oxygen_pci_resume, | 98 | .pm = &oxygen_pci_pm, |
99 | }, | ||
99 | #endif | 100 | #endif |
100 | .shutdown = oxygen_pci_shutdown, | 101 | .shutdown = oxygen_pci_shutdown, |
101 | }; | 102 | }; |
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index cbeb3f77350c..760ee467cd9a 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1151,9 +1151,10 @@ static void riptide_handleirq(unsigned long dev_id) | |||
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | #ifdef CONFIG_PM | 1153 | #ifdef CONFIG_PM |
1154 | static int riptide_suspend(struct pci_dev *pci, pm_message_t state) | 1154 | static int riptide_suspend(struct device *dev) |
1155 | { | 1155 | { |
1156 | struct snd_card *card = pci_get_drvdata(pci); | 1156 | struct pci_dev *pci = to_pci_dev(dev); |
1157 | struct snd_card *card = dev_get_drvdata(dev); | ||
1157 | struct snd_riptide *chip = card->private_data; | 1158 | struct snd_riptide *chip = card->private_data; |
1158 | 1159 | ||
1159 | chip->in_suspend = 1; | 1160 | chip->in_suspend = 1; |
@@ -1162,13 +1163,14 @@ static int riptide_suspend(struct pci_dev *pci, pm_message_t state) | |||
1162 | snd_ac97_suspend(chip->ac97); | 1163 | snd_ac97_suspend(chip->ac97); |
1163 | pci_disable_device(pci); | 1164 | pci_disable_device(pci); |
1164 | pci_save_state(pci); | 1165 | pci_save_state(pci); |
1165 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1166 | pci_set_power_state(pci, PCI_D3hot); |
1166 | return 0; | 1167 | return 0; |
1167 | } | 1168 | } |
1168 | 1169 | ||
1169 | static int riptide_resume(struct pci_dev *pci) | 1170 | static int riptide_resume(struct device *dev) |
1170 | { | 1171 | { |
1171 | struct snd_card *card = pci_get_drvdata(pci); | 1172 | struct pci_dev *pci = to_pci_dev(dev); |
1173 | struct snd_card *card = dev_get_drvdata(dev); | ||
1172 | struct snd_riptide *chip = card->private_data; | 1174 | struct snd_riptide *chip = card->private_data; |
1173 | 1175 | ||
1174 | pci_set_power_state(pci, PCI_D0); | 1176 | pci_set_power_state(pci, PCI_D0); |
@@ -1186,7 +1188,12 @@ static int riptide_resume(struct pci_dev *pci) | |||
1186 | chip->in_suspend = 0; | 1188 | chip->in_suspend = 0; |
1187 | return 0; | 1189 | return 0; |
1188 | } | 1190 | } |
1189 | #endif | 1191 | |
1192 | static SIMPLE_DEV_PM_OPS(riptide_pm, riptide_suspend, riptide_resume); | ||
1193 | #define RIPTIDE_PM_OPS &riptide_pm | ||
1194 | #else | ||
1195 | #define RIPTIDE_PM_OPS NULL | ||
1196 | #endif /* CONFIG_PM */ | ||
1190 | 1197 | ||
1191 | static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip) | 1198 | static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip) |
1192 | { | 1199 | { |
@@ -2180,10 +2187,9 @@ static struct pci_driver driver = { | |||
2180 | .id_table = snd_riptide_ids, | 2187 | .id_table = snd_riptide_ids, |
2181 | .probe = snd_card_riptide_probe, | 2188 | .probe = snd_card_riptide_probe, |
2182 | .remove = __devexit_p(snd_card_riptide_remove), | 2189 | .remove = __devexit_p(snd_card_riptide_remove), |
2183 | #ifdef CONFIG_PM | 2190 | .driver = { |
2184 | .suspend = riptide_suspend, | 2191 | .pm = RIPTIDE_PM_OPS, |
2185 | .resume = riptide_resume, | 2192 | }, |
2186 | #endif | ||
2187 | }; | 2193 | }; |
2188 | 2194 | ||
2189 | #ifdef SUPPORT_JOYSTICK | 2195 | #ifdef SUPPORT_JOYSTICK |
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index 1552642765d6..512434efcc31 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c | |||
@@ -1209,9 +1209,10 @@ static int sis_chip_init(struct sis7019 *sis) | |||
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | #ifdef CONFIG_PM | 1211 | #ifdef CONFIG_PM |
1212 | static int sis_suspend(struct pci_dev *pci, pm_message_t state) | 1212 | static int sis_suspend(struct device *dev) |
1213 | { | 1213 | { |
1214 | struct snd_card *card = pci_get_drvdata(pci); | 1214 | struct pci_dev *pci = to_pci_dev(dev); |
1215 | struct snd_card *card = dev_get_drvdata(dev); | ||
1215 | struct sis7019 *sis = card->private_data; | 1216 | struct sis7019 *sis = card->private_data; |
1216 | void __iomem *ioaddr = sis->ioaddr; | 1217 | void __iomem *ioaddr = sis->ioaddr; |
1217 | int i; | 1218 | int i; |
@@ -1241,13 +1242,14 @@ static int sis_suspend(struct pci_dev *pci, pm_message_t state) | |||
1241 | 1242 | ||
1242 | pci_disable_device(pci); | 1243 | pci_disable_device(pci); |
1243 | pci_save_state(pci); | 1244 | pci_save_state(pci); |
1244 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1245 | pci_set_power_state(pci, PCI_D3hot); |
1245 | return 0; | 1246 | return 0; |
1246 | } | 1247 | } |
1247 | 1248 | ||
1248 | static int sis_resume(struct pci_dev *pci) | 1249 | static int sis_resume(struct device *dev) |
1249 | { | 1250 | { |
1250 | struct snd_card *card = pci_get_drvdata(pci); | 1251 | struct pci_dev *pci = to_pci_dev(dev); |
1252 | struct snd_card *card = dev_get_drvdata(dev); | ||
1251 | struct sis7019 *sis = card->private_data; | 1253 | struct sis7019 *sis = card->private_data; |
1252 | void __iomem *ioaddr = sis->ioaddr; | 1254 | void __iomem *ioaddr = sis->ioaddr; |
1253 | int i; | 1255 | int i; |
@@ -1298,6 +1300,11 @@ error: | |||
1298 | snd_card_disconnect(card); | 1300 | snd_card_disconnect(card); |
1299 | return -EIO; | 1301 | return -EIO; |
1300 | } | 1302 | } |
1303 | |||
1304 | static SIMPLE_DEV_PM_OPS(sis_pm, sis_suspend, sis_resume); | ||
1305 | #define SIS_PM_OPS &sis_pm | ||
1306 | #else | ||
1307 | #define SIS_PM_OPS NULL | ||
1301 | #endif /* CONFIG_PM */ | 1308 | #endif /* CONFIG_PM */ |
1302 | 1309 | ||
1303 | static int sis_alloc_suspend(struct sis7019 *sis) | 1310 | static int sis_alloc_suspend(struct sis7019 *sis) |
@@ -1481,11 +1488,9 @@ static struct pci_driver sis7019_driver = { | |||
1481 | .id_table = snd_sis7019_ids, | 1488 | .id_table = snd_sis7019_ids, |
1482 | .probe = snd_sis7019_probe, | 1489 | .probe = snd_sis7019_probe, |
1483 | .remove = __devexit_p(snd_sis7019_remove), | 1490 | .remove = __devexit_p(snd_sis7019_remove), |
1484 | 1491 | .driver = { | |
1485 | #ifdef CONFIG_PM | 1492 | .pm = SIS_PM_OPS, |
1486 | .suspend = sis_suspend, | 1493 | }, |
1487 | .resume = sis_resume, | ||
1488 | #endif | ||
1489 | }; | 1494 | }; |
1490 | 1495 | ||
1491 | module_pci_driver(sis7019_driver); | 1496 | module_pci_driver(sis7019_driver); |
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index 611983ec7321..f61346a555bb 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c | |||
@@ -178,8 +178,9 @@ static struct pci_driver trident_driver = { | |||
178 | .probe = snd_trident_probe, | 178 | .probe = snd_trident_probe, |
179 | .remove = __devexit_p(snd_trident_remove), | 179 | .remove = __devexit_p(snd_trident_remove), |
180 | #ifdef CONFIG_PM | 180 | #ifdef CONFIG_PM |
181 | .suspend = snd_trident_suspend, | 181 | .driver = { |
182 | .resume = snd_trident_resume, | 182 | .pm = &snd_trident_pm, |
183 | }, | ||
183 | #endif | 184 | #endif |
184 | }; | 185 | }; |
185 | 186 | ||
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 61d3c0e8d4ce..b4430c093bad 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -3920,9 +3920,10 @@ static void snd_trident_clear_voices(struct snd_trident * trident, unsigned shor | |||
3920 | } | 3920 | } |
3921 | 3921 | ||
3922 | #ifdef CONFIG_PM | 3922 | #ifdef CONFIG_PM |
3923 | int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) | 3923 | static int snd_trident_suspend(struct device *dev) |
3924 | { | 3924 | { |
3925 | struct snd_card *card = pci_get_drvdata(pci); | 3925 | struct pci_dev *pci = to_pci_dev(dev); |
3926 | struct snd_card *card = dev_get_drvdata(dev); | ||
3926 | struct snd_trident *trident = card->private_data; | 3927 | struct snd_trident *trident = card->private_data; |
3927 | 3928 | ||
3928 | trident->in_suspend = 1; | 3929 | trident->in_suspend = 1; |
@@ -3936,13 +3937,14 @@ int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) | |||
3936 | 3937 | ||
3937 | pci_disable_device(pci); | 3938 | pci_disable_device(pci); |
3938 | pci_save_state(pci); | 3939 | pci_save_state(pci); |
3939 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 3940 | pci_set_power_state(pci, PCI_D3hot); |
3940 | return 0; | 3941 | return 0; |
3941 | } | 3942 | } |
3942 | 3943 | ||
3943 | int snd_trident_resume(struct pci_dev *pci) | 3944 | static int snd_trident_resume(struct device *dev) |
3944 | { | 3945 | { |
3945 | struct snd_card *card = pci_get_drvdata(pci); | 3946 | struct pci_dev *pci = to_pci_dev(dev); |
3947 | struct snd_card *card = dev_get_drvdata(dev); | ||
3946 | struct snd_trident *trident = card->private_data; | 3948 | struct snd_trident *trident = card->private_data; |
3947 | 3949 | ||
3948 | pci_set_power_state(pci, PCI_D0); | 3950 | pci_set_power_state(pci, PCI_D0); |
@@ -3979,4 +3981,6 @@ int snd_trident_resume(struct pci_dev *pci) | |||
3979 | trident->in_suspend = 0; | 3981 | trident->in_suspend = 0; |
3980 | return 0; | 3982 | return 0; |
3981 | } | 3983 | } |
3984 | |||
3985 | SIMPLE_DEV_PM_OPS(snd_trident_pm, snd_trident_suspend, snd_trident_resume); | ||
3982 | #endif /* CONFIG_PM */ | 3986 | #endif /* CONFIG_PM */ |
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index b5afab48943e..0eb7245dd362 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -2242,9 +2242,10 @@ static int snd_via82xx_chip_init(struct via82xx *chip) | |||
2242 | /* | 2242 | /* |
2243 | * power management | 2243 | * power management |
2244 | */ | 2244 | */ |
2245 | static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | 2245 | static int snd_via82xx_suspend(struct device *dev) |
2246 | { | 2246 | { |
2247 | struct snd_card *card = pci_get_drvdata(pci); | 2247 | struct pci_dev *pci = to_pci_dev(dev); |
2248 | struct snd_card *card = dev_get_drvdata(dev); | ||
2248 | struct via82xx *chip = card->private_data; | 2249 | struct via82xx *chip = card->private_data; |
2249 | int i; | 2250 | int i; |
2250 | 2251 | ||
@@ -2265,13 +2266,14 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2265 | 2266 | ||
2266 | pci_disable_device(pci); | 2267 | pci_disable_device(pci); |
2267 | pci_save_state(pci); | 2268 | pci_save_state(pci); |
2268 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2269 | pci_set_power_state(pci, PCI_D3hot); |
2269 | return 0; | 2270 | return 0; |
2270 | } | 2271 | } |
2271 | 2272 | ||
2272 | static int snd_via82xx_resume(struct pci_dev *pci) | 2273 | static int snd_via82xx_resume(struct device *dev) |
2273 | { | 2274 | { |
2274 | struct snd_card *card = pci_get_drvdata(pci); | 2275 | struct pci_dev *pci = to_pci_dev(dev); |
2276 | struct snd_card *card = dev_get_drvdata(dev); | ||
2275 | struct via82xx *chip = card->private_data; | 2277 | struct via82xx *chip = card->private_data; |
2276 | int i; | 2278 | int i; |
2277 | 2279 | ||
@@ -2306,6 +2308,11 @@ static int snd_via82xx_resume(struct pci_dev *pci) | |||
2306 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2308 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2307 | return 0; | 2309 | return 0; |
2308 | } | 2310 | } |
2311 | |||
2312 | static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); | ||
2313 | #define SND_VIA82XX_PM_OPS &snd_via82xx_pm | ||
2314 | #else | ||
2315 | #define SND_VIA82XX_PM_OPS NULL | ||
2309 | #endif /* CONFIG_PM */ | 2316 | #endif /* CONFIG_PM */ |
2310 | 2317 | ||
2311 | static int snd_via82xx_free(struct via82xx *chip) | 2318 | static int snd_via82xx_free(struct via82xx *chip) |
@@ -2624,10 +2631,9 @@ static struct pci_driver via82xx_driver = { | |||
2624 | .id_table = snd_via82xx_ids, | 2631 | .id_table = snd_via82xx_ids, |
2625 | .probe = snd_via82xx_probe, | 2632 | .probe = snd_via82xx_probe, |
2626 | .remove = __devexit_p(snd_via82xx_remove), | 2633 | .remove = __devexit_p(snd_via82xx_remove), |
2627 | #ifdef CONFIG_PM | 2634 | .driver = { |
2628 | .suspend = snd_via82xx_suspend, | 2635 | .pm = SND_VIA82XX_PM_OPS, |
2629 | .resume = snd_via82xx_resume, | 2636 | }, |
2630 | #endif | ||
2631 | }; | 2637 | }; |
2632 | 2638 | ||
2633 | module_pci_driver(via82xx_driver); | 2639 | module_pci_driver(via82xx_driver); |
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 59fd47ed0a31..e886bc16999d 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -1023,9 +1023,10 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip) | |||
1023 | /* | 1023 | /* |
1024 | * power management | 1024 | * power management |
1025 | */ | 1025 | */ |
1026 | static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | 1026 | static int snd_via82xx_suspend(struct device *dev) |
1027 | { | 1027 | { |
1028 | struct snd_card *card = pci_get_drvdata(pci); | 1028 | struct pci_dev *pci = to_pci_dev(dev); |
1029 | struct snd_card *card = dev_get_drvdata(dev); | ||
1029 | struct via82xx_modem *chip = card->private_data; | 1030 | struct via82xx_modem *chip = card->private_data; |
1030 | int i; | 1031 | int i; |
1031 | 1032 | ||
@@ -1039,13 +1040,14 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state) | |||
1039 | 1040 | ||
1040 | pci_disable_device(pci); | 1041 | pci_disable_device(pci); |
1041 | pci_save_state(pci); | 1042 | pci_save_state(pci); |
1042 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1043 | pci_set_power_state(pci, PCI_D3hot); |
1043 | return 0; | 1044 | return 0; |
1044 | } | 1045 | } |
1045 | 1046 | ||
1046 | static int snd_via82xx_resume(struct pci_dev *pci) | 1047 | static int snd_via82xx_resume(struct device *dev) |
1047 | { | 1048 | { |
1048 | struct snd_card *card = pci_get_drvdata(pci); | 1049 | struct pci_dev *pci = to_pci_dev(dev); |
1050 | struct snd_card *card = dev_get_drvdata(dev); | ||
1049 | struct via82xx_modem *chip = card->private_data; | 1051 | struct via82xx_modem *chip = card->private_data; |
1050 | int i; | 1052 | int i; |
1051 | 1053 | ||
@@ -1069,6 +1071,11 @@ static int snd_via82xx_resume(struct pci_dev *pci) | |||
1069 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1071 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1070 | return 0; | 1072 | return 0; |
1071 | } | 1073 | } |
1074 | |||
1075 | static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); | ||
1076 | #define SND_VIA82XX_PM_OPS &snd_via82xx_pm | ||
1077 | #else | ||
1078 | #define SND_VIA82XX_PM_OPS NULL | ||
1072 | #endif /* CONFIG_PM */ | 1079 | #endif /* CONFIG_PM */ |
1073 | 1080 | ||
1074 | static int snd_via82xx_free(struct via82xx_modem *chip) | 1081 | static int snd_via82xx_free(struct via82xx_modem *chip) |
@@ -1228,10 +1235,9 @@ static struct pci_driver via82xx_modem_driver = { | |||
1228 | .id_table = snd_via82xx_modem_ids, | 1235 | .id_table = snd_via82xx_modem_ids, |
1229 | .probe = snd_via82xx_probe, | 1236 | .probe = snd_via82xx_probe, |
1230 | .remove = __devexit_p(snd_via82xx_remove), | 1237 | .remove = __devexit_p(snd_via82xx_remove), |
1231 | #ifdef CONFIG_PM | 1238 | .driver = { |
1232 | .suspend = snd_via82xx_suspend, | 1239 | .pm = SND_VIA82XX_PM_OPS, |
1233 | .resume = snd_via82xx_resume, | 1240 | }, |
1234 | #endif | ||
1235 | }; | 1241 | }; |
1236 | 1242 | ||
1237 | module_pci_driver(via82xx_modem_driver); | 1243 | module_pci_driver(via82xx_modem_driver); |
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index 1ea1f656a5dc..b89e7a86e9d8 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c | |||
@@ -258,22 +258,24 @@ static void __devexit snd_vx222_remove(struct pci_dev *pci) | |||
258 | } | 258 | } |
259 | 259 | ||
260 | #ifdef CONFIG_PM | 260 | #ifdef CONFIG_PM |
261 | static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state) | 261 | static int snd_vx222_suspend(struct device *dev) |
262 | { | 262 | { |
263 | struct snd_card *card = pci_get_drvdata(pci); | 263 | struct pci_dev *pci = to_pci_dev(dev); |
264 | struct snd_card *card = dev_get_drvdata(dev); | ||
264 | struct snd_vx222 *vx = card->private_data; | 265 | struct snd_vx222 *vx = card->private_data; |
265 | int err; | 266 | int err; |
266 | 267 | ||
267 | err = snd_vx_suspend(&vx->core, state); | 268 | err = snd_vx_suspend(&vx->core); |
268 | pci_disable_device(pci); | 269 | pci_disable_device(pci); |
269 | pci_save_state(pci); | 270 | pci_save_state(pci); |
270 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 271 | pci_set_power_state(pci, PCI_D3hot); |
271 | return err; | 272 | return err; |
272 | } | 273 | } |
273 | 274 | ||
274 | static int snd_vx222_resume(struct pci_dev *pci) | 275 | static int snd_vx222_resume(struct device *dev) |
275 | { | 276 | { |
276 | struct snd_card *card = pci_get_drvdata(pci); | 277 | struct pci_dev *pci = to_pci_dev(dev); |
278 | struct snd_card *card = dev_get_drvdata(dev); | ||
277 | struct snd_vx222 *vx = card->private_data; | 279 | struct snd_vx222 *vx = card->private_data; |
278 | 280 | ||
279 | pci_set_power_state(pci, PCI_D0); | 281 | pci_set_power_state(pci, PCI_D0); |
@@ -287,6 +289,11 @@ static int snd_vx222_resume(struct pci_dev *pci) | |||
287 | pci_set_master(pci); | 289 | pci_set_master(pci); |
288 | return snd_vx_resume(&vx->core); | 290 | return snd_vx_resume(&vx->core); |
289 | } | 291 | } |
292 | |||
293 | static SIMPLE_DEV_PM_OPS(snd_vx222_pm, snd_vx222_suspend, snd_vx222_resume); | ||
294 | #define SND_VX222_PM_OPS &snd_vx222_pm | ||
295 | #else | ||
296 | #define SND_VX222_PM_OPS NULL | ||
290 | #endif | 297 | #endif |
291 | 298 | ||
292 | static struct pci_driver vx222_driver = { | 299 | static struct pci_driver vx222_driver = { |
@@ -294,10 +301,9 @@ static struct pci_driver vx222_driver = { | |||
294 | .id_table = snd_vx222_ids, | 301 | .id_table = snd_vx222_ids, |
295 | .probe = snd_vx222_probe, | 302 | .probe = snd_vx222_probe, |
296 | .remove = __devexit_p(snd_vx222_remove), | 303 | .remove = __devexit_p(snd_vx222_remove), |
297 | #ifdef CONFIG_PM | 304 | .driver = { |
298 | .suspend = snd_vx222_suspend, | 305 | .pm = SND_VX222_PM_OPS, |
299 | .resume = snd_vx222_resume, | 306 | }, |
300 | #endif | ||
301 | }; | 307 | }; |
302 | 308 | ||
303 | module_pci_driver(vx222_driver); | 309 | module_pci_driver(vx222_driver); |
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c index 9a1d01d653a7..7e20ddb9123a 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c | |||
@@ -356,8 +356,9 @@ static struct pci_driver ymfpci_driver = { | |||
356 | .probe = snd_card_ymfpci_probe, | 356 | .probe = snd_card_ymfpci_probe, |
357 | .remove = __devexit_p(snd_card_ymfpci_remove), | 357 | .remove = __devexit_p(snd_card_ymfpci_remove), |
358 | #ifdef CONFIG_PM | 358 | #ifdef CONFIG_PM |
359 | .suspend = snd_ymfpci_suspend, | 359 | .driver = { |
360 | .resume = snd_ymfpci_resume, | 360 | .pm = &snd_ymfpci_pm, |
361 | }, | ||
361 | #endif | 362 | #endif |
362 | }; | 363 | }; |
363 | 364 | ||
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index a8159b81e9c4..c706901d6ff6 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -2302,9 +2302,10 @@ static int saved_regs_index[] = { | |||
2302 | }; | 2302 | }; |
2303 | #define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index) | 2303 | #define YDSXGR_NUM_SAVED_REGS ARRAY_SIZE(saved_regs_index) |
2304 | 2304 | ||
2305 | int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state) | 2305 | static int snd_ymfpci_suspend(struct device *dev) |
2306 | { | 2306 | { |
2307 | struct snd_card *card = pci_get_drvdata(pci); | 2307 | struct pci_dev *pci = to_pci_dev(dev); |
2308 | struct snd_card *card = dev_get_drvdata(dev); | ||
2308 | struct snd_ymfpci *chip = card->private_data; | 2309 | struct snd_ymfpci *chip = card->private_data; |
2309 | unsigned int i; | 2310 | unsigned int i; |
2310 | 2311 | ||
@@ -2326,13 +2327,14 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state) | |||
2326 | snd_ymfpci_disable_dsp(chip); | 2327 | snd_ymfpci_disable_dsp(chip); |
2327 | pci_disable_device(pci); | 2328 | pci_disable_device(pci); |
2328 | pci_save_state(pci); | 2329 | pci_save_state(pci); |
2329 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2330 | pci_set_power_state(pci, PCI_D3hot); |
2330 | return 0; | 2331 | return 0; |
2331 | } | 2332 | } |
2332 | 2333 | ||
2333 | int snd_ymfpci_resume(struct pci_dev *pci) | 2334 | static int snd_ymfpci_resume(struct device *dev) |
2334 | { | 2335 | { |
2335 | struct snd_card *card = pci_get_drvdata(pci); | 2336 | struct pci_dev *pci = to_pci_dev(dev); |
2337 | struct snd_card *card = dev_get_drvdata(dev); | ||
2336 | struct snd_ymfpci *chip = card->private_data; | 2338 | struct snd_ymfpci *chip = card->private_data; |
2337 | unsigned int i; | 2339 | unsigned int i; |
2338 | 2340 | ||
@@ -2370,6 +2372,8 @@ int snd_ymfpci_resume(struct pci_dev *pci) | |||
2370 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2372 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2371 | return 0; | 2373 | return 0; |
2372 | } | 2374 | } |
2375 | |||
2376 | SIMPLE_DEV_PM_OPS(snd_ymfpci_pm, snd_ymfpci_suspend, snd_ymfpci_resume); | ||
2373 | #endif /* CONFIG_PM */ | 2377 | #endif /* CONFIG_PM */ |
2374 | 2378 | ||
2375 | int __devinit snd_ymfpci_create(struct snd_card *card, | 2379 | int __devinit snd_ymfpci_create(struct snd_card *card, |
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 512f0b472375..8f9350475c7b 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -260,7 +260,7 @@ static int vxp_suspend(struct pcmcia_device *link) | |||
260 | snd_printdd(KERN_DEBUG "SUSPEND\n"); | 260 | snd_printdd(KERN_DEBUG "SUSPEND\n"); |
261 | if (chip) { | 261 | if (chip) { |
262 | snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); | 262 | snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); |
263 | snd_vx_suspend(chip, PMSG_SUSPEND); | 263 | snd_vx_suspend(chip); |
264 | } | 264 | } |
265 | 265 | ||
266 | return 0; | 266 | return 0; |