From: Sonic Zhang Date: Tue, 5 Aug 2008 20:01:17 +0000 (-0700) Subject: blackfin RTC driver: Fix bug Only RTC interrupt can wake up deeper sleep core X-Git-Tag: v2.6.27-rc2~26 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aeb776d0c2bb1dd3ef01f4805929e2bc2923e7b;p=linux-2.6 blackfin RTC driver: Fix bug Only RTC interrupt can wake up deeper sleep core Signed-off-by: Sonic Zhang Signed-off-by: Bryan Wu Signed-off-by: Bryan Wu Cc: David Brownell Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 48ada59947..a568d29b07 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)