diff options
Diffstat (limited to 'drivers/rtc/rtc-bfin.c')
-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 48ada599477..a568d29b074 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) |