diff mbox

Disable IRQ on COH 901 331 after alarm

Message ID 1255334531-29981-1-git-send-email-linus.walleij@stericsson.com
State Accepted, archived
Headers show

Commit Message

Linus Walleij Oct. 12, 2009, 8:02 a.m. UTC
This disables the alarm IRQ from the COH 901 331 after an event,
so as to avoid multiple triggers of the same alarm.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/rtc/rtc-coh901331.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Comments

Linus Walleij Nov. 12, 2009, 10:24 a.m. UTC | #1
2009/10/12 Linus Walleij <linus.walleij@stericsson.com>:

> This disables the alarm IRQ from the COH 901 331 after an event,
> so as to avoid multiple triggers of the same alarm.

Ping on this, is it going into the 2.6.31-rc:s?

Yours,
Linus Walleij

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
diff mbox

Patch

diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
index 7fe1fa2..8ce8d00 100644
--- a/drivers/rtc/rtc-coh901331.c
+++ b/drivers/rtc/rtc-coh901331.c
@@ -58,7 +58,16 @@  static irqreturn_t coh901331_interrupt(int irq, void *data)
 	clk_enable(rtap->clk);
 	/* Ack IRQ */
 	writel(1, rtap->virtbase + COH901331_IRQ_EVENT);
+	/*
+	 * Disable the interrupt. This is necessary because
+	 * the RTC lives on a lower-clocked line and will
+	 * not release the IRQ line until after a few (slower)
+	 * clock cycles. The interrupt will be re-enabled when
+	 * a new alarm is set anyway.
+	 */
+	writel(0, rtap->virtbase + COH901331_IRQ_MASK);
 	clk_disable(rtap->clk);
+
 	/* Set alarm flag */
 	rtc_update_irq(rtap->rtc, 1, RTC_AF);