Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sonic Zhang and committed by
Linus Torvalds
5aeb776d dd279f61

+28
+28
drivers/rtc/rtc-bfin.c
··· 430 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 457 static struct platform_driver bfin_rtc_driver = { 434 458 .driver = { 435 459 .name = "rtc-bfin", ··· 461 437 }, 462 438 .probe = bfin_rtc_probe, 463 439 .remove = __devexit_p(bfin_rtc_remove), 440 + #ifdef CONFIG_PM 441 + .suspend = bfin_rtc_suspend, 442 + .resume = bfin_rtc_resume, 443 + #endif 464 444 }; 465 445 466 446 static int __init bfin_rtc_init(void)