diff options
Diffstat (limited to 'drivers')
56 files changed, 271 insertions, 542 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index a1a56ff65b76..75ce8711bca5 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -281,13 +281,9 @@ static int platform_suspend(struct device * dev, pm_message_t state) | |||
281 | { | 281 | { |
282 | int ret = 0; | 282 | int ret = 0; |
283 | 283 | ||
284 | if (dev->driver && dev->driver->suspend) { | 284 | if (dev->driver && dev->driver->suspend) |
285 | ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE); | 285 | ret = dev->driver->suspend(dev, state); |
286 | if (ret == 0) | 286 | |
287 | ret = dev->driver->suspend(dev, state, SUSPEND_SAVE_STATE); | ||
288 | if (ret == 0) | ||
289 | ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN); | ||
290 | } | ||
291 | return ret; | 287 | return ret; |
292 | } | 288 | } |
293 | 289 | ||
@@ -295,13 +291,9 @@ static int platform_resume(struct device * dev) | |||
295 | { | 291 | { |
296 | int ret = 0; | 292 | int ret = 0; |
297 | 293 | ||
298 | if (dev->driver && dev->driver->resume) { | 294 | if (dev->driver && dev->driver->resume) |
299 | ret = dev->driver->resume(dev, RESUME_POWER_ON); | 295 | ret = dev->driver->resume(dev); |
300 | if (ret == 0) | 296 | |
301 | ret = dev->driver->resume(dev, RESUME_RESTORE_STATE); | ||
302 | if (ret == 0) | ||
303 | ret = dev->driver->resume(dev, RESUME_ENABLE); | ||
304 | } | ||
305 | return ret; | 297 | return ret; |
306 | } | 298 | } |
307 | 299 | ||
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c index e1a90d9a8756..887b8b2d7882 100644 --- a/drivers/char/s3c2410-rtc.c +++ b/drivers/char/s3c2410-rtc.c | |||
@@ -519,30 +519,28 @@ static struct timespec s3c2410_rtc_delta; | |||
519 | 519 | ||
520 | static int ticnt_save; | 520 | static int ticnt_save; |
521 | 521 | ||
522 | static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state, u32 level) | 522 | static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state) |
523 | { | 523 | { |
524 | struct rtc_time tm; | 524 | struct rtc_time tm; |
525 | struct timespec time; | 525 | struct timespec time; |
526 | 526 | ||
527 | time.tv_nsec = 0; | 527 | time.tv_nsec = 0; |
528 | 528 | ||
529 | if (level == SUSPEND_POWER_DOWN) { | 529 | /* save TICNT for anyone using periodic interrupts */ |
530 | /* save TICNT for anyone using periodic interrupts */ | ||
531 | 530 | ||
532 | ticnt_save = readb(S3C2410_TICNT); | 531 | ticnt_save = readb(S3C2410_TICNT); |
533 | 532 | ||
534 | /* calculate time delta for suspend */ | 533 | /* calculate time delta for suspend */ |
535 | 534 | ||
536 | s3c2410_rtc_gettime(&tm); | 535 | s3c2410_rtc_gettime(&tm); |
537 | rtc_tm_to_time(&tm, &time.tv_sec); | 536 | rtc_tm_to_time(&tm, &time.tv_sec); |
538 | save_time_delta(&s3c2410_rtc_delta, &time); | 537 | save_time_delta(&s3c2410_rtc_delta, &time); |
539 | s3c2410_rtc_enable(dev, 0); | 538 | s3c2410_rtc_enable(dev, 0); |
540 | } | ||
541 | 539 | ||
542 | return 0; | 540 | return 0; |
543 | } | 541 | } |
544 | 542 | ||
545 | static int s3c2410_rtc_resume(struct device *dev, u32 level) | 543 | static int s3c2410_rtc_resume(struct device *dev) |
546 | { | 544 | { |
547 | struct rtc_time tm; | 545 | struct rtc_time tm; |
548 | struct timespec time; | 546 | struct timespec time; |
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index a4873684f22c..f86c15587238 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -1167,19 +1167,17 @@ static int sonypi_disable(void) | |||
1167 | #ifdef CONFIG_PM | 1167 | #ifdef CONFIG_PM |
1168 | static int old_camera_power; | 1168 | static int old_camera_power; |
1169 | 1169 | ||
1170 | static int sonypi_suspend(struct device *dev, pm_message_t state, u32 level) | 1170 | static int sonypi_suspend(struct device *dev, pm_message_t state) |
1171 | { | 1171 | { |
1172 | if (level == SUSPEND_DISABLE) { | 1172 | old_camera_power = sonypi_device.camera_power; |
1173 | old_camera_power = sonypi_device.camera_power; | 1173 | sonypi_disable(); |
1174 | sonypi_disable(); | 1174 | |
1175 | } | ||
1176 | return 0; | 1175 | return 0; |
1177 | } | 1176 | } |
1178 | 1177 | ||
1179 | static int sonypi_resume(struct device *dev, u32 level) | 1178 | static int sonypi_resume(struct device *dev) |
1180 | { | 1179 | { |
1181 | if (level == RESUME_ENABLE) | 1180 | sonypi_enable(old_camera_power); |
1182 | sonypi_enable(old_camera_power); | ||
1183 | return 0; | 1181 | return 0; |
1184 | } | 1182 | } |
1185 | #endif | 1183 | #endif |
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index 3625b2601b42..b732020acadb 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -464,32 +464,28 @@ static void s3c2410wdt_shutdown(struct device *dev) | |||
464 | static unsigned long wtcon_save; | 464 | static unsigned long wtcon_save; |
465 | static unsigned long wtdat_save; | 465 | static unsigned long wtdat_save; |
466 | 466 | ||
467 | static int s3c2410wdt_suspend(struct device *dev, pm_message_t state, u32 level) | 467 | static int s3c2410wdt_suspend(struct device *dev, pm_message_t state) |
468 | { | 468 | { |
469 | if (level == SUSPEND_POWER_DOWN) { | 469 | /* Save watchdog state, and turn it off. */ |
470 | /* Save watchdog state, and turn it off. */ | 470 | wtcon_save = readl(wdt_base + S3C2410_WTCON); |
471 | wtcon_save = readl(wdt_base + S3C2410_WTCON); | 471 | wtdat_save = readl(wdt_base + S3C2410_WTDAT); |
472 | wtdat_save = readl(wdt_base + S3C2410_WTDAT); | ||
473 | 472 | ||
474 | /* Note that WTCNT doesn't need to be saved. */ | 473 | /* Note that WTCNT doesn't need to be saved. */ |
475 | s3c2410wdt_stop(); | 474 | s3c2410wdt_stop(); |
476 | } | ||
477 | 475 | ||
478 | return 0; | 476 | return 0; |
479 | } | 477 | } |
480 | 478 | ||
481 | static int s3c2410wdt_resume(struct device *dev, u32 level) | 479 | static int s3c2410wdt_resume(struct device *dev) |
482 | { | 480 | { |
483 | if (level == RESUME_POWER_ON) { | 481 | /* Restore watchdog state. */ |
484 | /* Restore watchdog state. */ | ||
485 | 482 | ||
486 | writel(wtdat_save, wdt_base + S3C2410_WTDAT); | 483 | writel(wtdat_save, wdt_base + S3C2410_WTDAT); |
487 | writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ | 484 | writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ |
488 | writel(wtcon_save, wdt_base + S3C2410_WTCON); | 485 | writel(wtcon_save, wdt_base + S3C2410_WTCON); |
489 | 486 | ||
490 | printk(KERN_INFO PFX "watchdog %sabled\n", | 487 | printk(KERN_INFO PFX "watchdog %sabled\n", |
491 | (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); | 488 | (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); |
492 | } | ||
493 | 489 | ||
494 | return 0; | 490 | return 0; |
495 | } | 491 | } |
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index 7f0107613827..0015da5668a1 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c | |||
@@ -296,11 +296,9 @@ static int hdaps_probe(struct device *dev) | |||
296 | return 0; | 296 | return 0; |
297 | } | 297 | } |
298 | 298 | ||
299 | static int hdaps_resume(struct device *dev, u32 level) | 299 | static int hdaps_resume(struct device *dev) |
300 | { | 300 | { |
301 | if (level == RESUME_ENABLE) | 301 | return hdaps_device_init(); |
302 | return hdaps_device_init(); | ||
303 | return 0; | ||
304 | } | 302 | } |
305 | 303 | ||
306 | static struct device_driver hdaps_driver = { | 304 | static struct device_driver hdaps_driver = { |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 73a092fb0e7e..69fa282df2d5 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -879,14 +879,12 @@ static int s3c24xx_i2c_remove(struct device *dev) | |||
879 | } | 879 | } |
880 | 880 | ||
881 | #ifdef CONFIG_PM | 881 | #ifdef CONFIG_PM |
882 | static int s3c24xx_i2c_resume(struct device *dev, u32 level) | 882 | static int s3c24xx_i2c_resume(struct device *dev) |
883 | { | 883 | { |
884 | struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); | 884 | struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); |
885 | 885 | ||
886 | if (i2c != NULL && level == RESUME_ENABLE) { | 886 | if (i2c != NULL) |
887 | dev_dbg(dev, "resume: level %d\n", level); | ||
888 | s3c24xx_i2c_init(i2c); | 887 | s3c24xx_i2c_init(i2c); |
889 | } | ||
890 | 888 | ||
891 | return 0; | 889 | return 0; |
892 | } | 890 | } |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index dda472e5e8be..45aa0e54e297 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -48,7 +48,7 @@ static int i2c_bus_suspend(struct device * dev, pm_message_t state) | |||
48 | int rc = 0; | 48 | int rc = 0; |
49 | 49 | ||
50 | if (dev->driver && dev->driver->suspend) | 50 | if (dev->driver && dev->driver->suspend) |
51 | rc = dev->driver->suspend(dev,state,0); | 51 | rc = dev->driver->suspend(dev, state); |
52 | return rc; | 52 | return rc; |
53 | } | 53 | } |
54 | 54 | ||
@@ -57,7 +57,7 @@ static int i2c_bus_resume(struct device * dev) | |||
57 | int rc = 0; | 57 | int rc = 0; |
58 | 58 | ||
59 | if (dev->driver && dev->driver->resume) | 59 | if (dev->driver && dev->driver->resume) |
60 | rc = dev->driver->resume(dev,0); | 60 | rc = dev->driver->resume(dev); |
61 | return rc; | 61 | return rc; |
62 | } | 62 | } |
63 | 63 | ||
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 347ece6b583c..7fff5a1d2ea4 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c | |||
@@ -1292,7 +1292,7 @@ static void nodemgr_suspend_ne(struct node_entry *ne) | |||
1292 | 1292 | ||
1293 | if (ud->device.driver && | 1293 | if (ud->device.driver && |
1294 | (!ud->device.driver->suspend || | 1294 | (!ud->device.driver->suspend || |
1295 | ud->device.driver->suspend(&ud->device, PMSG_SUSPEND, 0))) | 1295 | ud->device.driver->suspend(&ud->device, PMSG_SUSPEND))) |
1296 | device_release_driver(&ud->device); | 1296 | device_release_driver(&ud->device); |
1297 | } | 1297 | } |
1298 | up_write(&ne->device.bus->subsys.rwsem); | 1298 | up_write(&ne->device.bus->subsys.rwsem); |
@@ -1315,7 +1315,7 @@ static void nodemgr_resume_ne(struct node_entry *ne) | |||
1315 | continue; | 1315 | continue; |
1316 | 1316 | ||
1317 | if (ud->device.driver && ud->device.driver->resume) | 1317 | if (ud->device.driver && ud->device.driver->resume) |
1318 | ud->device.driver->resume(&ud->device, 0); | 1318 | ud->device.driver->resume(&ud->device); |
1319 | } | 1319 | } |
1320 | up_read(&ne->device.bus->subsys.rwsem); | 1320 | up_read(&ne->device.bus->subsys.rwsem); |
1321 | 1321 | ||
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index 564bb365f6fc..3210d298b3bc 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -259,24 +259,22 @@ static void corgikbd_hinge_timer(unsigned long data) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | #ifdef CONFIG_PM | 261 | #ifdef CONFIG_PM |
262 | static int corgikbd_suspend(struct device *dev, pm_message_t state, uint32_t level) | 262 | static int corgikbd_suspend(struct device *dev, pm_message_t state) |
263 | { | 263 | { |
264 | if (level == SUSPEND_POWER_DOWN) { | 264 | struct corgikbd *corgikbd = dev_get_drvdata(dev); |
265 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 265 | corgikbd->suspended = 1; |
266 | corgikbd->suspended = 1; | 266 | |
267 | } | ||
268 | return 0; | 267 | return 0; |
269 | } | 268 | } |
270 | 269 | ||
271 | static int corgikbd_resume(struct device *dev, uint32_t level) | 270 | static int corgikbd_resume(struct device *dev) |
272 | { | 271 | { |
273 | if (level == RESUME_POWER_ON) { | 272 | struct corgikbd *corgikbd = dev_get_drvdata(dev); |
274 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 273 | |
274 | /* Upon resume, ignore the suspend key for a short while */ | ||
275 | corgikbd->suspend_jiffies=jiffies; | ||
276 | corgikbd->suspended = 0; | ||
275 | 277 | ||
276 | /* Upon resume, ignore the suspend key for a short while */ | ||
277 | corgikbd->suspend_jiffies=jiffies; | ||
278 | corgikbd->suspended = 0; | ||
279 | } | ||
280 | return 0; | 278 | return 0; |
281 | } | 279 | } |
282 | #else | 280 | #else |
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 732fb310e487..cee9c734a048 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -309,34 +309,32 @@ static void spitzkbd_hinge_timer(unsigned long data) | |||
309 | } | 309 | } |
310 | 310 | ||
311 | #ifdef CONFIG_PM | 311 | #ifdef CONFIG_PM |
312 | static int spitzkbd_suspend(struct device *dev, pm_message_t state, uint32_t level) | 312 | static int spitzkbd_suspend(struct device *dev, pm_message_t state) |
313 | { | 313 | { |
314 | if (level == SUSPEND_POWER_DOWN) { | 314 | int i; |
315 | int i; | 315 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); |
316 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 316 | spitzkbd->suspended = 1; |
317 | spitzkbd->suspended = 1; | 317 | |
318 | 318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this | |
319 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this | 319 | enabled so we can detect a power button press for resume */ |
320 | enabled so we can detect a power button press for resume */ | 320 | for (i = 1; i < SPITZ_KEY_STROBE_NUM; i++) |
321 | for (i = 1; i < SPITZ_KEY_STROBE_NUM; i++) | 321 | pxa_gpio_mode(spitz_strobes[i] | GPIO_IN); |
322 | pxa_gpio_mode(spitz_strobes[i] | GPIO_IN); | 322 | |
323 | } | ||
324 | return 0; | 323 | return 0; |
325 | } | 324 | } |
326 | 325 | ||
327 | static int spitzkbd_resume(struct device *dev, uint32_t level) | 326 | static int spitzkbd_resume(struct device *dev) |
328 | { | 327 | { |
329 | if (level == RESUME_POWER_ON) { | 328 | int i; |
330 | int i; | 329 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); |
331 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 330 | |
331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) | ||
332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); | ||
332 | 333 | ||
333 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) | 334 | /* Upon resume, ignore the suspend key for a short while */ |
334 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); | 335 | spitzkbd->suspend_jiffies = jiffies; |
336 | spitzkbd->suspended = 0; | ||
335 | 337 | ||
336 | /* Upon resume, ignore the suspend key for a short while */ | ||
337 | spitzkbd->suspend_jiffies = jiffies; | ||
338 | spitzkbd->suspended = 0; | ||
339 | } | ||
340 | return 0; | 338 | return 0; |
341 | } | 339 | } |
342 | #else | 340 | #else |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 40d451ce07ff..4bc40f159996 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -911,12 +911,10 @@ static long i8042_panic_blink(long count) | |||
911 | * Here we try to restore the original BIOS settings | 911 | * Here we try to restore the original BIOS settings |
912 | */ | 912 | */ |
913 | 913 | ||
914 | static int i8042_suspend(struct device *dev, pm_message_t state, u32 level) | 914 | static int i8042_suspend(struct device *dev, pm_message_t state) |
915 | { | 915 | { |
916 | if (level == SUSPEND_DISABLE) { | 916 | del_timer_sync(&i8042_timer); |
917 | del_timer_sync(&i8042_timer); | 917 | i8042_controller_reset(); |
918 | i8042_controller_reset(); | ||
919 | } | ||
920 | 918 | ||
921 | return 0; | 919 | return 0; |
922 | } | 920 | } |
@@ -926,13 +924,10 @@ static int i8042_suspend(struct device *dev, pm_message_t state, u32 level) | |||
926 | * Here we try to reset everything back to a state in which suspended | 924 | * Here we try to reset everything back to a state in which suspended |
927 | */ | 925 | */ |
928 | 926 | ||
929 | static int i8042_resume(struct device *dev, u32 level) | 927 | static int i8042_resume(struct device *dev) |
930 | { | 928 | { |
931 | int i; | 929 | int i; |
932 | 930 | ||
933 | if (level != RESUME_ENABLE) | ||
934 | return 0; | ||
935 | |||
936 | if (i8042_ctl_test()) | 931 | if (i8042_ctl_test()) |
937 | return -1; | 932 | return -1; |
938 | 933 | ||
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 40ae183ba1cd..0ba3e6562bff 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
@@ -231,34 +231,32 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
231 | } | 231 | } |
232 | 232 | ||
233 | #ifdef CONFIG_PM | 233 | #ifdef CONFIG_PM |
234 | static int corgits_suspend(struct device *dev, pm_message_t state, uint32_t level) | 234 | static int corgits_suspend(struct device *dev, pm_message_t state) |
235 | { | 235 | { |
236 | if (level == SUSPEND_POWER_DOWN) { | 236 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); |
237 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | ||
238 | |||
239 | if (corgi_ts->pendown) { | ||
240 | del_timer_sync(&corgi_ts->timer); | ||
241 | corgi_ts->tc.pressure = 0; | ||
242 | new_data(corgi_ts, NULL); | ||
243 | corgi_ts->pendown = 0; | ||
244 | } | ||
245 | corgi_ts->power_mode = PWR_MODE_SUSPEND; | ||
246 | 237 | ||
247 | corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | 238 | if (corgi_ts->pendown) { |
239 | del_timer_sync(&corgi_ts->timer); | ||
240 | corgi_ts->tc.pressure = 0; | ||
241 | new_data(corgi_ts, NULL); | ||
242 | corgi_ts->pendown = 0; | ||
248 | } | 243 | } |
244 | corgi_ts->power_mode = PWR_MODE_SUSPEND; | ||
245 | |||
246 | corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | ||
247 | |||
249 | return 0; | 248 | return 0; |
250 | } | 249 | } |
251 | 250 | ||
252 | static int corgits_resume(struct device *dev, uint32_t level) | 251 | static int corgits_resume(struct device *dev) |
253 | { | 252 | { |
254 | if (level == RESUME_POWER_ON) { | 253 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); |
255 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 254 | |
255 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | ||
256 | /* Enable Falling Edge */ | ||
257 | set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); | ||
258 | corgi_ts->power_mode = PWR_MODE_ACTIVE; | ||
256 | 259 | ||
257 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | ||
258 | /* Enable Falling Edge */ | ||
259 | set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); | ||
260 | corgi_ts->power_mode = PWR_MODE_ACTIVE; | ||
261 | } | ||
262 | return 0; | 260 | return 0; |
263 | } | 261 | } |
264 | #else | 262 | #else |
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index f0d43fc2632f..262890cb20a7 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
@@ -1420,8 +1420,8 @@ static int msp_detach(struct i2c_client *client); | |||
1420 | static int msp_probe(struct i2c_adapter *adap); | 1420 | static int msp_probe(struct i2c_adapter *adap); |
1421 | static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); | 1421 | static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); |
1422 | 1422 | ||
1423 | static int msp_suspend(struct device * dev, pm_message_t state, u32 level); | 1423 | static int msp_suspend(struct device * dev, pm_message_t state); |
1424 | static int msp_resume(struct device * dev, u32 level); | 1424 | static int msp_resume(struct device * dev); |
1425 | 1425 | ||
1426 | static void msp_wake_thread(struct i2c_client *client); | 1426 | static void msp_wake_thread(struct i2c_client *client); |
1427 | 1427 | ||
@@ -1821,7 +1821,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1821 | return 0; | 1821 | return 0; |
1822 | } | 1822 | } |
1823 | 1823 | ||
1824 | static int msp_suspend(struct device * dev, pm_message_t state, u32 level) | 1824 | static int msp_suspend(struct device * dev, pm_message_t state) |
1825 | { | 1825 | { |
1826 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); | 1826 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); |
1827 | 1827 | ||
@@ -1830,7 +1830,7 @@ static int msp_suspend(struct device * dev, pm_message_t state, u32 level) | |||
1830 | return 0; | 1830 | return 0; |
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | static int msp_resume(struct device * dev, u32 level) | 1833 | static int msp_resume(struct device * dev) |
1834 | { | 1834 | { |
1835 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); | 1835 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); |
1836 | 1836 | ||
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 0456dda2624d..94053f149ddf 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -784,13 +784,13 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
784 | return 0; | 784 | return 0; |
785 | } | 785 | } |
786 | 786 | ||
787 | static int tda9887_suspend(struct device * dev, pm_message_t state, u32 level) | 787 | static int tda9887_suspend(struct device * dev, pm_message_t state) |
788 | { | 788 | { |
789 | dprintk("tda9887: suspend\n"); | 789 | dprintk("tda9887: suspend\n"); |
790 | return 0; | 790 | return 0; |
791 | } | 791 | } |
792 | 792 | ||
793 | static int tda9887_resume(struct device * dev, u32 level) | 793 | static int tda9887_resume(struct device * dev) |
794 | { | 794 | { |
795 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); | 795 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); |
796 | struct tda9887 *t = i2c_get_clientdata(c); | 796 | struct tda9887 *t = i2c_get_clientdata(c); |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 05572020af4d..ad85bef1c3d5 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -697,7 +697,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
697 | return 0; | 697 | return 0; |
698 | } | 698 | } |
699 | 699 | ||
700 | static int tuner_suspend(struct device *dev, pm_message_t state, u32 level) | 700 | static int tuner_suspend(struct device *dev, pm_message_t state) |
701 | { | 701 | { |
702 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); | 702 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); |
703 | struct tuner *t = i2c_get_clientdata (c); | 703 | struct tuner *t = i2c_get_clientdata (c); |
@@ -707,7 +707,7 @@ static int tuner_suspend(struct device *dev, pm_message_t state, u32 level) | |||
707 | return 0; | 707 | return 0; |
708 | } | 708 | } |
709 | 709 | ||
710 | static int tuner_resume(struct device *dev, u32 level) | 710 | static int tuner_resume(struct device *dev) |
711 | { | 711 | { |
712 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); | 712 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); |
713 | struct tuner *t = i2c_get_clientdata (c); | 713 | struct tuner *t = i2c_get_clientdata (c); |
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index e9806fbbe696..720e7a326308 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c | |||
@@ -219,26 +219,24 @@ static int mcp_sa11x0_remove(struct device *dev) | |||
219 | return 0; | 219 | return 0; |
220 | } | 220 | } |
221 | 221 | ||
222 | static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state, u32 level) | 222 | static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) |
223 | { | 223 | { |
224 | struct mcp *mcp = dev_get_drvdata(dev); | 224 | struct mcp *mcp = dev_get_drvdata(dev); |
225 | 225 | ||
226 | if (level == SUSPEND_DISABLE) { | 226 | priv(mcp)->mccr0 = Ser4MCCR0; |
227 | priv(mcp)->mccr0 = Ser4MCCR0; | 227 | priv(mcp)->mccr1 = Ser4MCCR1; |
228 | priv(mcp)->mccr1 = Ser4MCCR1; | 228 | Ser4MCCR0 &= ~MCCR0_MCE; |
229 | Ser4MCCR0 &= ~MCCR0_MCE; | 229 | |
230 | } | ||
231 | return 0; | 230 | return 0; |
232 | } | 231 | } |
233 | 232 | ||
234 | static int mcp_sa11x0_resume(struct device *dev, u32 level) | 233 | static int mcp_sa11x0_resume(struct device *dev) |
235 | { | 234 | { |
236 | struct mcp *mcp = dev_get_drvdata(dev); | 235 | struct mcp *mcp = dev_get_drvdata(dev); |
237 | 236 | ||
238 | if (level == RESUME_RESTORE_STATE) { | 237 | Ser4MCCR1 = priv(mcp)->mccr1; |
239 | Ser4MCCR1 = priv(mcp)->mccr1; | 238 | Ser4MCCR0 = priv(mcp)->mccr0; |
240 | Ser4MCCR0 = priv(mcp)->mccr0; | 239 | |
241 | } | ||
242 | return 0; | 240 | return 0; |
243 | } | 241 | } |
244 | 242 | ||
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index b53af57074e3..8eba373d42d7 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -571,23 +571,23 @@ static int pxamci_remove(struct device *dev) | |||
571 | } | 571 | } |
572 | 572 | ||
573 | #ifdef CONFIG_PM | 573 | #ifdef CONFIG_PM |
574 | static int pxamci_suspend(struct device *dev, pm_message_t state, u32 level) | 574 | static int pxamci_suspend(struct device *dev, pm_message_t state) |
575 | { | 575 | { |
576 | struct mmc_host *mmc = dev_get_drvdata(dev); | 576 | struct mmc_host *mmc = dev_get_drvdata(dev); |
577 | int ret = 0; | 577 | int ret = 0; |
578 | 578 | ||
579 | if (mmc && level == SUSPEND_DISABLE) | 579 | if (mmc) |
580 | ret = mmc_suspend_host(mmc, state); | 580 | ret = mmc_suspend_host(mmc, state); |
581 | 581 | ||
582 | return ret; | 582 | return ret; |
583 | } | 583 | } |
584 | 584 | ||
585 | static int pxamci_resume(struct device *dev, u32 level) | 585 | static int pxamci_resume(struct device *dev) |
586 | { | 586 | { |
587 | struct mmc_host *mmc = dev_get_drvdata(dev); | 587 | struct mmc_host *mmc = dev_get_drvdata(dev); |
588 | int ret = 0; | 588 | int ret = 0; |
589 | 589 | ||
590 | if (mmc && level == RESUME_ENABLE) | 590 | if (mmc) |
591 | ret = mmc_resume_host(mmc); | 591 | ret = mmc_resume_host(mmc); |
592 | 592 | ||
593 | return ret; | 593 | return ret; |
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 3cbca7cbea80..25f7ce7b3bc0 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -1955,14 +1955,14 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev) | |||
1955 | */ | 1955 | */ |
1956 | 1956 | ||
1957 | #ifdef CONFIG_PM | 1957 | #ifdef CONFIG_PM |
1958 | static int wbsd_suspend(struct device *dev, pm_message_t state, u32 level) | 1958 | static int wbsd_suspend(struct device *dev, pm_message_t state) |
1959 | { | 1959 | { |
1960 | DBGF("Not yet supported\n"); | 1960 | DBGF("Not yet supported\n"); |
1961 | 1961 | ||
1962 | return 0; | 1962 | return 0; |
1963 | } | 1963 | } |
1964 | 1964 | ||
1965 | static int wbsd_resume(struct device *dev, u32 level) | 1965 | static int wbsd_resume(struct device *dev) |
1966 | { | 1966 | { |
1967 | DBGF("Not yet supported\n"); | 1967 | DBGF("Not yet supported\n"); |
1968 | 1968 | ||
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index 8dcaa357b4bb..55f21ddec3df 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c | |||
@@ -402,21 +402,21 @@ static int __exit sa1100_mtd_remove(struct device *dev) | |||
402 | } | 402 | } |
403 | 403 | ||
404 | #ifdef CONFIG_PM | 404 | #ifdef CONFIG_PM |
405 | static int sa1100_mtd_suspend(struct device *dev, pm_message_t state, u32 level) | 405 | static int sa1100_mtd_suspend(struct device *dev, pm_message_t state) |
406 | { | 406 | { |
407 | struct sa_info *info = dev_get_drvdata(dev); | 407 | struct sa_info *info = dev_get_drvdata(dev); |
408 | int ret = 0; | 408 | int ret = 0; |
409 | 409 | ||
410 | if (info && level == SUSPEND_SAVE_STATE) | 410 | if (info) |
411 | ret = info->mtd->suspend(info->mtd); | 411 | ret = info->mtd->suspend(info->mtd); |
412 | 412 | ||
413 | return ret; | 413 | return ret; |
414 | } | 414 | } |
415 | 415 | ||
416 | static int sa1100_mtd_resume(struct device *dev, u32 level) | 416 | static int sa1100_mtd_resume(struct device *dev) |
417 | { | 417 | { |
418 | struct sa_info *info = dev_get_drvdata(dev); | 418 | struct sa_info *info = dev_get_drvdata(dev); |
419 | if (info && level == RESUME_RESTORE_STATE) | 419 | if (info) |
420 | info->mtd->resume(info->mtd); | 420 | info->mtd->resume(info->mtd); |
421 | return 0; | 421 | return 0; |
422 | } | 422 | } |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index e54fc10f6846..abce1f730d00 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -1140,11 +1140,11 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static int | 1142 | static int |
1143 | dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level) | 1143 | dm9000_drv_suspend(struct device *dev, pm_message_t state) |
1144 | { | 1144 | { |
1145 | struct net_device *ndev = dev_get_drvdata(dev); | 1145 | struct net_device *ndev = dev_get_drvdata(dev); |
1146 | 1146 | ||
1147 | if (ndev && level == SUSPEND_DISABLE) { | 1147 | if (ndev) { |
1148 | if (netif_running(ndev)) { | 1148 | if (netif_running(ndev)) { |
1149 | netif_device_detach(ndev); | 1149 | netif_device_detach(ndev); |
1150 | dm9000_shutdown(ndev); | 1150 | dm9000_shutdown(ndev); |
@@ -1154,12 +1154,12 @@ dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level) | |||
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | static int | 1156 | static int |
1157 | dm9000_drv_resume(struct device *dev, u32 level) | 1157 | dm9000_drv_resume(struct device *dev) |
1158 | { | 1158 | { |
1159 | struct net_device *ndev = dev_get_drvdata(dev); | 1159 | struct net_device *ndev = dev_get_drvdata(dev); |
1160 | board_info_t *db = (board_info_t *) ndev->priv; | 1160 | board_info_t *db = (board_info_t *) ndev->priv; |
1161 | 1161 | ||
1162 | if (ndev && level == RESUME_ENABLE) { | 1162 | if (ndev) { |
1163 | 1163 | ||
1164 | if (netif_running(ndev)) { | 1164 | if (netif_running(ndev)) { |
1165 | dm9000_reset(db); | 1165 | dm9000_reset(db); |
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index 8d34ac60d906..06883309916d 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c | |||
@@ -291,12 +291,12 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si) | |||
291 | /* | 291 | /* |
292 | * Suspend the IrDA interface. | 292 | * Suspend the IrDA interface. |
293 | */ | 293 | */ |
294 | static int sa1100_irda_suspend(struct device *_dev, pm_message_t state, u32 level) | 294 | static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) |
295 | { | 295 | { |
296 | struct net_device *dev = dev_get_drvdata(_dev); | 296 | struct net_device *dev = dev_get_drvdata(_dev); |
297 | struct sa1100_irda *si; | 297 | struct sa1100_irda *si; |
298 | 298 | ||
299 | if (!dev || level != SUSPEND_DISABLE) | 299 | if (!dev) |
300 | return 0; | 300 | return 0; |
301 | 301 | ||
302 | si = dev->priv; | 302 | si = dev->priv; |
@@ -316,12 +316,12 @@ static int sa1100_irda_suspend(struct device *_dev, pm_message_t state, u32 leve | |||
316 | /* | 316 | /* |
317 | * Resume the IrDA interface. | 317 | * Resume the IrDA interface. |
318 | */ | 318 | */ |
319 | static int sa1100_irda_resume(struct device *_dev, u32 level) | 319 | static int sa1100_irda_resume(struct device *_dev) |
320 | { | 320 | { |
321 | struct net_device *dev = dev_get_drvdata(_dev); | 321 | struct net_device *dev = dev_get_drvdata(_dev); |
322 | struct sa1100_irda *si; | 322 | struct sa1100_irda *si; |
323 | 323 | ||
324 | if (!dev || level != RESUME_ENABLE) | 324 | if (!dev) |
325 | return 0; | 325 | return 0; |
326 | 326 | ||
327 | si = dev->priv; | 327 | si = dev->priv; |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index dd89bda1f131..bbac720cca63 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -213,8 +213,8 @@ static int smsc_ircc_probe_transceiver_smsc_ircc_atc(int fir_base); | |||
213 | 213 | ||
214 | /* Power Management */ | 214 | /* Power Management */ |
215 | 215 | ||
216 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level); | 216 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state); |
217 | static int smsc_ircc_resume(struct device *dev, u32 level); | 217 | static int smsc_ircc_resume(struct device *dev); |
218 | 218 | ||
219 | static struct device_driver smsc_ircc_driver = { | 219 | static struct device_driver smsc_ircc_driver = { |
220 | .name = SMSC_IRCC2_DRIVER_NAME, | 220 | .name = SMSC_IRCC2_DRIVER_NAME, |
@@ -1646,13 +1646,13 @@ static int smsc_ircc_net_close(struct net_device *dev) | |||
1646 | return 0; | 1646 | return 0; |
1647 | } | 1647 | } |
1648 | 1648 | ||
1649 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level) | 1649 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state) |
1650 | { | 1650 | { |
1651 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1651 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); |
1652 | 1652 | ||
1653 | IRDA_MESSAGE("%s, Suspending\n", driver_name); | 1653 | IRDA_MESSAGE("%s, Suspending\n", driver_name); |
1654 | 1654 | ||
1655 | if (level == SUSPEND_DISABLE && !self->io.suspended) { | 1655 | if (!self->io.suspended) { |
1656 | smsc_ircc_net_close(self->netdev); | 1656 | smsc_ircc_net_close(self->netdev); |
1657 | self->io.suspended = 1; | 1657 | self->io.suspended = 1; |
1658 | } | 1658 | } |
@@ -1660,11 +1660,11 @@ static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level) | |||
1660 | return 0; | 1660 | return 0; |
1661 | } | 1661 | } |
1662 | 1662 | ||
1663 | static int smsc_ircc_resume(struct device *dev, u32 level) | 1663 | static int smsc_ircc_resume(struct device *dev) |
1664 | { | 1664 | { |
1665 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1665 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); |
1666 | 1666 | ||
1667 | if (level == RESUME_ENABLE && self->io.suspended) { | 1667 | if (self->io.suspended) { |
1668 | 1668 | ||
1669 | smsc_ircc_net_open(self->netdev); | 1669 | smsc_ircc_net_open(self->netdev); |
1670 | self->io.suspended = 0; | 1670 | self->io.suspended = 0; |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 90630672703d..ad93b0da87f0 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -133,13 +133,9 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state) | |||
133 | int ret = 0; | 133 | int ret = 0; |
134 | struct device_driver *drv = dev->driver; | 134 | struct device_driver *drv = dev->driver; |
135 | 135 | ||
136 | if (drv && drv->suspend) { | 136 | if (drv && drv->suspend) |
137 | ret = drv->suspend(dev, state, SUSPEND_DISABLE); | 137 | ret = drv->suspend(dev, state); |
138 | if (ret == 0) | 138 | |
139 | ret = drv->suspend(dev, state, SUSPEND_SAVE_STATE); | ||
140 | if (ret == 0) | ||
141 | ret = drv->suspend(dev, state, SUSPEND_POWER_DOWN); | ||
142 | } | ||
143 | return ret; | 139 | return ret; |
144 | } | 140 | } |
145 | 141 | ||
@@ -148,13 +144,9 @@ static int mdio_bus_resume(struct device * dev) | |||
148 | int ret = 0; | 144 | int ret = 0; |
149 | struct device_driver *drv = dev->driver; | 145 | struct device_driver *drv = dev->driver; |
150 | 146 | ||
151 | if (drv && drv->resume) { | 147 | if (drv && drv->resume) |
152 | ret = drv->resume(dev, RESUME_POWER_ON); | 148 | ret = drv->resume(dev); |
153 | if (ret == 0) | 149 | |
154 | ret = drv->resume(dev, RESUME_RESTORE_STATE); | ||
155 | if (ret == 0) | ||
156 | ret = drv->resume(dev, RESUME_ENABLE); | ||
157 | } | ||
158 | return ret; | 150 | return ret; |
159 | } | 151 | } |
160 | 152 | ||
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 1438fdd20826..0ddaa611cc61 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2291,11 +2291,11 @@ static int smc_drv_remove(struct device *dev) | |||
2291 | return 0; | 2291 | return 0; |
2292 | } | 2292 | } |
2293 | 2293 | ||
2294 | static int smc_drv_suspend(struct device *dev, pm_message_t state, u32 level) | 2294 | static int smc_drv_suspend(struct device *dev, pm_message_t state) |
2295 | { | 2295 | { |
2296 | struct net_device *ndev = dev_get_drvdata(dev); | 2296 | struct net_device *ndev = dev_get_drvdata(dev); |
2297 | 2297 | ||
2298 | if (ndev && level == SUSPEND_DISABLE) { | 2298 | if (ndev) { |
2299 | if (netif_running(ndev)) { | 2299 | if (netif_running(ndev)) { |
2300 | netif_device_detach(ndev); | 2300 | netif_device_detach(ndev); |
2301 | smc_shutdown(ndev); | 2301 | smc_shutdown(ndev); |
@@ -2305,12 +2305,12 @@ static int smc_drv_suspend(struct device *dev, pm_message_t state, u32 level) | |||
2305 | return 0; | 2305 | return 0; |
2306 | } | 2306 | } |
2307 | 2307 | ||
2308 | static int smc_drv_resume(struct device *dev, u32 level) | 2308 | static int smc_drv_resume(struct device *dev) |
2309 | { | 2309 | { |
2310 | struct platform_device *pdev = to_platform_device(dev); | 2310 | struct platform_device *pdev = to_platform_device(dev); |
2311 | struct net_device *ndev = dev_get_drvdata(dev); | 2311 | struct net_device *ndev = dev_get_drvdata(dev); |
2312 | 2312 | ||
2313 | if (ndev && level == RESUME_ENABLE) { | 2313 | if (ndev) { |
2314 | struct smc_local *lp = netdev_priv(ndev); | 2314 | struct smc_local *lp = netdev_priv(ndev); |
2315 | smc_enable_device(pdev); | 2315 | smc_enable_device(pdev); |
2316 | if (netif_running(ndev)) { | 2316 | if (netif_running(ndev)) { |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 393e0cee91a9..14f05d22bb70 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -61,7 +61,7 @@ static int pcie_port_remove_service(struct device *dev) | |||
61 | 61 | ||
62 | static void pcie_port_shutdown_service(struct device *dev) {} | 62 | static void pcie_port_shutdown_service(struct device *dev) {} |
63 | 63 | ||
64 | static int pcie_port_suspend_service(struct device *dev, pm_message_t state, u32 level) | 64 | static int pcie_port_suspend_service(struct device *dev, pm_message_t state) |
65 | { | 65 | { |
66 | struct pcie_device *pciedev; | 66 | struct pcie_device *pciedev; |
67 | struct pcie_port_service_driver *driver; | 67 | struct pcie_port_service_driver *driver; |
@@ -76,7 +76,7 @@ static int pcie_port_suspend_service(struct device *dev, pm_message_t state, u32 | |||
76 | return 0; | 76 | return 0; |
77 | } | 77 | } |
78 | 78 | ||
79 | static int pcie_port_resume_service(struct device *dev, u32 level) | 79 | static int pcie_port_resume_service(struct device *dev) |
80 | { | 80 | { |
81 | struct pcie_device *pciedev; | 81 | struct pcie_device *pciedev; |
82 | struct pcie_port_service_driver *driver; | 82 | struct pcie_port_service_driver *driver; |
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c index 470ef756252e..d90a634cebf5 100644 --- a/drivers/pcmcia/au1000_generic.c +++ b/drivers/pcmcia/au1000_generic.c | |||
@@ -519,30 +519,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev) | |||
519 | } | 519 | } |
520 | 520 | ||
521 | 521 | ||
522 | static int au1x00_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) | ||
523 | { | ||
524 | int ret = 0; | ||
525 | if (level == SUSPEND_SAVE_STATE) | ||
526 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
527 | return ret; | ||
528 | } | ||
529 | |||
530 | static int au1x00_drv_pcmcia_resume(struct device *dev, u32 level) | ||
531 | { | ||
532 | int ret = 0; | ||
533 | if (level == RESUME_RESTORE_STATE) | ||
534 | ret = pcmcia_socket_dev_resume(dev); | ||
535 | return ret; | ||
536 | } | ||
537 | |||
538 | |||
539 | static struct device_driver au1x00_pcmcia_driver = { | 522 | static struct device_driver au1x00_pcmcia_driver = { |
540 | .probe = au1x00_drv_pcmcia_probe, | 523 | .probe = au1x00_drv_pcmcia_probe, |
541 | .remove = au1x00_drv_pcmcia_remove, | 524 | .remove = au1x00_drv_pcmcia_remove, |
542 | .name = "au1x00-pcmcia", | 525 | .name = "au1x00-pcmcia", |
543 | .bus = &platform_bus_type, | 526 | .bus = &platform_bus_type, |
544 | .suspend = au1x00_drv_pcmcia_suspend, | 527 | .suspend = pcmcia_socket_dev_suspend, |
545 | .resume = au1x00_drv_pcmcia_resume | 528 | .resume = pcmcia_socket_dev_resume, |
546 | }; | 529 | }; |
547 | 530 | ||
548 | static struct platform_device au1x00_device = { | 531 | static struct platform_device au1x00_device = { |
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c index 316f8bcc878b..b57a0b98b4d6 100644 --- a/drivers/pcmcia/hd64465_ss.c +++ b/drivers/pcmcia/hd64465_ss.c | |||
@@ -844,27 +844,11 @@ static void hs_exit_socket(hs_socket_t *sp) | |||
844 | local_irq_restore(flags); | 844 | local_irq_restore(flags); |
845 | } | 845 | } |
846 | 846 | ||
847 | static int hd64465_suspend(struct device *dev, pm_message_t state, u32 level) | ||
848 | { | ||
849 | int ret = 0; | ||
850 | if (level == SUSPEND_SAVE_STATE) | ||
851 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
852 | return ret; | ||
853 | } | ||
854 | |||
855 | static int hd64465_resume(struct device *dev, u32 level) | ||
856 | { | ||
857 | int ret = 0; | ||
858 | if (level == RESUME_RESTORE_STATE) | ||
859 | ret = pcmcia_socket_dev_resume(dev); | ||
860 | return ret; | ||
861 | } | ||
862 | |||
863 | static struct device_driver hd64465_driver = { | 847 | static struct device_driver hd64465_driver = { |
864 | .name = "hd64465-pcmcia", | 848 | .name = "hd64465-pcmcia", |
865 | .bus = &platform_bus_type, | 849 | .bus = &platform_bus_type, |
866 | .suspend = hd64465_suspend, | 850 | .suspend = pcmcia_socket_dev_suspend, |
867 | .resume = hd64465_resume, | 851 | .resume = pcmcia_socket_dev_resume, |
868 | }; | 852 | }; |
869 | 853 | ||
870 | static struct platform_device hd64465_device = { | 854 | static struct platform_device hd64465_device = { |
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index a713015e8228..4a41f67d185d 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c | |||
@@ -1332,27 +1332,11 @@ static struct pccard_operations pcic_operations = { | |||
1332 | 1332 | ||
1333 | /*====================================================================*/ | 1333 | /*====================================================================*/ |
1334 | 1334 | ||
1335 | static int i82365_suspend(struct device *dev, pm_message_t state, u32 level) | ||
1336 | { | ||
1337 | int ret = 0; | ||
1338 | if (level == SUSPEND_SAVE_STATE) | ||
1339 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
1340 | return ret; | ||
1341 | } | ||
1342 | |||
1343 | static int i82365_resume(struct device *dev, u32 level) | ||
1344 | { | ||
1345 | int ret = 0; | ||
1346 | if (level == RESUME_RESTORE_STATE) | ||
1347 | ret = pcmcia_socket_dev_resume(dev); | ||
1348 | return ret; | ||
1349 | } | ||
1350 | |||
1351 | static struct device_driver i82365_driver = { | 1335 | static struct device_driver i82365_driver = { |
1352 | .name = "i82365", | 1336 | .name = "i82365", |
1353 | .bus = &platform_bus_type, | 1337 | .bus = &platform_bus_type, |
1354 | .suspend = i82365_suspend, | 1338 | .suspend = pcmcia_socket_dev_suspend, |
1355 | .resume = i82365_resume, | 1339 | .resume = pcmcia_socket_dev_resume, |
1356 | }; | 1340 | }; |
1357 | 1341 | ||
1358 | static struct platform_device i82365_device = { | 1342 | static struct platform_device i82365_device = { |
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c index 65f3ee3d4d3c..c6ed70ea4812 100644 --- a/drivers/pcmcia/m32r_cfc.c +++ b/drivers/pcmcia/m32r_cfc.c | |||
@@ -731,28 +731,11 @@ static struct pccard_operations pcc_operations = { | |||
731 | 731 | ||
732 | /*====================================================================*/ | 732 | /*====================================================================*/ |
733 | 733 | ||
734 | static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level) | ||
735 | { | ||
736 | int ret = 0; | ||
737 | if (level == SUSPEND_SAVE_STATE) | ||
738 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
739 | return ret; | ||
740 | } | ||
741 | |||
742 | static int m32r_pcc_resume(struct device *dev, u32 level) | ||
743 | { | ||
744 | int ret = 0; | ||
745 | if (level == RESUME_RESTORE_STATE) | ||
746 | ret = pcmcia_socket_dev_resume(dev); | ||
747 | return ret; | ||
748 | } | ||
749 | |||
750 | |||
751 | static struct device_driver pcc_driver = { | 734 | static struct device_driver pcc_driver = { |
752 | .name = "cfc", | 735 | .name = "cfc", |
753 | .bus = &platform_bus_type, | 736 | .bus = &platform_bus_type, |
754 | .suspend = m32r_pcc_suspend, | 737 | .suspend = pcmcia_socket_dev_suspend, |
755 | .resume = m32r_pcc_resume, | 738 | .resume = pcmcia_socket_dev_resume, |
756 | }; | 739 | }; |
757 | 740 | ||
758 | static struct platform_device pcc_device = { | 741 | static struct platform_device pcc_device = { |
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 7b14d7efd68c..3397ff28de6a 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c | |||
@@ -695,28 +695,11 @@ static struct pccard_operations pcc_operations = { | |||
695 | 695 | ||
696 | /*====================================================================*/ | 696 | /*====================================================================*/ |
697 | 697 | ||
698 | static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level) | ||
699 | { | ||
700 | int ret = 0; | ||
701 | if (level == SUSPEND_SAVE_STATE) | ||
702 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
703 | return ret; | ||
704 | } | ||
705 | |||
706 | static int m32r_pcc_resume(struct device *dev, u32 level) | ||
707 | { | ||
708 | int ret = 0; | ||
709 | if (level == RESUME_RESTORE_STATE) | ||
710 | ret = pcmcia_socket_dev_resume(dev); | ||
711 | return ret; | ||
712 | } | ||
713 | |||
714 | |||
715 | static struct device_driver pcc_driver = { | 698 | static struct device_driver pcc_driver = { |
716 | .name = "pcc", | 699 | .name = "pcc", |
717 | .bus = &platform_bus_type, | 700 | .bus = &platform_bus_type, |
718 | .suspend = m32r_pcc_suspend, | 701 | .suspend = pcmcia_socket_dev_suspend, |
719 | .resume = m32r_pcc_resume, | 702 | .resume = pcmcia_socket_dev_resume, |
720 | }; | 703 | }; |
721 | 704 | ||
722 | static struct platform_device pcc_device = { | 705 | static struct platform_device pcc_device = { |
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 94be9e51654e..2558c3cc91ec 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -329,27 +329,13 @@ static int __devexit omap_cf_remove(struct device *dev) | |||
329 | return 0; | 329 | return 0; |
330 | } | 330 | } |
331 | 331 | ||
332 | static int omap_cf_suspend(struct device *dev, pm_message_t mesg, u32 level) | ||
333 | { | ||
334 | if (level != SUSPEND_SAVE_STATE) | ||
335 | return 0; | ||
336 | return pcmcia_socket_dev_suspend(dev, mesg); | ||
337 | } | ||
338 | |||
339 | static int omap_cf_resume(struct device *dev, u32 level) | ||
340 | { | ||
341 | if (level != RESUME_RESTORE_STATE) | ||
342 | return 0; | ||
343 | return pcmcia_socket_dev_resume(dev); | ||
344 | } | ||
345 | |||
346 | static struct device_driver omap_cf_driver = { | 332 | static struct device_driver omap_cf_driver = { |
347 | .name = (char *) driver_name, | 333 | .name = (char *) driver_name, |
348 | .bus = &platform_bus_type, | 334 | .bus = &platform_bus_type, |
349 | .probe = omap_cf_probe, | 335 | .probe = omap_cf_probe, |
350 | .remove = __devexit_p(omap_cf_remove), | 336 | .remove = __devexit_p(omap_cf_remove), |
351 | .suspend = omap_cf_suspend, | 337 | .suspend = pcmcia_socket_dev_suspend, |
352 | .resume = omap_cf_resume, | 338 | .resume = pcmcia_socket_dev_resume, |
353 | }; | 339 | }; |
354 | 340 | ||
355 | static int __init omap_cf_init(void) | 341 | static int __init omap_cf_init(void) |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 325c992f7d8f..c2a12d53f6c7 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -205,32 +205,20 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev) | |||
205 | } | 205 | } |
206 | EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe); | 206 | EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe); |
207 | 207 | ||
208 | static int pxa2xx_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) | 208 | static int pxa2xx_drv_pcmcia_resume(struct device *dev) |
209 | { | 209 | { |
210 | int ret = 0; | 210 | struct pcmcia_low_level *ops = dev->platform_data; |
211 | if (level == SUSPEND_SAVE_STATE) | 211 | int nr = ops ? ops->nr : 0; |
212 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
213 | return ret; | ||
214 | } | ||
215 | 212 | ||
216 | static int pxa2xx_drv_pcmcia_resume(struct device *dev, u32 level) | 213 | MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0); |
217 | { | 214 | |
218 | int ret = 0; | 215 | return pcmcia_socket_dev_resume(dev); |
219 | if (level == RESUME_RESTORE_STATE) | ||
220 | { | ||
221 | struct pcmcia_low_level *ops = dev->platform_data; | ||
222 | int nr = ops ? ops->nr : 0; | ||
223 | |||
224 | MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0); | ||
225 | ret = pcmcia_socket_dev_resume(dev); | ||
226 | } | ||
227 | return ret; | ||
228 | } | 216 | } |
229 | 217 | ||
230 | static struct device_driver pxa2xx_pcmcia_driver = { | 218 | static struct device_driver pxa2xx_pcmcia_driver = { |
231 | .probe = pxa2xx_drv_pcmcia_probe, | 219 | .probe = pxa2xx_drv_pcmcia_probe, |
232 | .remove = soc_common_drv_pcmcia_remove, | 220 | .remove = soc_common_drv_pcmcia_remove, |
233 | .suspend = pxa2xx_drv_pcmcia_suspend, | 221 | .suspend = pcmcia_socket_dev_suspend, |
234 | .resume = pxa2xx_drv_pcmcia_resume, | 222 | .resume = pxa2xx_drv_pcmcia_resume, |
235 | .name = "pxa2xx-pcmcia", | 223 | .name = "pxa2xx-pcmcia", |
236 | .bus = &platform_bus_type, | 224 | .bus = &platform_bus_type, |
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index d4ed508b38be..b768fa81f043 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -74,29 +74,13 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev) | |||
74 | return ret; | 74 | return ret; |
75 | } | 75 | } |
76 | 76 | ||
77 | static int sa11x0_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) | ||
78 | { | ||
79 | int ret = 0; | ||
80 | if (level == SUSPEND_SAVE_STATE) | ||
81 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
82 | return ret; | ||
83 | } | ||
84 | |||
85 | static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level) | ||
86 | { | ||
87 | int ret = 0; | ||
88 | if (level == RESUME_RESTORE_STATE) | ||
89 | ret = pcmcia_socket_dev_resume(dev); | ||
90 | return ret; | ||
91 | } | ||
92 | |||
93 | static struct device_driver sa11x0_pcmcia_driver = { | 77 | static struct device_driver sa11x0_pcmcia_driver = { |
94 | .probe = sa11x0_drv_pcmcia_probe, | 78 | .probe = sa11x0_drv_pcmcia_probe, |
95 | .remove = soc_common_drv_pcmcia_remove, | 79 | .remove = soc_common_drv_pcmcia_remove, |
96 | .name = "sa11x0-pcmcia", | 80 | .name = "sa11x0-pcmcia", |
97 | .bus = &platform_bus_type, | 81 | .bus = &platform_bus_type, |
98 | .suspend = sa11x0_drv_pcmcia_suspend, | 82 | .suspend = pcmcia_socket_dev_suspend, |
99 | .resume = sa11x0_drv_pcmcia_resume, | 83 | .resume = pcmcia_socket_dev_resume, |
100 | }; | 84 | }; |
101 | 85 | ||
102 | /* sa11x0_pcmcia_init() | 86 | /* sa11x0_pcmcia_init() |
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c index d5a61eae6119..f158b67f6610 100644 --- a/drivers/pcmcia/tcic.c +++ b/drivers/pcmcia/tcic.c | |||
@@ -372,27 +372,11 @@ static int __init get_tcic_id(void) | |||
372 | 372 | ||
373 | /*====================================================================*/ | 373 | /*====================================================================*/ |
374 | 374 | ||
375 | static int tcic_drv_suspend(struct device *dev, pm_message_t state, u32 level) | ||
376 | { | ||
377 | int ret = 0; | ||
378 | if (level == SUSPEND_SAVE_STATE) | ||
379 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
380 | return ret; | ||
381 | } | ||
382 | |||
383 | static int tcic_drv_resume(struct device *dev, u32 level) | ||
384 | { | ||
385 | int ret = 0; | ||
386 | if (level == RESUME_RESTORE_STATE) | ||
387 | ret = pcmcia_socket_dev_resume(dev); | ||
388 | return ret; | ||
389 | } | ||
390 | |||
391 | static struct device_driver tcic_driver = { | 375 | static struct device_driver tcic_driver = { |
392 | .name = "tcic-pcmcia", | 376 | .name = "tcic-pcmcia", |
393 | .bus = &platform_bus_type, | 377 | .bus = &platform_bus_type, |
394 | .suspend = tcic_drv_suspend, | 378 | .suspend = pcmcia_socket_dev_suspend, |
395 | .resume = tcic_drv_resume, | 379 | .resume = pcmcia_socket_dev_resume, |
396 | }; | 380 | }; |
397 | 381 | ||
398 | static struct platform_device tcic_device = { | 382 | static struct platform_device tcic_device = { |
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c index 17bb2da6752b..3d2dca675e02 100644 --- a/drivers/pcmcia/vrc4171_card.c +++ b/drivers/pcmcia/vrc4171_card.c | |||
@@ -774,31 +774,11 @@ static int __devinit vrc4171_card_setup(char *options) | |||
774 | 774 | ||
775 | __setup("vrc4171_card=", vrc4171_card_setup); | 775 | __setup("vrc4171_card=", vrc4171_card_setup); |
776 | 776 | ||
777 | static int vrc4171_card_suspend(struct device *dev, pm_message_t state, u32 level) | ||
778 | { | ||
779 | int retval = 0; | ||
780 | |||
781 | if (level == SUSPEND_SAVE_STATE) | ||
782 | retval = pcmcia_socket_dev_suspend(dev, state); | ||
783 | |||
784 | return retval; | ||
785 | } | ||
786 | |||
787 | static int vrc4171_card_resume(struct device *dev, u32 level) | ||
788 | { | ||
789 | int retval = 0; | ||
790 | |||
791 | if (level == RESUME_RESTORE_STATE) | ||
792 | retval = pcmcia_socket_dev_resume(dev); | ||
793 | |||
794 | return retval; | ||
795 | } | ||
796 | |||
797 | static struct device_driver vrc4171_card_driver = { | 777 | static struct device_driver vrc4171_card_driver = { |
798 | .name = vrc4171_card_name, | 778 | .name = vrc4171_card_name, |
799 | .bus = &platform_bus_type, | 779 | .bus = &platform_bus_type, |
800 | .suspend = vrc4171_card_suspend, | 780 | .suspend = pcmcia_socket_dev_suspend, |
801 | .resume = vrc4171_card_resume, | 781 | .resume = pcmcia_socket_dev_resume, |
802 | }; | 782 | }; |
803 | 783 | ||
804 | static int __devinit vrc4171_card_init(void) | 784 | static int __devinit vrc4171_card_init(void) |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 4d75cdfa0a0a..afb7ddf200e0 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2358,13 +2358,10 @@ static int __devexit serial8250_remove(struct device *dev) | |||
2358 | return 0; | 2358 | return 0; |
2359 | } | 2359 | } |
2360 | 2360 | ||
2361 | static int serial8250_suspend(struct device *dev, pm_message_t state, u32 level) | 2361 | static int serial8250_suspend(struct device *dev, pm_message_t state) |
2362 | { | 2362 | { |
2363 | int i; | 2363 | int i; |
2364 | 2364 | ||
2365 | if (level != SUSPEND_DISABLE) | ||
2366 | return 0; | ||
2367 | |||
2368 | for (i = 0; i < UART_NR; i++) { | 2365 | for (i = 0; i < UART_NR; i++) { |
2369 | struct uart_8250_port *up = &serial8250_ports[i]; | 2366 | struct uart_8250_port *up = &serial8250_ports[i]; |
2370 | 2367 | ||
@@ -2375,13 +2372,10 @@ static int serial8250_suspend(struct device *dev, pm_message_t state, u32 level) | |||
2375 | return 0; | 2372 | return 0; |
2376 | } | 2373 | } |
2377 | 2374 | ||
2378 | static int serial8250_resume(struct device *dev, u32 level) | 2375 | static int serial8250_resume(struct device *dev) |
2379 | { | 2376 | { |
2380 | int i; | 2377 | int i; |
2381 | 2378 | ||
2382 | if (level != RESUME_ENABLE) | ||
2383 | return 0; | ||
2384 | |||
2385 | for (i = 0; i < UART_NR; i++) { | 2379 | for (i = 0; i < UART_NR; i++) { |
2386 | struct uart_8250_port *up = &serial8250_ports[i]; | 2380 | struct uart_8250_port *up = &serial8250_ports[i]; |
2387 | 2381 | ||
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index bdb4e454b8b0..5b3933b0c997 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -921,21 +921,21 @@ static struct uart_driver imx_reg = { | |||
921 | .cons = IMX_CONSOLE, | 921 | .cons = IMX_CONSOLE, |
922 | }; | 922 | }; |
923 | 923 | ||
924 | static int serial_imx_suspend(struct device *_dev, pm_message_t state, u32 level) | 924 | static int serial_imx_suspend(struct device *_dev, pm_message_t state) |
925 | { | 925 | { |
926 | struct imx_port *sport = dev_get_drvdata(_dev); | 926 | struct imx_port *sport = dev_get_drvdata(_dev); |
927 | 927 | ||
928 | if (sport && level == SUSPEND_DISABLE) | 928 | if (sport) |
929 | uart_suspend_port(&imx_reg, &sport->port); | 929 | uart_suspend_port(&imx_reg, &sport->port); |
930 | 930 | ||
931 | return 0; | 931 | return 0; |
932 | } | 932 | } |
933 | 933 | ||
934 | static int serial_imx_resume(struct device *_dev, u32 level) | 934 | static int serial_imx_resume(struct device *_dev) |
935 | { | 935 | { |
936 | struct imx_port *sport = dev_get_drvdata(_dev); | 936 | struct imx_port *sport = dev_get_drvdata(_dev); |
937 | 937 | ||
938 | if (sport && level == RESUME_ENABLE) | 938 | if (sport) |
939 | uart_resume_port(&imx_reg, &sport->port); | 939 | uart_resume_port(&imx_reg, &sport->port); |
940 | 940 | ||
941 | return 0; | 941 | return 0; |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 0585ab27ffde..8a79968f8ce1 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -781,22 +781,22 @@ mpc52xx_uart_remove(struct device *dev) | |||
781 | 781 | ||
782 | #ifdef CONFIG_PM | 782 | #ifdef CONFIG_PM |
783 | static int | 783 | static int |
784 | mpc52xx_uart_suspend(struct device *dev, pm_message_t state, u32 level) | 784 | mpc52xx_uart_suspend(struct device *dev, pm_message_t state) |
785 | { | 785 | { |
786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); |
787 | 787 | ||
788 | if (sport && level == SUSPEND_DISABLE) | 788 | if (sport) |
789 | uart_suspend_port(&mpc52xx_uart_driver, port); | 789 | uart_suspend_port(&mpc52xx_uart_driver, port); |
790 | 790 | ||
791 | return 0; | 791 | return 0; |
792 | } | 792 | } |
793 | 793 | ||
794 | static int | 794 | static int |
795 | mpc52xx_uart_resume(struct device *dev, u32 level) | 795 | mpc52xx_uart_resume(struct device *dev) |
796 | { | 796 | { |
797 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 797 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); |
798 | 798 | ||
799 | if (port && level == RESUME_ENABLE) | 799 | if (port) |
800 | uart_resume_port(&mpc52xx_uart_driver, port); | 800 | uart_resume_port(&mpc52xx_uart_driver, port); |
801 | 801 | ||
802 | return 0; | 802 | return 0; |
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 90c2a86c421b..7999686d7b47 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
@@ -786,21 +786,21 @@ static struct uart_driver serial_pxa_reg = { | |||
786 | .cons = PXA_CONSOLE, | 786 | .cons = PXA_CONSOLE, |
787 | }; | 787 | }; |
788 | 788 | ||
789 | static int serial_pxa_suspend(struct device *_dev, pm_message_t state, u32 level) | 789 | static int serial_pxa_suspend(struct device *_dev, pm_message_t state) |
790 | { | 790 | { |
791 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 791 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); |
792 | 792 | ||
793 | if (sport && level == SUSPEND_DISABLE) | 793 | if (sport) |
794 | uart_suspend_port(&serial_pxa_reg, &sport->port); | 794 | uart_suspend_port(&serial_pxa_reg, &sport->port); |
795 | 795 | ||
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | 798 | ||
799 | static int serial_pxa_resume(struct device *_dev, u32 level) | 799 | static int serial_pxa_resume(struct device *_dev) |
800 | { | 800 | { |
801 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); | 801 | struct uart_pxa_port *sport = dev_get_drvdata(_dev); |
802 | 802 | ||
803 | if (sport && level == RESUME_ENABLE) | 803 | if (sport) |
804 | uart_resume_port(&serial_pxa_reg, &sport->port); | 804 | uart_resume_port(&serial_pxa_reg, &sport->port); |
805 | 805 | ||
806 | return 0; | 806 | return 0; |
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 52692aa345ec..06a17dff1a73 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -1134,23 +1134,22 @@ static int s3c24xx_serial_remove(struct device *_dev) | |||
1134 | 1134 | ||
1135 | #ifdef CONFIG_PM | 1135 | #ifdef CONFIG_PM |
1136 | 1136 | ||
1137 | static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state, | 1137 | static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state) |
1138 | u32 level) | ||
1139 | { | 1138 | { |
1140 | struct uart_port *port = s3c24xx_dev_to_port(dev); | 1139 | struct uart_port *port = s3c24xx_dev_to_port(dev); |
1141 | 1140 | ||
1142 | if (port && level == SUSPEND_DISABLE) | 1141 | if (port) |
1143 | uart_suspend_port(&s3c24xx_uart_drv, port); | 1142 | uart_suspend_port(&s3c24xx_uart_drv, port); |
1144 | 1143 | ||
1145 | return 0; | 1144 | return 0; |
1146 | } | 1145 | } |
1147 | 1146 | ||
1148 | static int s3c24xx_serial_resume(struct device *dev, u32 level) | 1147 | static int s3c24xx_serial_resume(struct device *dev) |
1149 | { | 1148 | { |
1150 | struct uart_port *port = s3c24xx_dev_to_port(dev); | 1149 | struct uart_port *port = s3c24xx_dev_to_port(dev); |
1151 | struct s3c24xx_uart_port *ourport = to_ourport(port); | 1150 | struct s3c24xx_uart_port *ourport = to_ourport(port); |
1152 | 1151 | ||
1153 | if (port && level == RESUME_ENABLE) { | 1152 | if (port) { |
1154 | clk_enable(ourport->clk); | 1153 | clk_enable(ourport->clk); |
1155 | s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); | 1154 | s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); |
1156 | clk_disable(ourport->clk); | 1155 | clk_disable(ourport->clk); |
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index dd8aed242357..c4a789e6af44 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
@@ -834,21 +834,21 @@ static struct uart_driver sa1100_reg = { | |||
834 | .cons = SA1100_CONSOLE, | 834 | .cons = SA1100_CONSOLE, |
835 | }; | 835 | }; |
836 | 836 | ||
837 | static int sa1100_serial_suspend(struct device *_dev, pm_message_t state, u32 level) | 837 | static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) |
838 | { | 838 | { |
839 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 839 | struct sa1100_port *sport = dev_get_drvdata(_dev); |
840 | 840 | ||
841 | if (sport && level == SUSPEND_DISABLE) | 841 | if (sport) |
842 | uart_suspend_port(&sa1100_reg, &sport->port); | 842 | uart_suspend_port(&sa1100_reg, &sport->port); |
843 | 843 | ||
844 | return 0; | 844 | return 0; |
845 | } | 845 | } |
846 | 846 | ||
847 | static int sa1100_serial_resume(struct device *_dev, u32 level) | 847 | static int sa1100_serial_resume(struct device *_dev) |
848 | { | 848 | { |
849 | struct sa1100_port *sport = dev_get_drvdata(_dev); | 849 | struct sa1100_port *sport = dev_get_drvdata(_dev); |
850 | 850 | ||
851 | if (sport && level == RESUME_ENABLE) | 851 | if (sport) |
852 | uart_resume_port(&sa1100_reg, &sport->port); | 852 | uart_resume_port(&sa1100_reg, &sport->port); |
853 | 853 | ||
854 | return 0; | 854 | return 0; |
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 0c5d65a08f6e..2b623ab0e36e 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c | |||
@@ -976,14 +976,11 @@ static int siu_remove(struct device *dev) | |||
976 | return 0; | 976 | return 0; |
977 | } | 977 | } |
978 | 978 | ||
979 | static int siu_suspend(struct device *dev, pm_message_t state, u32 level) | 979 | static int siu_suspend(struct device *dev, pm_message_t state) |
980 | { | 980 | { |
981 | struct uart_port *port; | 981 | struct uart_port *port; |
982 | int i; | 982 | int i; |
983 | 983 | ||
984 | if (level != SUSPEND_DISABLE) | ||
985 | return 0; | ||
986 | |||
987 | for (i = 0; i < siu_uart_driver.nr; i++) { | 984 | for (i = 0; i < siu_uart_driver.nr; i++) { |
988 | port = &siu_uart_ports[i]; | 985 | port = &siu_uart_ports[i]; |
989 | if ((port->type == PORT_VR41XX_SIU || | 986 | if ((port->type == PORT_VR41XX_SIU || |
@@ -995,14 +992,11 @@ static int siu_suspend(struct device *dev, pm_message_t state, u32 level) | |||
995 | return 0; | 992 | return 0; |
996 | } | 993 | } |
997 | 994 | ||
998 | static int siu_resume(struct device *dev, u32 level) | 995 | static int siu_resume(struct device *dev) |
999 | { | 996 | { |
1000 | struct uart_port *port; | 997 | struct uart_port *port; |
1001 | int i; | 998 | int i; |
1002 | 999 | ||
1003 | if (level != RESUME_ENABLE) | ||
1004 | return 0; | ||
1005 | |||
1006 | for (i = 0; i < siu_uart_driver.nr; i++) { | 1000 | for (i = 0; i < siu_uart_driver.nr; i++) { |
1007 | port = &siu_uart_ports[i]; | 1001 | port = &siu_uart_ports[i]; |
1008 | if ((port->type == PORT_VR41XX_SIU || | 1002 | if ((port->type == PORT_VR41XX_SIU || |
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 583db7c38cf1..f2bdf4e1eb80 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -935,14 +935,10 @@ static int dummy_udc_remove (struct device *dev) | |||
935 | return 0; | 935 | return 0; |
936 | } | 936 | } |
937 | 937 | ||
938 | static int dummy_udc_suspend (struct device *dev, pm_message_t state, | 938 | static int dummy_udc_suspend (struct device *dev, pm_message_t state) |
939 | u32 level) | ||
940 | { | 939 | { |
941 | struct dummy *dum = dev_get_drvdata(dev); | 940 | struct dummy *dum = dev_get_drvdata(dev); |
942 | 941 | ||
943 | if (level != SUSPEND_DISABLE) | ||
944 | return 0; | ||
945 | |||
946 | dev_dbg (dev, "%s\n", __FUNCTION__); | 942 | dev_dbg (dev, "%s\n", __FUNCTION__); |
947 | spin_lock_irq (&dum->lock); | 943 | spin_lock_irq (&dum->lock); |
948 | dum->udc_suspended = 1; | 944 | dum->udc_suspended = 1; |
@@ -954,13 +950,10 @@ static int dummy_udc_suspend (struct device *dev, pm_message_t state, | |||
954 | return 0; | 950 | return 0; |
955 | } | 951 | } |
956 | 952 | ||
957 | static int dummy_udc_resume (struct device *dev, u32 level) | 953 | static int dummy_udc_resume (struct device *dev) |
958 | { | 954 | { |
959 | struct dummy *dum = dev_get_drvdata(dev); | 955 | struct dummy *dum = dev_get_drvdata(dev); |
960 | 956 | ||
961 | if (level != RESUME_ENABLE) | ||
962 | return 0; | ||
963 | |||
964 | dev_dbg (dev, "%s\n", __FUNCTION__); | 957 | dev_dbg (dev, "%s\n", __FUNCTION__); |
965 | spin_lock_irq (&dum->lock); | 958 | spin_lock_irq (&dum->lock); |
966 | dum->udc_suspended = 0; | 959 | dum->udc_suspended = 0; |
@@ -1936,14 +1929,10 @@ static int dummy_hcd_remove (struct device *dev) | |||
1936 | return 0; | 1929 | return 0; |
1937 | } | 1930 | } |
1938 | 1931 | ||
1939 | static int dummy_hcd_suspend (struct device *dev, pm_message_t state, | 1932 | static int dummy_hcd_suspend (struct device *dev, pm_message_t state) |
1940 | u32 level) | ||
1941 | { | 1933 | { |
1942 | struct usb_hcd *hcd; | 1934 | struct usb_hcd *hcd; |
1943 | 1935 | ||
1944 | if (level != SUSPEND_DISABLE) | ||
1945 | return 0; | ||
1946 | |||
1947 | dev_dbg (dev, "%s\n", __FUNCTION__); | 1936 | dev_dbg (dev, "%s\n", __FUNCTION__); |
1948 | hcd = dev_get_drvdata (dev); | 1937 | hcd = dev_get_drvdata (dev); |
1949 | 1938 | ||
@@ -1958,13 +1947,10 @@ static int dummy_hcd_suspend (struct device *dev, pm_message_t state, | |||
1958 | return 0; | 1947 | return 0; |
1959 | } | 1948 | } |
1960 | 1949 | ||
1961 | static int dummy_hcd_resume (struct device *dev, u32 level) | 1950 | static int dummy_hcd_resume (struct device *dev) |
1962 | { | 1951 | { |
1963 | struct usb_hcd *hcd; | 1952 | struct usb_hcd *hcd; |
1964 | 1953 | ||
1965 | if (level != RESUME_ENABLE) | ||
1966 | return 0; | ||
1967 | |||
1968 | dev_dbg (dev, "%s\n", __FUNCTION__); | 1954 | dev_dbg (dev, "%s\n", __FUNCTION__); |
1969 | hcd = dev_get_drvdata (dev); | 1955 | hcd = dev_get_drvdata (dev); |
1970 | hcd->state = HC_STATE_RUNNING; | 1956 | hcd->state = HC_STATE_RUNNING; |
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index ff5533e69560..58b3ec97fb9a 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -2909,12 +2909,10 @@ static int __exit omap_udc_remove(struct device *dev) | |||
2909 | * may involve talking to an external transceiver (e.g. isp1301). | 2909 | * may involve talking to an external transceiver (e.g. isp1301). |
2910 | */ | 2910 | */ |
2911 | 2911 | ||
2912 | static int omap_udc_suspend(struct device *dev, pm_message_t message, u32 level) | 2912 | static int omap_udc_suspend(struct device *dev, pm_message_t message) |
2913 | { | 2913 | { |
2914 | u32 devstat; | 2914 | u32 devstat; |
2915 | 2915 | ||
2916 | if (level != SUSPEND_POWER_DOWN) | ||
2917 | return 0; | ||
2918 | devstat = UDC_DEVSTAT_REG; | 2916 | devstat = UDC_DEVSTAT_REG; |
2919 | 2917 | ||
2920 | /* we're requesting 48 MHz clock if the pullup is enabled | 2918 | /* we're requesting 48 MHz clock if the pullup is enabled |
@@ -2931,11 +2929,8 @@ static int omap_udc_suspend(struct device *dev, pm_message_t message, u32 level) | |||
2931 | return 0; | 2929 | return 0; |
2932 | } | 2930 | } |
2933 | 2931 | ||
2934 | static int omap_udc_resume(struct device *dev, u32 level) | 2932 | static int omap_udc_resume(struct device *dev) |
2935 | { | 2933 | { |
2936 | if (level != RESUME_POWER_ON) | ||
2937 | return 0; | ||
2938 | |||
2939 | DBG("resume + wakeup/SRP\n"); | 2934 | DBG("resume + wakeup/SRP\n"); |
2940 | omap_pullup(&udc->gadget, 1); | 2935 | omap_pullup(&udc->gadget, 1); |
2941 | 2936 | ||
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index 73f8c9404156..00dfe42d7a86 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c | |||
@@ -2602,24 +2602,23 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) | |||
2602 | * VBUS IRQs should probably be ignored so that the PXA device just acts | 2602 | * VBUS IRQs should probably be ignored so that the PXA device just acts |
2603 | * "dead" to USB hosts until system resume. | 2603 | * "dead" to USB hosts until system resume. |
2604 | */ | 2604 | */ |
2605 | static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state, u32 level) | 2605 | static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) |
2606 | { | 2606 | { |
2607 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); | 2607 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); |
2608 | 2608 | ||
2609 | if (level == SUSPEND_POWER_DOWN) { | 2609 | if (!udc->mach->udc_command) |
2610 | if (!udc->mach->udc_command) | 2610 | WARN("USB host won't detect disconnect!\n"); |
2611 | WARN("USB host won't detect disconnect!\n"); | 2611 | pullup(udc, 0); |
2612 | pullup(udc, 0); | 2612 | |
2613 | } | ||
2614 | return 0; | 2613 | return 0; |
2615 | } | 2614 | } |
2616 | 2615 | ||
2617 | static int pxa2xx_udc_resume(struct device *dev, u32 level) | 2616 | static int pxa2xx_udc_resume(struct device *dev) |
2618 | { | 2617 | { |
2619 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); | 2618 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); |
2620 | 2619 | ||
2621 | if (level == RESUME_POWER_ON) | 2620 | pullup(udc, 1); |
2622 | pullup(udc, 1); | 2621 | |
2623 | return 0; | 2622 | return 0; |
2624 | } | 2623 | } |
2625 | 2624 | ||
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index e142056b0d2c..0f6183a829c4 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -1774,15 +1774,12 @@ static int __init isp116x_probe(struct device *dev) | |||
1774 | /* | 1774 | /* |
1775 | Suspend of platform device | 1775 | Suspend of platform device |
1776 | */ | 1776 | */ |
1777 | static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase) | 1777 | static int isp116x_suspend(struct device *dev, pm_message_t state) |
1778 | { | 1778 | { |
1779 | int ret = 0; | 1779 | int ret = 0; |
1780 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1780 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
1781 | 1781 | ||
1782 | VDBG("%s: state %x, phase %x\n", __func__, state, phase); | 1782 | VDBG("%s: state %x\n", __func__, state); |
1783 | |||
1784 | if (phase != SUSPEND_DISABLE && phase != SUSPEND_POWER_DOWN) | ||
1785 | return 0; | ||
1786 | 1783 | ||
1787 | ret = usb_suspend_device(hcd->self.root_hub, state); | 1784 | ret = usb_suspend_device(hcd->self.root_hub, state); |
1788 | if (!ret) { | 1785 | if (!ret) { |
@@ -1797,15 +1794,12 @@ static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase) | |||
1797 | /* | 1794 | /* |
1798 | Resume platform device | 1795 | Resume platform device |
1799 | */ | 1796 | */ |
1800 | static int isp116x_resume(struct device *dev, u32 phase) | 1797 | static int isp116x_resume(struct device *dev) |
1801 | { | 1798 | { |
1802 | int ret = 0; | 1799 | int ret = 0; |
1803 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1800 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
1804 | 1801 | ||
1805 | VDBG("%s: state %x, phase %x\n", __func__, dev->power.power_state, | 1802 | VDBG("%s: state %x\n", __func__, dev->power.power_state); |
1806 | phase); | ||
1807 | if (phase != RESUME_POWER_ON) | ||
1808 | return 0; | ||
1809 | 1803 | ||
1810 | ret = usb_resume_device(hcd->self.root_hub); | 1804 | ret = usb_resume_device(hcd->self.root_hub); |
1811 | if (!ret) { | 1805 | if (!ret) { |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index d8f3ba7ad52e..a574216625a0 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -455,14 +455,11 @@ static int ohci_hcd_omap_drv_remove(struct device *dev) | |||
455 | 455 | ||
456 | #ifdef CONFIG_PM | 456 | #ifdef CONFIG_PM |
457 | 457 | ||
458 | static int ohci_omap_suspend(struct device *dev, pm_message_t message, u32 level) | 458 | static int ohci_omap_suspend(struct device *dev, pm_message_t message) |
459 | { | 459 | { |
460 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 460 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); |
461 | int status = -EINVAL; | 461 | int status = -EINVAL; |
462 | 462 | ||
463 | if (level != SUSPEND_POWER_DOWN) | ||
464 | return 0; | ||
465 | |||
466 | down(&ohci_to_hcd(ohci)->self.root_hub->serialize); | 463 | down(&ohci_to_hcd(ohci)->self.root_hub->serialize); |
467 | status = ohci_hub_suspend(ohci_to_hcd(ohci)); | 464 | status = ohci_hub_suspend(ohci_to_hcd(ohci)); |
468 | if (status == 0) { | 465 | if (status == 0) { |
@@ -476,14 +473,11 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message, u32 level | |||
476 | return status; | 473 | return status; |
477 | } | 474 | } |
478 | 475 | ||
479 | static int ohci_omap_resume(struct device *dev, u32 level) | 476 | static int ohci_omap_resume(struct device *dev) |
480 | { | 477 | { |
481 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 478 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); |
482 | int status = 0; | 479 | int status = 0; |
483 | 480 | ||
484 | if (level != RESUME_POWER_ON) | ||
485 | return 0; | ||
486 | |||
487 | if (time_before(jiffies, ohci->next_statechange)) | 481 | if (time_before(jiffies, ohci->next_statechange)) |
488 | msleep(5); | 482 | msleep(5); |
489 | ohci->next_statechange = jiffies; | 483 | ohci->next_statechange = jiffies; |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 2fdb262d4726..f042261ecb8e 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -309,7 +309,7 @@ static int ohci_hcd_pxa27x_drv_remove(struct device *dev) | |||
309 | return 0; | 309 | return 0; |
310 | } | 310 | } |
311 | 311 | ||
312 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u32 level) | 312 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state) |
313 | { | 313 | { |
314 | // struct platform_device *pdev = to_platform_device(dev); | 314 | // struct platform_device *pdev = to_platform_device(dev); |
315 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | 315 | // struct usb_hcd *hcd = dev_get_drvdata(dev); |
@@ -318,7 +318,7 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u | |||
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
321 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev, u32 level) | 321 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev) |
322 | { | 322 | { |
323 | // struct platform_device *pdev = to_platform_device(dev); | 323 | // struct platform_device *pdev = to_platform_device(dev); |
324 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | 324 | // struct usb_hcd *hcd = dev_get_drvdata(dev); |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index d42a15d10a46..03cf6accfe64 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -1784,15 +1784,12 @@ sl811h_probe(struct device *dev) | |||
1784 | */ | 1784 | */ |
1785 | 1785 | ||
1786 | static int | 1786 | static int |
1787 | sl811h_suspend(struct device *dev, pm_message_t state, u32 phase) | 1787 | sl811h_suspend(struct device *dev, pm_message_t state) |
1788 | { | 1788 | { |
1789 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1789 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
1790 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1790 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
1791 | int retval = 0; | 1791 | int retval = 0; |
1792 | 1792 | ||
1793 | if (phase != SUSPEND_POWER_DOWN) | ||
1794 | return retval; | ||
1795 | |||
1796 | if (state.event == PM_EVENT_FREEZE) | 1793 | if (state.event == PM_EVENT_FREEZE) |
1797 | retval = sl811h_hub_suspend(hcd); | 1794 | retval = sl811h_hub_suspend(hcd); |
1798 | else if (state.event == PM_EVENT_SUSPEND) | 1795 | else if (state.event == PM_EVENT_SUSPEND) |
@@ -1803,14 +1800,11 @@ sl811h_suspend(struct device *dev, pm_message_t state, u32 phase) | |||
1803 | } | 1800 | } |
1804 | 1801 | ||
1805 | static int | 1802 | static int |
1806 | sl811h_resume(struct device *dev, u32 phase) | 1803 | sl811h_resume(struct device *dev) |
1807 | { | 1804 | { |
1808 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1805 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
1809 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1806 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
1810 | 1807 | ||
1811 | if (phase != RESUME_POWER_ON) | ||
1812 | return 0; | ||
1813 | |||
1814 | /* with no "check to see if VBUS is still powered" board hook, | 1808 | /* with no "check to see if VBUS is still powered" board hook, |
1815 | * let's assume it'd only be powered to enable remote wakeup. | 1809 | * let's assume it'd only be powered to enable remote wakeup. |
1816 | */ | 1810 | */ |
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index 3c72c627e65e..1991fdb32dfb 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
@@ -73,17 +73,15 @@ static void corgibl_blank(int blank) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | #ifdef CONFIG_PM | 75 | #ifdef CONFIG_PM |
76 | static int corgibl_suspend(struct device *dev, pm_message_t state, u32 level) | 76 | static int corgibl_suspend(struct device *dev, pm_message_t state) |
77 | { | 77 | { |
78 | if (level == SUSPEND_POWER_DOWN) | 78 | corgibl_blank(FB_BLANK_POWERDOWN); |
79 | corgibl_blank(FB_BLANK_POWERDOWN); | ||
80 | return 0; | 79 | return 0; |
81 | } | 80 | } |
82 | 81 | ||
83 | static int corgibl_resume(struct device *dev, u32 level) | 82 | static int corgibl_resume(struct device *dev) |
84 | { | 83 | { |
85 | if (level == RESUME_POWER_ON) | 84 | corgibl_blank(FB_BLANK_UNBLANK); |
86 | corgibl_blank(FB_BLANK_UNBLANK); | ||
87 | return 0; | 85 | return 0; |
88 | } | 86 | } |
89 | #else | 87 | #else |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 1d54d3d6960b..0b9301facbd3 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -424,23 +424,21 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi) | |||
424 | * Power management hooks. Note that we won't be called from IRQ context, | 424 | * Power management hooks. Note that we won't be called from IRQ context, |
425 | * unlike the blank functions above, so we may sleep. | 425 | * unlike the blank functions above, so we may sleep. |
426 | */ | 426 | */ |
427 | static int imxfb_suspend(struct device *dev, pm_message_t state, u32 level) | 427 | static int imxfb_suspend(struct device *dev, pm_message_t state) |
428 | { | 428 | { |
429 | struct imxfb_info *fbi = dev_get_drvdata(dev); | 429 | struct imxfb_info *fbi = dev_get_drvdata(dev); |
430 | pr_debug("%s\n",__FUNCTION__); | 430 | pr_debug("%s\n",__FUNCTION__); |
431 | 431 | ||
432 | if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN) | 432 | imxfb_disable_controller(fbi); |
433 | imxfb_disable_controller(fbi); | ||
434 | return 0; | 433 | return 0; |
435 | } | 434 | } |
436 | 435 | ||
437 | static int imxfb_resume(struct device *dev, u32 level) | 436 | static int imxfb_resume(struct device *dev) |
438 | { | 437 | { |
439 | struct imxfb_info *fbi = dev_get_drvdata(dev); | 438 | struct imxfb_info *fbi = dev_get_drvdata(dev); |
440 | pr_debug("%s\n",__FUNCTION__); | 439 | pr_debug("%s\n",__FUNCTION__); |
441 | 440 | ||
442 | if (level == RESUME_ENABLE) | 441 | imxfb_enable_controller(fbi); |
443 | imxfb_enable_controller(fbi); | ||
444 | return 0; | 442 | return 0; |
445 | } | 443 | } |
446 | #else | 444 | #else |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 194eed0a238c..6206da9dd5da 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -981,21 +981,19 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data) | |||
981 | * Power management hooks. Note that we won't be called from IRQ context, | 981 | * Power management hooks. Note that we won't be called from IRQ context, |
982 | * unlike the blank functions above, so we may sleep. | 982 | * unlike the blank functions above, so we may sleep. |
983 | */ | 983 | */ |
984 | static int pxafb_suspend(struct device *dev, pm_message_t state, u32 level) | 984 | static int pxafb_suspend(struct device *dev, pm_message_t state) |
985 | { | 985 | { |
986 | struct pxafb_info *fbi = dev_get_drvdata(dev); | 986 | struct pxafb_info *fbi = dev_get_drvdata(dev); |
987 | 987 | ||
988 | if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN) | 988 | set_ctrlr_state(fbi, C_DISABLE_PM); |
989 | set_ctrlr_state(fbi, C_DISABLE_PM); | ||
990 | return 0; | 989 | return 0; |
991 | } | 990 | } |
992 | 991 | ||
993 | static int pxafb_resume(struct device *dev, u32 level) | 992 | static int pxafb_resume(struct device *dev) |
994 | { | 993 | { |
995 | struct pxafb_info *fbi = dev_get_drvdata(dev); | 994 | struct pxafb_info *fbi = dev_get_drvdata(dev); |
996 | 995 | ||
997 | if (level == RESUME_ENABLE) | 996 | set_ctrlr_state(fbi, C_ENABLE_PM); |
998 | set_ctrlr_state(fbi, C_ENABLE_PM); | ||
999 | return 0; | 997 | return 0; |
1000 | } | 998 | } |
1001 | #else | 999 | #else |
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c index fa98d91c42eb..cb2f7a1de947 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c | |||
@@ -655,7 +655,7 @@ bail: | |||
655 | } | 655 | } |
656 | 656 | ||
657 | #ifdef CONFIG_PM | 657 | #ifdef CONFIG_PM |
658 | static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state, u32 level) | 658 | static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state) |
659 | { | 659 | { |
660 | struct fb_info *info = dev_get_drvdata(dev); | 660 | struct fb_info *info = dev_get_drvdata(dev); |
661 | struct s1d13xxxfb_par *s1dfb = info->par; | 661 | struct s1d13xxxfb_par *s1dfb = info->par; |
@@ -702,15 +702,12 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state, u32 level) | |||
702 | return 0; | 702 | return 0; |
703 | } | 703 | } |
704 | 704 | ||
705 | static int s1d13xxxfb_resume(struct device *dev, u32 level) | 705 | static int s1d13xxxfb_resume(struct device *dev) |
706 | { | 706 | { |
707 | struct fb_info *info = dev_get_drvdata(dev); | 707 | struct fb_info *info = dev_get_drvdata(dev); |
708 | struct s1d13xxxfb_par *s1dfb = info->par; | 708 | struct s1d13xxxfb_par *s1dfb = info->par; |
709 | struct s1d13xxxfb_pdata *pdata = NULL; | 709 | struct s1d13xxxfb_pdata *pdata = NULL; |
710 | 710 | ||
711 | if (level != RESUME_ENABLE) | ||
712 | return 0; | ||
713 | |||
714 | /* awaken the chip */ | 711 | /* awaken the chip */ |
715 | s1d13xxxfb_writereg(s1dfb, S1DREG_PS_CNF, 0x10); | 712 | s1d13xxxfb_writereg(s1dfb, S1DREG_PS_CNF, 0x10); |
716 | 713 | ||
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 5ab79afb53b7..3862d3cb1fb2 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c | |||
@@ -847,37 +847,32 @@ static int s3c2410fb_remove(struct device *dev) | |||
847 | 847 | ||
848 | /* suspend and resume support for the lcd controller */ | 848 | /* suspend and resume support for the lcd controller */ |
849 | 849 | ||
850 | static int s3c2410fb_suspend(struct device *dev, pm_message_t state, u32 level) | 850 | static int s3c2410fb_suspend(struct device *dev, pm_message_t state) |
851 | { | 851 | { |
852 | struct fb_info *fbinfo = dev_get_drvdata(dev); | 852 | struct fb_info *fbinfo = dev_get_drvdata(dev); |
853 | struct s3c2410fb_info *info = fbinfo->par; | 853 | struct s3c2410fb_info *info = fbinfo->par; |
854 | 854 | ||
855 | if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN) { | 855 | s3c2410fb_stop_lcd(); |
856 | s3c2410fb_stop_lcd(); | ||
857 | 856 | ||
858 | /* sleep before disabling the clock, we need to ensure | 857 | /* sleep before disabling the clock, we need to ensure |
859 | * the LCD DMA engine is not going to get back on the bus | 858 | * the LCD DMA engine is not going to get back on the bus |
860 | * before the clock goes off again (bjd) */ | 859 | * before the clock goes off again (bjd) */ |
861 | 860 | ||
862 | msleep(1); | 861 | msleep(1); |
863 | clk_disable(info->clk); | 862 | clk_disable(info->clk); |
864 | } | ||
865 | 863 | ||
866 | return 0; | 864 | return 0; |
867 | } | 865 | } |
868 | 866 | ||
869 | static int s3c2410fb_resume(struct device *dev, u32 level) | 867 | static int s3c2410fb_resume(struct device *dev) |
870 | { | 868 | { |
871 | struct fb_info *fbinfo = dev_get_drvdata(dev); | 869 | struct fb_info *fbinfo = dev_get_drvdata(dev); |
872 | struct s3c2410fb_info *info = fbinfo->par; | 870 | struct s3c2410fb_info *info = fbinfo->par; |
873 | 871 | ||
874 | if (level == RESUME_ENABLE) { | 872 | clk_enable(info->clk); |
875 | clk_enable(info->clk); | 873 | msleep(1); |
876 | msleep(1); | ||
877 | |||
878 | s3c2410fb_init_registers(info); | ||
879 | 874 | ||
880 | } | 875 | s3c2410fb_init_registers(info); |
881 | 876 | ||
882 | return 0; | 877 | return 0; |
883 | } | 878 | } |
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 8000890e4271..78e5f194b0df 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
@@ -1309,21 +1309,19 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val, | |||
1309 | * Power management hooks. Note that we won't be called from IRQ context, | 1309 | * Power management hooks. Note that we won't be called from IRQ context, |
1310 | * unlike the blank functions above, so we may sleep. | 1310 | * unlike the blank functions above, so we may sleep. |
1311 | */ | 1311 | */ |
1312 | static int sa1100fb_suspend(struct device *dev, pm_message_t state, u32 level) | 1312 | static int sa1100fb_suspend(struct device *dev, pm_message_t state) |
1313 | { | 1313 | { |
1314 | struct sa1100fb_info *fbi = dev_get_drvdata(dev); | 1314 | struct sa1100fb_info *fbi = dev_get_drvdata(dev); |
1315 | 1315 | ||
1316 | if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN) | 1316 | set_ctrlr_state(fbi, C_DISABLE_PM); |
1317 | set_ctrlr_state(fbi, C_DISABLE_PM); | ||
1318 | return 0; | 1317 | return 0; |
1319 | } | 1318 | } |
1320 | 1319 | ||
1321 | static int sa1100fb_resume(struct device *dev, u32 level) | 1320 | static int sa1100fb_resume(struct device *dev) |
1322 | { | 1321 | { |
1323 | struct sa1100fb_info *fbi = dev_get_drvdata(dev); | 1322 | struct sa1100fb_info *fbi = dev_get_drvdata(dev); |
1324 | 1323 | ||
1325 | if (level == RESUME_ENABLE) | 1324 | set_ctrlr_state(fbi, C_ENABLE_PM); |
1326 | set_ctrlr_state(fbi, C_ENABLE_PM); | ||
1327 | return 0; | 1325 | return 0; |
1328 | } | 1326 | } |
1329 | #else | 1327 | #else |
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 0030c071da8f..752bf88906a9 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c | |||
@@ -438,36 +438,34 @@ static void w100fb_restore_vidmem(struct w100fb_par *par) | |||
438 | } | 438 | } |
439 | } | 439 | } |
440 | 440 | ||
441 | static int w100fb_suspend(struct device *dev, pm_message_t state, uint32_t level) | 441 | static int w100fb_suspend(struct device *dev, pm_message_t state) |
442 | { | 442 | { |
443 | if (level == SUSPEND_POWER_DOWN) { | 443 | struct fb_info *info = dev_get_drvdata(dev); |
444 | struct fb_info *info = dev_get_drvdata(dev); | 444 | struct w100fb_par *par=info->par; |
445 | struct w100fb_par *par=info->par; | 445 | struct w100_tg_info *tg = par->mach->tg; |
446 | struct w100_tg_info *tg = par->mach->tg; | 446 | |
447 | 447 | w100fb_save_vidmem(par); | |
448 | w100fb_save_vidmem(par); | 448 | if(tg && tg->suspend) |
449 | if(tg && tg->suspend) | 449 | tg->suspend(par); |
450 | tg->suspend(par); | 450 | w100_suspend(W100_SUSPEND_ALL); |
451 | w100_suspend(W100_SUSPEND_ALL); | 451 | par->blanked = 1; |
452 | par->blanked = 1; | 452 | |
453 | } | ||
454 | return 0; | 453 | return 0; |
455 | } | 454 | } |
456 | 455 | ||
457 | static int w100fb_resume(struct device *dev, uint32_t level) | 456 | static int w100fb_resume(struct device *dev) |
458 | { | 457 | { |
459 | if (level == RESUME_POWER_ON) { | 458 | struct fb_info *info = dev_get_drvdata(dev); |
460 | struct fb_info *info = dev_get_drvdata(dev); | 459 | struct w100fb_par *par=info->par; |
461 | struct w100fb_par *par=info->par; | 460 | struct w100_tg_info *tg = par->mach->tg; |
462 | struct w100_tg_info *tg = par->mach->tg; | 461 | |
462 | w100_hw_init(par); | ||
463 | w100fb_activate_var(par); | ||
464 | w100fb_restore_vidmem(par); | ||
465 | if(tg && tg->resume) | ||
466 | tg->resume(par); | ||
467 | par->blanked = 0; | ||
463 | 468 | ||
464 | w100_hw_init(par); | ||
465 | w100fb_activate_var(par); | ||
466 | w100fb_restore_vidmem(par); | ||
467 | if(tg && tg->resume) | ||
468 | tg->resume(par); | ||
469 | par->blanked = 0; | ||
470 | } | ||
471 | return 0; | 469 | return 0; |
472 | } | 470 | } |
473 | #else | 471 | #else |