diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2008-08-05 16:01:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-05 17:33:47 -0400 |
commit | 5aeb776d0c2bb1dd3ef01f4805929e2bc2923e7b (patch) | |
tree | b9e9578f9b9523cf9d2a6bc9135da9a286bf1e12 | |
parent | dd279f6127c0f64dfb0055bc0adb97a284a08df3 (diff) |
blackfin RTC driver: Fix bug Only RTC interrupt can wake up deeper sleep core
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-bfin.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 48ada599477b..a568d29b0742 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
@@ -430,6 +430,30 @@ static int __devexit bfin_rtc_remove(struct platform_device *pdev) | |||
430 | return 0; | 430 | return 0; |
431 | } | 431 | } |
432 | 432 | ||
433 | #ifdef CONFIG_PM | ||
434 | static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) | ||
435 | { | ||
436 | #ifdef PM_WAKEUP_SIC_IWR | ||
437 | struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev); | ||
438 | #endif | ||
439 | bfin_rtc_reset(&pdev->dev); | ||
440 | #ifdef PM_WAKEUP_SIC_IWR | ||
441 | bfin_write_RTC_SWCNT(10); | ||
442 | bfin_rtc_int_set(rtc, RTC_ISTAT_STOPWATCH); | ||
443 | #endif | ||
444 | return 0; | ||
445 | } | ||
446 | |||
447 | static int bfin_rtc_resume(struct platform_device *pdev) | ||
448 | { | ||
449 | #ifdef PM_WAKEUP_SIC_IWR | ||
450 | struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev); | ||
451 | bfin_rtc_int_clear(rtc, RTC_ISTAT_STOPWATCH); | ||
452 | #endif | ||
453 | return 0; | ||
454 | } | ||
455 | #endif | ||
456 | |||
433 | static struct platform_driver bfin_rtc_driver = { | 457 | static struct platform_driver bfin_rtc_driver = { |
434 | .driver = { | 458 | .driver = { |
435 | .name = "rtc-bfin", | 459 | .name = "rtc-bfin", |
@@ -437,6 +461,10 @@ static struct platform_driver bfin_rtc_driver = { | |||
437 | }, | 461 | }, |
438 | .probe = bfin_rtc_probe, | 462 | .probe = bfin_rtc_probe, |
439 | .remove = __devexit_p(bfin_rtc_remove), | 463 | .remove = __devexit_p(bfin_rtc_remove), |
464 | #ifdef CONFIG_PM | ||
465 | .suspend = bfin_rtc_suspend, | ||
466 | .resume = bfin_rtc_resume, | ||
467 | #endif | ||
440 | }; | 468 | }; |
441 | 469 | ||
442 | static int __init bfin_rtc_init(void) | 470 | static int __init bfin_rtc_init(void) |