diff options
83 files changed, 602 insertions, 410 deletions
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/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index afef72c4f0d3..0d7b25e81643 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c | |||
@@ -108,7 +108,7 @@ static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = { | |||
108 | 108 | ||
109 | #ifdef CONFIG_PM | 109 | #ifdef CONFIG_PM |
110 | 110 | ||
111 | static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state) | 111 | static int pxa2xx_ac97_do_suspend(struct snd_card *card) |
112 | { | 112 | { |
113 | pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; | 113 | pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; |
114 | 114 | ||
@@ -144,7 +144,7 @@ static int pxa2xx_ac97_suspend(struct device *dev) | |||
144 | int ret = 0; | 144 | int ret = 0; |
145 | 145 | ||
146 | if (card) | 146 | if (card) |
147 | ret = pxa2xx_ac97_do_suspend(card, PMSG_SUSPEND); | 147 | ret = pxa2xx_ac97_do_suspend(card); |
148 | 148 | ||
149 | return ret; | 149 | return ret; |
150 | } | 150 | } |
@@ -160,10 +160,7 @@ static int pxa2xx_ac97_resume(struct device *dev) | |||
160 | return ret; | 160 | return ret; |
161 | } | 161 | } |
162 | 162 | ||
163 | static const struct dev_pm_ops pxa2xx_ac97_pm_ops = { | 163 | static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume); |
164 | .suspend = pxa2xx_ac97_suspend, | ||
165 | .resume = pxa2xx_ac97_resume, | ||
166 | }; | ||
167 | #endif | 164 | #endif |
168 | 165 | ||
169 | static int __devinit pxa2xx_ac97_probe(struct platform_device *dev) | 166 | static int __devinit pxa2xx_ac97_probe(struct platform_device *dev) |
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index f7c2bb08055d..eb4ceb71123e 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c | |||
@@ -535,9 +535,9 @@ out_put_pclk: | |||
535 | } | 535 | } |
536 | 536 | ||
537 | #ifdef CONFIG_PM | 537 | #ifdef CONFIG_PM |
538 | static int atmel_abdac_suspend(struct platform_device *pdev, pm_message_t msg) | 538 | static int atmel_abdac_suspend(struct device *pdev) |
539 | { | 539 | { |
540 | struct snd_card *card = platform_get_drvdata(pdev); | 540 | struct snd_card *card = dev_get_drvdata(pdev); |
541 | struct atmel_abdac *dac = card->private_data; | 541 | struct atmel_abdac *dac = card->private_data; |
542 | 542 | ||
543 | dw_dma_cyclic_stop(dac->dma.chan); | 543 | dw_dma_cyclic_stop(dac->dma.chan); |
@@ -547,9 +547,9 @@ static int atmel_abdac_suspend(struct platform_device *pdev, pm_message_t msg) | |||
547 | return 0; | 547 | return 0; |
548 | } | 548 | } |
549 | 549 | ||
550 | static int atmel_abdac_resume(struct platform_device *pdev) | 550 | static int atmel_abdac_resume(struct device *pdev) |
551 | { | 551 | { |
552 | struct snd_card *card = platform_get_drvdata(pdev); | 552 | struct snd_card *card = dev_get_drvdata(pdev); |
553 | struct atmel_abdac *dac = card->private_data; | 553 | struct atmel_abdac *dac = card->private_data; |
554 | 554 | ||
555 | clk_enable(dac->pclk); | 555 | clk_enable(dac->pclk); |
@@ -559,9 +559,11 @@ static int atmel_abdac_resume(struct platform_device *pdev) | |||
559 | 559 | ||
560 | return 0; | 560 | return 0; |
561 | } | 561 | } |
562 | |||
563 | static SIMPLE_DEV_PM_OPS(atmel_abdac_pm, atmel_abdac_suspend, atmel_abdac_resume); | ||
564 | #define ATMEL_ABDAC_PM_OPS &atmel_abdac_pm | ||
562 | #else | 565 | #else |
563 | #define atmel_abdac_suspend NULL | 566 | #define ATMEL_ABDAC_PM_OPS NULL |
564 | #define atmel_abdac_resume NULL | ||
565 | #endif | 567 | #endif |
566 | 568 | ||
567 | static int __devexit atmel_abdac_remove(struct platform_device *pdev) | 569 | static int __devexit atmel_abdac_remove(struct platform_device *pdev) |
@@ -589,9 +591,9 @@ static struct platform_driver atmel_abdac_driver = { | |||
589 | .remove = __devexit_p(atmel_abdac_remove), | 591 | .remove = __devexit_p(atmel_abdac_remove), |
590 | .driver = { | 592 | .driver = { |
591 | .name = "atmel_abdac", | 593 | .name = "atmel_abdac", |
594 | .owner = THIS_MODULE, | ||
595 | .pm = ATMEL_ABDAC_PM_OPS, | ||
592 | }, | 596 | }, |
593 | .suspend = atmel_abdac_suspend, | ||
594 | .resume = atmel_abdac_resume, | ||
595 | }; | 597 | }; |
596 | 598 | ||
597 | static int __init atmel_abdac_init(void) | 599 | static int __init atmel_abdac_init(void) |
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index f5ded640b395..bf47025bdf45 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c | |||
@@ -1135,9 +1135,9 @@ err_snd_card_new: | |||
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | #ifdef CONFIG_PM | 1137 | #ifdef CONFIG_PM |
1138 | static int atmel_ac97c_suspend(struct platform_device *pdev, pm_message_t msg) | 1138 | static int atmel_ac97c_suspend(struct device *pdev) |
1139 | { | 1139 | { |
1140 | struct snd_card *card = platform_get_drvdata(pdev); | 1140 | struct snd_card *card = dev_get_drvdata(pdev); |
1141 | struct atmel_ac97c *chip = card->private_data; | 1141 | struct atmel_ac97c *chip = card->private_data; |
1142 | 1142 | ||
1143 | if (cpu_is_at32ap7000()) { | 1143 | if (cpu_is_at32ap7000()) { |
@@ -1151,9 +1151,9 @@ static int atmel_ac97c_suspend(struct platform_device *pdev, pm_message_t msg) | |||
1151 | return 0; | 1151 | return 0; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | static int atmel_ac97c_resume(struct platform_device *pdev) | 1154 | static int atmel_ac97c_resume(struct device *pdev) |
1155 | { | 1155 | { |
1156 | struct snd_card *card = platform_get_drvdata(pdev); | 1156 | struct snd_card *card = dev_get_drvdata(pdev); |
1157 | struct atmel_ac97c *chip = card->private_data; | 1157 | struct atmel_ac97c *chip = card->private_data; |
1158 | 1158 | ||
1159 | clk_enable(chip->pclk); | 1159 | clk_enable(chip->pclk); |
@@ -1165,9 +1165,11 @@ static int atmel_ac97c_resume(struct platform_device *pdev) | |||
1165 | } | 1165 | } |
1166 | return 0; | 1166 | return 0; |
1167 | } | 1167 | } |
1168 | |||
1169 | static SIMPLE_DEV_PM_OPS(atmel_ac97c_pm, atmel_ac97c_suspend, atmel_ac97c_resume); | ||
1170 | #define ATMEL_AC97C_PM_OPS &atmel_ac97c_pm | ||
1168 | #else | 1171 | #else |
1169 | #define atmel_ac97c_suspend NULL | 1172 | #define ATMEL_AC97C_PM_OPS NULL |
1170 | #define atmel_ac97c_resume NULL | ||
1171 | #endif | 1173 | #endif |
1172 | 1174 | ||
1173 | static int __devexit atmel_ac97c_remove(struct platform_device *pdev) | 1175 | static int __devexit atmel_ac97c_remove(struct platform_device *pdev) |
@@ -1210,9 +1212,9 @@ static struct platform_driver atmel_ac97c_driver = { | |||
1210 | .remove = __devexit_p(atmel_ac97c_remove), | 1212 | .remove = __devexit_p(atmel_ac97c_remove), |
1211 | .driver = { | 1213 | .driver = { |
1212 | .name = "atmel_ac97c", | 1214 | .name = "atmel_ac97c", |
1215 | .owner = THIS_MODULE, | ||
1216 | .pm = ATMEL_AC97C_PM_OPS, | ||
1213 | }, | 1217 | }, |
1214 | .suspend = atmel_ac97c_suspend, | ||
1215 | .resume = atmel_ac97c_resume, | ||
1216 | }; | 1218 | }; |
1217 | 1219 | ||
1218 | static int __init atmel_ac97c_init(void) | 1220 | static int __init atmel_ac97c_init(void) |
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 8b5c36f4d303..1128b35b2b05 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c | |||
@@ -1177,10 +1177,9 @@ static int __devexit loopback_remove(struct platform_device *devptr) | |||
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | #ifdef CONFIG_PM | 1179 | #ifdef CONFIG_PM |
1180 | static int loopback_suspend(struct platform_device *pdev, | 1180 | static int loopback_suspend(struct device *pdev) |
1181 | pm_message_t state) | ||
1182 | { | 1181 | { |
1183 | struct snd_card *card = platform_get_drvdata(pdev); | 1182 | struct snd_card *card = dev_get_drvdata(pdev); |
1184 | struct loopback *loopback = card->private_data; | 1183 | struct loopback *loopback = card->private_data; |
1185 | 1184 | ||
1186 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1185 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -1190,13 +1189,18 @@ static int loopback_suspend(struct platform_device *pdev, | |||
1190 | return 0; | 1189 | return 0; |
1191 | } | 1190 | } |
1192 | 1191 | ||
1193 | static int loopback_resume(struct platform_device *pdev) | 1192 | static int loopback_resume(struct device *pdev) |
1194 | { | 1193 | { |
1195 | struct snd_card *card = platform_get_drvdata(pdev); | 1194 | struct snd_card *card = dev_get_drvdata(pdev); |
1196 | 1195 | ||
1197 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1196 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1198 | return 0; | 1197 | return 0; |
1199 | } | 1198 | } |
1199 | |||
1200 | static SIMPLE_DEV_PM_OPS(loopback_pm, loopback_suspend, loopback_resume); | ||
1201 | #define LOOPBACK_PM_OPS &loopback_pm | ||
1202 | #else | ||
1203 | #define LOOPBACK_PM_OPS NULL | ||
1200 | #endif | 1204 | #endif |
1201 | 1205 | ||
1202 | #define SND_LOOPBACK_DRIVER "snd_aloop" | 1206 | #define SND_LOOPBACK_DRIVER "snd_aloop" |
@@ -1204,12 +1208,10 @@ static int loopback_resume(struct platform_device *pdev) | |||
1204 | static struct platform_driver loopback_driver = { | 1208 | static struct platform_driver loopback_driver = { |
1205 | .probe = loopback_probe, | 1209 | .probe = loopback_probe, |
1206 | .remove = __devexit_p(loopback_remove), | 1210 | .remove = __devexit_p(loopback_remove), |
1207 | #ifdef CONFIG_PM | ||
1208 | .suspend = loopback_suspend, | ||
1209 | .resume = loopback_resume, | ||
1210 | #endif | ||
1211 | .driver = { | 1211 | .driver = { |
1212 | .name = SND_LOOPBACK_DRIVER | 1212 | .name = SND_LOOPBACK_DRIVER, |
1213 | .owner = THIS_MODULE, | ||
1214 | .pm = LOOPBACK_PM_OPS, | ||
1213 | }, | 1215 | }, |
1214 | }; | 1216 | }; |
1215 | 1217 | ||
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index ad9434fd6370..f7d3bfc6bca8 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c | |||
@@ -1065,9 +1065,9 @@ static int __devexit snd_dummy_remove(struct platform_device *devptr) | |||
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | #ifdef CONFIG_PM | 1067 | #ifdef CONFIG_PM |
1068 | static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state) | 1068 | static int snd_dummy_suspend(struct device *pdev) |
1069 | { | 1069 | { |
1070 | struct snd_card *card = platform_get_drvdata(pdev); | 1070 | struct snd_card *card = dev_get_drvdata(pdev); |
1071 | struct snd_dummy *dummy = card->private_data; | 1071 | struct snd_dummy *dummy = card->private_data; |
1072 | 1072 | ||
1073 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 1073 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -1075,13 +1075,18 @@ static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state) | |||
1075 | return 0; | 1075 | return 0; |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | static int snd_dummy_resume(struct platform_device *pdev) | 1078 | static int snd_dummy_resume(struct device *pdev) |
1079 | { | 1079 | { |
1080 | struct snd_card *card = platform_get_drvdata(pdev); | 1080 | struct snd_card *card = dev_get_drvdata(pdev); |
1081 | 1081 | ||
1082 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1082 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1083 | return 0; | 1083 | return 0; |
1084 | } | 1084 | } |
1085 | |||
1086 | static SIMPLE_DEV_PM_OPS(snd_dummy_pm, snd_dummy_suspend, snd_dummy_resume); | ||
1087 | #define SND_DUMMY_PM_OPS &snd_dummy_pm | ||
1088 | #else | ||
1089 | #define SND_DUMMY_PM_OPS NULL | ||
1085 | #endif | 1090 | #endif |
1086 | 1091 | ||
1087 | #define SND_DUMMY_DRIVER "snd_dummy" | 1092 | #define SND_DUMMY_DRIVER "snd_dummy" |
@@ -1089,12 +1094,10 @@ static int snd_dummy_resume(struct platform_device *pdev) | |||
1089 | static struct platform_driver snd_dummy_driver = { | 1094 | static struct platform_driver snd_dummy_driver = { |
1090 | .probe = snd_dummy_probe, | 1095 | .probe = snd_dummy_probe, |
1091 | .remove = __devexit_p(snd_dummy_remove), | 1096 | .remove = __devexit_p(snd_dummy_remove), |
1092 | #ifdef CONFIG_PM | ||
1093 | .suspend = snd_dummy_suspend, | ||
1094 | .resume = snd_dummy_resume, | ||
1095 | #endif | ||
1096 | .driver = { | 1097 | .driver = { |
1097 | .name = SND_DUMMY_DRIVER | 1098 | .name = SND_DUMMY_DRIVER, |
1099 | .owner = THIS_MODULE, | ||
1100 | .pm = SND_DUMMY_PM_OPS, | ||
1098 | }, | 1101 | }, |
1099 | }; | 1102 | }; |
1100 | 1103 | ||
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 86f5fbc2da72..bc03a2046c9c 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -139,7 +139,8 @@ static struct platform_driver snd_mpu401_driver = { | |||
139 | .probe = snd_mpu401_probe, | 139 | .probe = snd_mpu401_probe, |
140 | .remove = __devexit_p(snd_mpu401_remove), | 140 | .remove = __devexit_p(snd_mpu401_remove), |
141 | .driver = { | 141 | .driver = { |
142 | .name = SND_MPU401_DRIVER | 142 | .name = SND_MPU401_DRIVER, |
143 | .owner = THIS_MODULE, | ||
143 | }, | 144 | }, |
144 | }; | 145 | }; |
145 | 146 | ||
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index 76930793fb69..cad73af3860c 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c | |||
@@ -759,7 +759,8 @@ static struct platform_driver snd_mtpav_driver = { | |||
759 | .probe = snd_mtpav_probe, | 759 | .probe = snd_mtpav_probe, |
760 | .remove = __devexit_p(snd_mtpav_remove), | 760 | .remove = __devexit_p(snd_mtpav_remove), |
761 | .driver = { | 761 | .driver = { |
762 | .name = SND_MTPAV_DRIVER | 762 | .name = SND_MTPAV_DRIVER, |
763 | .owner = THIS_MODULE, | ||
763 | }, | 764 | }, |
764 | }; | 765 | }; |
765 | 766 | ||
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 621e60e2029f..2d5514b0a290 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c | |||
@@ -1040,7 +1040,8 @@ static struct platform_driver snd_mts64_driver = { | |||
1040 | .probe = snd_mts64_probe, | 1040 | .probe = snd_mts64_probe, |
1041 | .remove = __devexit_p(snd_mts64_remove), | 1041 | .remove = __devexit_p(snd_mts64_remove), |
1042 | .driver = { | 1042 | .driver = { |
1043 | .name = PLATFORM_DRIVER | 1043 | .name = PLATFORM_DRIVER, |
1044 | .owner = THIS_MODULE, | ||
1044 | } | 1045 | } |
1045 | }; | 1046 | }; |
1046 | 1047 | ||
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index 99704e6a2e26..6ca59fc6dcb9 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c | |||
@@ -200,15 +200,18 @@ static void pcsp_stop_beep(struct snd_pcsp *chip) | |||
200 | } | 200 | } |
201 | 201 | ||
202 | #ifdef CONFIG_PM | 202 | #ifdef CONFIG_PM |
203 | static int pcsp_suspend(struct platform_device *dev, pm_message_t state) | 203 | static int pcsp_suspend(struct device *dev) |
204 | { | 204 | { |
205 | struct snd_pcsp *chip = platform_get_drvdata(dev); | 205 | struct snd_pcsp *chip = dev_get_drvdata(dev); |
206 | pcsp_stop_beep(chip); | 206 | pcsp_stop_beep(chip); |
207 | snd_pcm_suspend_all(chip->pcm); | 207 | snd_pcm_suspend_all(chip->pcm); |
208 | return 0; | 208 | return 0; |
209 | } | 209 | } |
210 | |||
211 | static SIMPLE_DEV_PM_OPS(pcsp_pm, pcsp_suspend, NULL); | ||
212 | #define PCSP_PM_OPS &pcsp_pm | ||
210 | #else | 213 | #else |
211 | #define pcsp_suspend NULL | 214 | #define PCSP_PM_OPS NULL |
212 | #endif /* CONFIG_PM */ | 215 | #endif /* CONFIG_PM */ |
213 | 216 | ||
214 | static void pcsp_shutdown(struct platform_device *dev) | 217 | static void pcsp_shutdown(struct platform_device *dev) |
@@ -221,10 +224,10 @@ static struct platform_driver pcsp_platform_driver = { | |||
221 | .driver = { | 224 | .driver = { |
222 | .name = "pcspkr", | 225 | .name = "pcspkr", |
223 | .owner = THIS_MODULE, | 226 | .owner = THIS_MODULE, |
227 | .pm = PCSP_PM_OPS, | ||
224 | }, | 228 | }, |
225 | .probe = pcsp_probe, | 229 | .probe = pcsp_probe, |
226 | .remove = __devexit_p(pcsp_remove), | 230 | .remove = __devexit_p(pcsp_remove), |
227 | .suspend = pcsp_suspend, | ||
228 | .shutdown = pcsp_shutdown, | 231 | .shutdown = pcsp_shutdown, |
229 | }; | 232 | }; |
230 | 233 | ||
diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 3e32bd3d95d9..8364855ed14f 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c | |||
@@ -829,7 +829,8 @@ static struct platform_driver snd_portman_driver = { | |||
829 | .probe = snd_portman_probe, | 829 | .probe = snd_portman_probe, |
830 | .remove = __devexit_p(snd_portman_remove), | 830 | .remove = __devexit_p(snd_portman_remove), |
831 | .driver = { | 831 | .driver = { |
832 | .name = PLATFORM_DRIVER | 832 | .name = PLATFORM_DRIVER, |
833 | .owner = THIS_MODULE, | ||
833 | } | 834 | } |
834 | }; | 835 | }; |
835 | 836 | ||
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index b2d0e8e49bed..86700671d1ac 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c | |||
@@ -995,7 +995,8 @@ static struct platform_driver snd_serial_driver = { | |||
995 | .probe = snd_serial_probe, | 995 | .probe = snd_serial_probe, |
996 | .remove = __devexit_p( snd_serial_remove), | 996 | .remove = __devexit_p( snd_serial_remove), |
997 | .driver = { | 997 | .driver = { |
998 | .name = SND_SERIAL_DRIVER | 998 | .name = SND_SERIAL_DRIVER, |
999 | .owner = THIS_MODULE, | ||
999 | }, | 1000 | }, |
1000 | }; | 1001 | }; |
1001 | 1002 | ||
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 9d97478a18b3..d7d514df9058 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c | |||
@@ -142,7 +142,8 @@ static struct platform_driver snd_virmidi_driver = { | |||
142 | .probe = snd_virmidi_probe, | 142 | .probe = snd_virmidi_probe, |
143 | .remove = __devexit_p(snd_virmidi_remove), | 143 | .remove = __devexit_p(snd_virmidi_remove), |
144 | .driver = { | 144 | .driver = { |
145 | .name = SND_VIRMIDI_DRIVER | 145 | .name = SND_VIRMIDI_DRIVER, |
146 | .owner = THIS_MODULE, | ||
146 | }, | 147 | }, |
147 | }; | 148 | }; |
148 | 149 | ||
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..1e007c736a8b 100644 --- a/sound/pci/cs46xx/cs46xx.c +++ b/sound/pci/cs46xx/cs46xx.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <sound/core.h> | 32 | #include <sound/core.h> |
33 | #include <sound/cs46xx.h> | 33 | #include "cs46xx.h" |
34 | #include <sound/initval.h> | 34 | #include <sound/initval.h> |
35 | 35 | ||
36 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); | 36 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
@@ -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/include/sound/cs46xx.h b/sound/pci/cs46xx/cs46xx.h index e3005a674a24..29d8a8da1ba7 100644 --- a/include/sound/cs46xx.h +++ b/sound/pci/cs46xx/cs46xx.h | |||
@@ -23,10 +23,10 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "pcm.h" | 26 | #include <sound/pcm.h> |
27 | #include "pcm-indirect.h" | 27 | #include <sound/pcm-indirect.h> |
28 | #include "rawmidi.h" | 28 | #include <sound/rawmidi.h> |
29 | #include "ac97_codec.h" | 29 | #include <sound/ac97_codec.h> |
30 | #include "cs46xx_dsp_spos.h" | 30 | #include "cs46xx_dsp_spos.h" |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -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/cs46xx_dsp_scb_types.h b/sound/pci/cs46xx/cs46xx_dsp_scb_types.h index 080857ad0ca2..080857ad0ca2 100644 --- a/include/sound/cs46xx_dsp_scb_types.h +++ b/sound/pci/cs46xx/cs46xx_dsp_scb_types.h | |||
diff --git a/include/sound/cs46xx_dsp_spos.h b/sound/pci/cs46xx/cs46xx_dsp_spos.h index 8008c59288a6..8008c59288a6 100644 --- a/include/sound/cs46xx_dsp_spos.h +++ b/sound/pci/cs46xx/cs46xx_dsp_spos.h | |||
diff --git a/include/sound/cs46xx_dsp_task_types.h b/sound/pci/cs46xx/cs46xx_dsp_task_types.h index 5cf920bfda27..5cf920bfda27 100644 --- a/include/sound/cs46xx_dsp_task_types.h +++ b/sound/pci/cs46xx/cs46xx_dsp_task_types.h | |||
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 4fa53161b094..f75f5ffdfdfb 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #include <sound/info.h> | 61 | #include <sound/info.h> |
62 | #include <sound/pcm.h> | 62 | #include <sound/pcm.h> |
63 | #include <sound/pcm_params.h> | 63 | #include <sound/pcm_params.h> |
64 | #include <sound/cs46xx.h> | 64 | #include "cs46xx.h" |
65 | 65 | ||
66 | #include <asm/io.h> | 66 | #include <asm/io.h> |
67 | 67 | ||
@@ -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/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index e377287192aa..56fec0bc0efb 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <sound/control.h> | 32 | #include <sound/control.h> |
33 | #include <sound/info.h> | 33 | #include <sound/info.h> |
34 | #include <sound/asoundef.h> | 34 | #include <sound/asoundef.h> |
35 | #include <sound/cs46xx.h> | 35 | #include "cs46xx.h" |
36 | 36 | ||
37 | #include "cs46xx_lib.h" | 37 | #include "cs46xx_lib.h" |
38 | #include "dsp_spos.h" | 38 | #include "dsp_spos.h" |
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 00b148a10239..c2c695b07f8c 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <sound/core.h> | 31 | #include <sound/core.h> |
32 | #include <sound/control.h> | 32 | #include <sound/control.h> |
33 | #include <sound/info.h> | 33 | #include <sound/info.h> |
34 | #include <sound/cs46xx.h> | 34 | #include "cs46xx.h" |
35 | 35 | ||
36 | #include "cs46xx_lib.h" | 36 | #include "cs46xx_lib.h" |
37 | #include "dsp_spos.h" | 37 | #include "dsp_spos.h" |
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 a41106d745ca..dbb81807bc1a 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1469,9 +1469,10 @@ static unsigned char saved_regs[SAVED_REG_SIZE+1] = { | |||
1469 | }; | 1469 | }; |
1470 | 1470 | ||
1471 | 1471 | ||
1472 | static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | 1472 | static int es1938_suspend(struct device *dev) |
1473 | { | 1473 | { |
1474 | struct snd_card *card = pci_get_drvdata(pci); | 1474 | struct pci_dev *pci = to_pci_dev(dev); |
1475 | struct snd_card *card = dev_get_drvdata(dev); | ||
1475 | struct es1938 *chip = card->private_data; | 1476 | struct es1938 *chip = card->private_data; |
1476 | unsigned char *s, *d; | 1477 | unsigned char *s, *d; |
1477 | 1478 | ||
@@ -1489,13 +1490,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state) | |||
1489 | } | 1490 | } |
1490 | pci_disable_device(pci); | 1491 | pci_disable_device(pci); |
1491 | pci_save_state(pci); | 1492 | pci_save_state(pci); |
1492 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1493 | pci_set_power_state(pci, PCI_D3hot); |
1493 | return 0; | 1494 | return 0; |
1494 | } | 1495 | } |
1495 | 1496 | ||
1496 | static int es1938_resume(struct pci_dev *pci) | 1497 | static int es1938_resume(struct device *dev) |
1497 | { | 1498 | { |
1498 | struct snd_card *card = pci_get_drvdata(pci); | 1499 | struct pci_dev *pci = to_pci_dev(dev); |
1500 | struct snd_card *card = dev_get_drvdata(dev); | ||
1499 | struct es1938 *chip = card->private_data; | 1501 | struct es1938 *chip = card->private_data; |
1500 | unsigned char *s, *d; | 1502 | unsigned char *s, *d; |
1501 | 1503 | ||
@@ -1529,6 +1531,11 @@ static int es1938_resume(struct pci_dev *pci) | |||
1529 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1531 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1530 | return 0; | 1532 | return 0; |
1531 | } | 1533 | } |
1534 | |||
1535 | static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); | ||
1536 | #define ES1938_PM_OPS &es1938_pm | ||
1537 | #else | ||
1538 | #define ES1938_PM_OPS NULL | ||
1532 | #endif /* CONFIG_PM */ | 1539 | #endif /* CONFIG_PM */ |
1533 | 1540 | ||
1534 | #ifdef SUPPORT_JOYSTICK | 1541 | #ifdef SUPPORT_JOYSTICK |
@@ -1882,10 +1889,9 @@ static struct pci_driver es1938_driver = { | |||
1882 | .id_table = snd_es1938_ids, | 1889 | .id_table = snd_es1938_ids, |
1883 | .probe = snd_es1938_probe, | 1890 | .probe = snd_es1938_probe, |
1884 | .remove = __devexit_p(snd_es1938_remove), | 1891 | .remove = __devexit_p(snd_es1938_remove), |
1885 | #ifdef CONFIG_PM | 1892 | .driver = { |
1886 | .suspend = es1938_suspend, | 1893 | .pm = ES1938_PM_OPS, |
1887 | .resume = es1938_resume, | 1894 | }, |
1888 | #endif | ||
1889 | }; | 1895 | }; |
1890 | 1896 | ||
1891 | module_pci_driver(es1938_driver); | 1897 | 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 20580bf69697..88a9c20eb7a2 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3556,7 +3556,7 @@ static inline void hda_exec_init_verbs(struct hda_codec *codec) {} | |||
3556 | static void hda_call_codec_suspend(struct hda_codec *codec) | 3556 | static void hda_call_codec_suspend(struct hda_codec *codec) |
3557 | { | 3557 | { |
3558 | if (codec->patch_ops.suspend) | 3558 | if (codec->patch_ops.suspend) |
3559 | codec->patch_ops.suspend(codec, PMSG_SUSPEND); | 3559 | codec->patch_ops.suspend(codec); |
3560 | hda_cleanup_all_streams(codec); | 3560 | hda_cleanup_all_streams(codec); |
3561 | hda_set_power_state(codec, | 3561 | hda_set_power_state(codec, |
3562 | codec->afg ? codec->afg : codec->mfg, | 3562 | codec->afg ? codec->afg : codec->mfg, |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index a4ac1de7aa19..c422d330ca54 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -706,7 +706,7 @@ struct hda_codec_ops { | |||
706 | void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, | 706 | void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, |
707 | unsigned int power_state); | 707 | unsigned int power_state); |
708 | #ifdef CONFIG_PM | 708 | #ifdef CONFIG_PM |
709 | int (*suspend)(struct hda_codec *codec, pm_message_t state); | 709 | int (*suspend)(struct hda_codec *codec); |
710 | int (*resume)(struct hda_codec *codec); | 710 | int (*resume)(struct hda_codec *codec); |
711 | #endif | 711 | #endif |
712 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 712 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b4f3c7295a53..c8aced182fd1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2405,9 +2405,10 @@ static void azx_power_notify(struct hda_bus *bus) | |||
2405 | * power management | 2405 | * power management |
2406 | */ | 2406 | */ |
2407 | 2407 | ||
2408 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) | 2408 | static int azx_suspend(struct device *dev) |
2409 | { | 2409 | { |
2410 | struct snd_card *card = pci_get_drvdata(pci); | 2410 | struct pci_dev *pci = to_pci_dev(dev); |
2411 | struct snd_card *card = dev_get_drvdata(dev); | ||
2411 | struct azx *chip = card->private_data; | 2412 | struct azx *chip = card->private_data; |
2412 | struct azx_pcm *p; | 2413 | struct azx_pcm *p; |
2413 | 2414 | ||
@@ -2426,13 +2427,14 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2426 | pci_disable_msi(chip->pci); | 2427 | pci_disable_msi(chip->pci); |
2427 | pci_disable_device(pci); | 2428 | pci_disable_device(pci); |
2428 | pci_save_state(pci); | 2429 | pci_save_state(pci); |
2429 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2430 | pci_set_power_state(pci, PCI_D3hot); |
2430 | return 0; | 2431 | return 0; |
2431 | } | 2432 | } |
2432 | 2433 | ||
2433 | static int azx_resume(struct pci_dev *pci) | 2434 | static int azx_resume(struct device *dev) |
2434 | { | 2435 | { |
2435 | struct snd_card *card = pci_get_drvdata(pci); | 2436 | struct pci_dev *pci = to_pci_dev(dev); |
2437 | struct snd_card *card = dev_get_drvdata(dev); | ||
2436 | struct azx *chip = card->private_data; | 2438 | struct azx *chip = card->private_data; |
2437 | 2439 | ||
2438 | pci_set_power_state(pci, PCI_D0); | 2440 | pci_set_power_state(pci, PCI_D0); |
@@ -2457,6 +2459,12 @@ static int azx_resume(struct pci_dev *pci) | |||
2457 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2459 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2458 | return 0; | 2460 | return 0; |
2459 | } | 2461 | } |
2462 | static SIMPLE_DEV_PM_OPS(azx_pm, azx_suspend, azx_resume); | ||
2463 | #define AZX_PM_OPS &azx_pm | ||
2464 | #else | ||
2465 | #define azx_suspend(dev) | ||
2466 | #define azx_resume(dev) | ||
2467 | #define AZX_PM_OPS NULL | ||
2460 | #endif /* CONFIG_PM */ | 2468 | #endif /* CONFIG_PM */ |
2461 | 2469 | ||
2462 | 2470 | ||
@@ -2523,13 +2531,13 @@ static void azx_vs_set_state(struct pci_dev *pci, | |||
2523 | disabled ? "Disabling" : "Enabling", | 2531 | disabled ? "Disabling" : "Enabling", |
2524 | pci_name(chip->pci)); | 2532 | pci_name(chip->pci)); |
2525 | if (disabled) { | 2533 | if (disabled) { |
2526 | azx_suspend(pci, PMSG_FREEZE); | 2534 | azx_suspend(&pci->dev); |
2527 | chip->disabled = true; | 2535 | chip->disabled = true; |
2528 | snd_hda_lock_devices(chip->bus); | 2536 | snd_hda_lock_devices(chip->bus); |
2529 | } else { | 2537 | } else { |
2530 | snd_hda_unlock_devices(chip->bus); | 2538 | snd_hda_unlock_devices(chip->bus); |
2531 | chip->disabled = false; | 2539 | chip->disabled = false; |
2532 | azx_resume(pci); | 2540 | azx_resume(&pci->dev); |
2533 | } | 2541 | } |
2534 | } | 2542 | } |
2535 | } | 2543 | } |
@@ -3412,10 +3420,9 @@ static struct pci_driver azx_driver = { | |||
3412 | .id_table = azx_ids, | 3420 | .id_table = azx_ids, |
3413 | .probe = azx_probe, | 3421 | .probe = azx_probe, |
3414 | .remove = __devexit_p(azx_remove), | 3422 | .remove = __devexit_p(azx_remove), |
3415 | #ifdef CONFIG_PM | 3423 | .driver = { |
3416 | .suspend = azx_suspend, | 3424 | .pm = AZX_PM_OPS, |
3417 | .resume = azx_resume, | 3425 | }, |
3418 | #endif | ||
3419 | }; | 3426 | }; |
3420 | 3427 | ||
3421 | module_pci_driver(azx_driver); | 3428 | 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 ec14224021aa..537c365716a6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2442,7 +2442,7 @@ static void alc_power_eapd(struct hda_codec *codec) | |||
2442 | alc_auto_setup_eapd(codec, false); | 2442 | alc_auto_setup_eapd(codec, false); |
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | static int alc_suspend(struct hda_codec *codec, pm_message_t state) | 2445 | static int alc_suspend(struct hda_codec *codec) |
2446 | { | 2446 | { |
2447 | struct alc_spec *spec = codec->spec; | 2447 | struct alc_spec *spec = codec->spec; |
2448 | alc_shutup(codec); | 2448 | 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 adb3b4c7917e..c85d1ffcc955 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c | |||
@@ -2391,9 +2391,10 @@ static int snd_m3_free(struct snd_m3 *chip) | |||
2391 | * APM support | 2391 | * APM support |
2392 | */ | 2392 | */ |
2393 | #ifdef CONFIG_PM | 2393 | #ifdef CONFIG_PM |
2394 | static int m3_suspend(struct pci_dev *pci, pm_message_t state) | 2394 | static int m3_suspend(struct device *dev) |
2395 | { | 2395 | { |
2396 | struct snd_card *card = pci_get_drvdata(pci); | 2396 | struct pci_dev *pci = to_pci_dev(dev); |
2397 | struct snd_card *card = dev_get_drvdata(dev); | ||
2397 | struct snd_m3 *chip = card->private_data; | 2398 | struct snd_m3 *chip = card->private_data; |
2398 | int i, dsp_index; | 2399 | int i, dsp_index; |
2399 | 2400 | ||
@@ -2421,13 +2422,14 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state) | |||
2421 | 2422 | ||
2422 | pci_disable_device(pci); | 2423 | pci_disable_device(pci); |
2423 | pci_save_state(pci); | 2424 | pci_save_state(pci); |
2424 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2425 | pci_set_power_state(pci, PCI_D3hot); |
2425 | return 0; | 2426 | return 0; |
2426 | } | 2427 | } |
2427 | 2428 | ||
2428 | static int m3_resume(struct pci_dev *pci) | 2429 | static int m3_resume(struct device *dev) |
2429 | { | 2430 | { |
2430 | struct snd_card *card = pci_get_drvdata(pci); | 2431 | struct pci_dev *pci = to_pci_dev(dev); |
2432 | struct snd_card *card = dev_get_drvdata(dev); | ||
2431 | struct snd_m3 *chip = card->private_data; | 2433 | struct snd_m3 *chip = card->private_data; |
2432 | int i, dsp_index; | 2434 | int i, dsp_index; |
2433 | 2435 | ||
@@ -2478,6 +2480,11 @@ static int m3_resume(struct pci_dev *pci) | |||
2478 | chip->in_suspend = 0; | 2480 | chip->in_suspend = 0; |
2479 | return 0; | 2481 | return 0; |
2480 | } | 2482 | } |
2483 | |||
2484 | static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume); | ||
2485 | #define M3_PM_OPS &m3_pm | ||
2486 | #else | ||
2487 | #define M3_PM_OPS NULL | ||
2481 | #endif /* CONFIG_PM */ | 2488 | #endif /* CONFIG_PM */ |
2482 | 2489 | ||
2483 | #ifdef CONFIG_SND_MAESTRO3_INPUT | 2490 | #ifdef CONFIG_SND_MAESTRO3_INPUT |
@@ -2774,10 +2781,9 @@ static struct pci_driver m3_driver = { | |||
2774 | .id_table = snd_m3_ids, | 2781 | .id_table = snd_m3_ids, |
2775 | .probe = snd_m3_probe, | 2782 | .probe = snd_m3_probe, |
2776 | .remove = __devexit_p(snd_m3_remove), | 2783 | .remove = __devexit_p(snd_m3_remove), |
2777 | #ifdef CONFIG_PM | 2784 | .driver = { |
2778 | .suspend = m3_suspend, | 2785 | .pm = M3_PM_OPS, |
2779 | .resume = m3_resume, | 2786 | }, |
2780 | #endif | ||
2781 | }; | 2787 | }; |
2782 | 2788 | ||
2783 | module_pci_driver(m3_driver); | 2789 | 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..d36e6ca147e1 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/time.h> | 26 | #include <linux/time.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <sound/core.h> | 28 | #include <sound/core.h> |
29 | #include <sound/trident.h> | 29 | #include "trident.h" |
30 | #include <sound/initval.h> | 30 | #include <sound/initval.h> |
31 | 31 | ||
32 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>"); | 32 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, <audio@tridentmicro.com>"); |
@@ -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/include/sound/trident.h b/sound/pci/trident/trident.h index 9f191a0a1e19..5f110eb56e47 100644 --- a/include/sound/trident.h +++ b/sound/pci/trident/trident.h | |||
@@ -23,10 +23,10 @@ | |||
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "pcm.h" | 26 | #include <sound/pcm.h> |
27 | #include "mpu401.h" | 27 | #include <sound/mpu401.h> |
28 | #include "ac97_codec.h" | 28 | #include <sound/ac97_codec.h> |
29 | #include "util_mem.h" | 29 | #include <sound/util_mem.h> |
30 | 30 | ||
31 | #define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX) | 31 | #define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX) |
32 | #define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) | 32 | #define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) |
@@ -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/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 61d3c0e8d4ce..94011dcae731 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <sound/info.h> | 41 | #include <sound/info.h> |
42 | #include <sound/control.h> | 42 | #include <sound/control.h> |
43 | #include <sound/tlv.h> | 43 | #include <sound/tlv.h> |
44 | #include <sound/trident.h> | 44 | #include "trident.h" |
45 | #include <sound/asoundef.h> | 45 | #include <sound/asoundef.h> |
46 | 46 | ||
47 | #include <asm/io.h> | 47 | #include <asm/io.h> |
@@ -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/trident/trident_memory.c b/sound/pci/trident/trident_memory.c index f9779e23fe57..3102a579660b 100644 --- a/sound/pci/trident/trident_memory.c +++ b/sound/pci/trident/trident_memory.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | 30 | ||
31 | #include <sound/core.h> | 31 | #include <sound/core.h> |
32 | #include <sound/trident.h> | 32 | #include "trident.h" |
33 | 33 | ||
34 | /* page arguments of these two macros are Trident page (4096 bytes), not like | 34 | /* page arguments of these two macros are Trident page (4096 bytes), not like |
35 | * aligned pages in others | 35 | * aligned pages in others |
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..4810356b97ba 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/time.h> | 24 | #include <linux/time.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <sound/core.h> | 26 | #include <sound/core.h> |
27 | #include <sound/ymfpci.h> | 27 | #include "ymfpci.h" |
28 | #include <sound/mpu401.h> | 28 | #include <sound/mpu401.h> |
29 | #include <sound/opl3.h> | 29 | #include <sound/opl3.h> |
30 | #include <sound/initval.h> | 30 | #include <sound/initval.h> |
@@ -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/include/sound/ymfpci.h b/sound/pci/ymfpci/ymfpci.h index 41199664666b..bddc4052286b 100644 --- a/include/sound/ymfpci.h +++ b/sound/pci/ymfpci/ymfpci.h | |||
@@ -22,10 +22,10 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "pcm.h" | 25 | #include <sound/pcm.h> |
26 | #include "rawmidi.h" | 26 | #include <sound/rawmidi.h> |
27 | #include "ac97_codec.h" | 27 | #include <sound/ac97_codec.h> |
28 | #include "timer.h" | 28 | #include <sound/timer.h> |
29 | #include <linux/gameport.h> | 29 | #include <linux/gameport.h> |
30 | 30 | ||
31 | /* | 31 | /* |
@@ -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/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index a8159b81e9c4..62b23635b754 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <sound/control.h> | 33 | #include <sound/control.h> |
34 | #include <sound/info.h> | 34 | #include <sound/info.h> |
35 | #include <sound/tlv.h> | 35 | #include <sound/tlv.h> |
36 | #include <sound/ymfpci.h> | 36 | #include "ymfpci.h" |
37 | #include <sound/asoundef.h> | 37 | #include <sound/asoundef.h> |
38 | #include <sound/mpu401.h> | 38 | #include <sound/mpu401.h> |
39 | 39 | ||
@@ -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/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 830839a874b6..f9b5229b2723 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -251,7 +251,7 @@ static int pdacf_suspend(struct pcmcia_device *link) | |||
251 | snd_printdd(KERN_DEBUG "SUSPEND\n"); | 251 | snd_printdd(KERN_DEBUG "SUSPEND\n"); |
252 | if (chip) { | 252 | if (chip) { |
253 | snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); | 253 | snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); |
254 | snd_pdacf_suspend(chip, PMSG_SUSPEND); | 254 | snd_pdacf_suspend(chip); |
255 | } | 255 | } |
256 | 256 | ||
257 | return 0; | 257 | return 0; |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index 6ce9ad700290..ea41e57d7179 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h | |||
@@ -131,7 +131,7 @@ struct snd_pdacf *snd_pdacf_create(struct snd_card *card); | |||
131 | int snd_pdacf_ak4117_create(struct snd_pdacf *pdacf); | 131 | int snd_pdacf_ak4117_create(struct snd_pdacf *pdacf); |
132 | void snd_pdacf_powerdown(struct snd_pdacf *chip); | 132 | void snd_pdacf_powerdown(struct snd_pdacf *chip); |
133 | #ifdef CONFIG_PM | 133 | #ifdef CONFIG_PM |
134 | int snd_pdacf_suspend(struct snd_pdacf *chip, pm_message_t state); | 134 | int snd_pdacf_suspend(struct snd_pdacf *chip); |
135 | int snd_pdacf_resume(struct snd_pdacf *chip); | 135 | int snd_pdacf_resume(struct snd_pdacf *chip); |
136 | #endif | 136 | #endif |
137 | int snd_pdacf_pcm_new(struct snd_pdacf *chip); | 137 | int snd_pdacf_pcm_new(struct snd_pdacf *chip); |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c index 9dce0bde5c05..ea0adfb984ad 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c | |||
@@ -262,7 +262,7 @@ void snd_pdacf_powerdown(struct snd_pdacf *chip) | |||
262 | 262 | ||
263 | #ifdef CONFIG_PM | 263 | #ifdef CONFIG_PM |
264 | 264 | ||
265 | int snd_pdacf_suspend(struct snd_pdacf *chip, pm_message_t state) | 265 | int snd_pdacf_suspend(struct snd_pdacf *chip) |
266 | { | 266 | { |
267 | u16 val; | 267 | u16 val; |
268 | 268 | ||
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; |
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c index 5a4e263b5b0f..f5ceb6f282de 100644 --- a/sound/ppc/powermac.c +++ b/sound/ppc/powermac.c | |||
@@ -144,19 +144,24 @@ static int __devexit snd_pmac_remove(struct platform_device *devptr) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | #ifdef CONFIG_PM | 146 | #ifdef CONFIG_PM |
147 | static int snd_pmac_driver_suspend(struct platform_device *devptr, pm_message_t state) | 147 | static int snd_pmac_driver_suspend(struct device *dev) |
148 | { | 148 | { |
149 | struct snd_card *card = platform_get_drvdata(devptr); | 149 | struct snd_card *card = dev_get_drvdata(dev); |
150 | snd_pmac_suspend(card->private_data); | 150 | snd_pmac_suspend(card->private_data); |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |
153 | 153 | ||
154 | static int snd_pmac_driver_resume(struct platform_device *devptr) | 154 | static int snd_pmac_driver_resume(struct device *dev) |
155 | { | 155 | { |
156 | struct snd_card *card = platform_get_drvdata(devptr); | 156 | struct snd_card *card = dev_get_drvdata(dev); |
157 | snd_pmac_resume(card->private_data); | 157 | snd_pmac_resume(card->private_data); |
158 | return 0; | 158 | return 0; |
159 | } | 159 | } |
160 | |||
161 | static SIMPLE_DEV_PM_OPS(snd_pmac_pm, snd_pmac_driver_suspend, snd_pmac_driver_resume); | ||
162 | #define SND_PMAC_PM_OPS &snd_pmac_pm | ||
163 | #else | ||
164 | #define SND_PMAC_PM_OPS NULL | ||
160 | #endif | 165 | #endif |
161 | 166 | ||
162 | #define SND_PMAC_DRIVER "snd_powermac" | 167 | #define SND_PMAC_DRIVER "snd_powermac" |
@@ -164,12 +169,10 @@ static int snd_pmac_driver_resume(struct platform_device *devptr) | |||
164 | static struct platform_driver snd_pmac_driver = { | 169 | static struct platform_driver snd_pmac_driver = { |
165 | .probe = snd_pmac_probe, | 170 | .probe = snd_pmac_probe, |
166 | .remove = __devexit_p(snd_pmac_remove), | 171 | .remove = __devexit_p(snd_pmac_remove), |
167 | #ifdef CONFIG_PM | ||
168 | .suspend = snd_pmac_driver_suspend, | ||
169 | .resume = snd_pmac_driver_resume, | ||
170 | #endif | ||
171 | .driver = { | 172 | .driver = { |
172 | .name = SND_PMAC_DRIVER | 173 | .name = SND_PMAC_DRIVER, |
174 | .owner = THIS_MODULE, | ||
175 | .pm = SND_PMAC_PM_OPS, | ||
173 | }, | 176 | }, |
174 | }; | 177 | }; |
175 | 178 | ||
diff --git a/sound/sh/aica.c b/sound/sh/aica.c index 391a38ca58bc..d48b523207eb 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c | |||
@@ -654,7 +654,9 @@ static struct platform_driver snd_aica_driver = { | |||
654 | .probe = snd_aica_probe, | 654 | .probe = snd_aica_probe, |
655 | .remove = __devexit_p(snd_aica_remove), | 655 | .remove = __devexit_p(snd_aica_remove), |
656 | .driver = { | 656 | .driver = { |
657 | .name = SND_AICA_DRIVER}, | 657 | .name = SND_AICA_DRIVER, |
658 | .owner = THIS_MODULE, | ||
659 | }, | ||
658 | }; | 660 | }; |
659 | 661 | ||
660 | static int __init aica_init(void) | 662 | static int __init aica_init(void) |
diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c index f8b01c77b298..0a3394751ed2 100644 --- a/sound/sh/sh_dac_audio.c +++ b/sound/sh/sh_dac_audio.c | |||
@@ -438,6 +438,7 @@ static struct platform_driver sh_dac_driver = { | |||
438 | .remove = snd_sh_dac_remove, | 438 | .remove = snd_sh_dac_remove, |
439 | .driver = { | 439 | .driver = { |
440 | .name = "dac_audio", | 440 | .name = "dac_audio", |
441 | .owner = THIS_MODULE, | ||
441 | }, | 442 | }, |
442 | }; | 443 | }; |
443 | 444 | ||