summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-bfin.c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2008-08-05 13:01:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-05 14:33:47 -0700
commit5aeb776d0c2bb1dd3ef01f4805929e2bc2923e7b (patch)
treeb9e9578f9b9523cf9d2a6bc9135da9a286bf1e12 /drivers/rtc/rtc-bfin.c
parentdd279f6127c0f64dfb0055bc0adb97a284a08df3 (diff)
downloadop-kernel-dev-5aeb776d0c2bb1dd3ef01f4805929e2bc2923e7b.zip
op-kernel-dev-5aeb776d0c2bb1dd3ef01f4805929e2bc2923e7b.tar.gz
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>
Diffstat (limited to 'drivers/rtc/rtc-bfin.c')
-rw-r--r--drivers/rtc/rtc-bfin.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 48ada59..a568d29 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)
return 0;
}
+#ifdef CONFIG_PM
+static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+#ifdef PM_WAKEUP_SIC_IWR
+ struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev);
+#endif
+ bfin_rtc_reset(&pdev->dev);
+#ifdef PM_WAKEUP_SIC_IWR
+ bfin_write_RTC_SWCNT(10);
+ bfin_rtc_int_set(rtc, RTC_ISTAT_STOPWATCH);
+#endif
+ return 0;
+}
+
+static int bfin_rtc_resume(struct platform_device *pdev)
+{
+#ifdef PM_WAKEUP_SIC_IWR
+ struct bfin_rtc *rtc = dev_get_drvdata(&pdev->dev);
+ bfin_rtc_int_clear(rtc, RTC_ISTAT_STOPWATCH);
+#endif
+ return 0;
+}
+#endif
+
static struct platform_driver bfin_rtc_driver = {
.driver = {
.name = "rtc-bfin",
@@ -437,6 +461,10 @@ static struct platform_driver bfin_rtc_driver = {
},
.probe = bfin_rtc_probe,
.remove = __devexit_p(bfin_rtc_remove),
+#ifdef CONFIG_PM
+ .suspend = bfin_rtc_suspend,
+ .resume = bfin_rtc_resume,
+#endif
};
static int __init bfin_rtc_init(void)
OpenPOWER on IntegriCloud