summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-11-21 17:32:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-21 19:42:27 -0500
commit51a0d036f995585e8c5c30797d5bce28645d9dd7 (patch)
tree495840007f4eb4b9ef5bcd6e879257192cd1076d /drivers/rtc
parent27c73ae759774e63313c1fbfeb17ba076cea64c5 (diff)
ARM: drivers/rtc/rtc-at91rm9200.c: disable interrupts at shutdown
Make sure RTC-interrupts are disabled at shutdown. As the RTC is generally powered by backup power (VDDBU), its interrupts are not disabled on wake-up, user, watchdog or software reset. This could cause troubles on other systems (e.g. older kernels) if an interrupt occurs before a handler has been installed at next boot. Let us be well-behaved and disable them on clean shutdowns at least (as do the RTT-based rtc-at91sam9 driver). Signed-off-by: Johan Hovold <jhovold@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Andrew Victor <linux@maxim.org.za> 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')
-rw-r--r--drivers/rtc/rtc-at91rm9200.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
index 8b2cd8a5a2ff..c0da95e95702 100644
--- a/drivers/rtc/rtc-at91rm9200.c
+++ b/drivers/rtc/rtc-at91rm9200.c
@@ -428,6 +428,14 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
428 return 0; 428 return 0;
429} 429}
430 430
431static void at91_rtc_shutdown(struct platform_device *pdev)
432{
433 /* Disable all interrupts */
434 at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM |
435 AT91_RTC_SECEV | AT91_RTC_TIMEV |
436 AT91_RTC_CALEV);
437}
438
431#ifdef CONFIG_PM_SLEEP 439#ifdef CONFIG_PM_SLEEP
432 440
433/* AT91RM9200 RTC Power management control */ 441/* AT91RM9200 RTC Power management control */
@@ -466,6 +474,7 @@ static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
466 474
467static struct platform_driver at91_rtc_driver = { 475static struct platform_driver at91_rtc_driver = {
468 .remove = __exit_p(at91_rtc_remove), 476 .remove = __exit_p(at91_rtc_remove),
477 .shutdown = at91_rtc_shutdown,
469 .driver = { 478 .driver = {
470 .name = "at91_rtc", 479 .name = "at91_rtc",
471 .owner = THIS_MODULE, 480 .owner = THIS_MODULE,