aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2005-10-28 12:52:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:56 -0400
commit9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch)
tree967e26d3a23c24dd52b114d672312c207714308c /drivers/char
parenta3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff)
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/s3c2410-rtc.c20
-rw-r--r--drivers/char/sonypi.c14
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c30
3 files changed, 28 insertions, 36 deletions
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
520static int ticnt_save; 520static int ticnt_save;
521 521
522static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state, u32 level) 522static 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
545static int s3c2410_rtc_resume(struct device *dev, u32 level) 543static 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
1168static int old_camera_power; 1168static int old_camera_power;
1169 1169
1170static int sonypi_suspend(struct device *dev, pm_message_t state, u32 level) 1170static 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
1179static int sonypi_resume(struct device *dev, u32 level) 1178static 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)
464static unsigned long wtcon_save; 464static unsigned long wtcon_save;
465static unsigned long wtdat_save; 465static unsigned long wtdat_save;
466 466
467static int s3c2410wdt_suspend(struct device *dev, pm_message_t state, u32 level) 467static 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
481static int s3c2410wdt_resume(struct device *dev, u32 level) 479static 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}