Skip to content

Commit 0dbd610

Browse files
bijudasalexandrebelloni
authored andcommitted
rtc: isl1208: Add a delay for clearing alarm
As per the latest HW manual[1], the INT# output is pulled low after the alarm is triggered. After the INT# output is pulled low, it is low for at least 250ms, even if the correct action is taken to clear it. It is impossible to clear ALM if it is still active. The host must wait for the RTC to progress past the alarm time plus the 250ms delay before clearing ALM. [1]https://www.renesas.com/us/en/document/dst/raa215300-datasheet?r=1506351 Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 840ac61 commit 0dbd610

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/rtc/rtc-isl1208.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/bcd.h>
99
#include <linux/clk.h>
10+
#include <linux/delay.h>
1011
#include <linux/i2c.h>
1112
#include <linux/module.h>
1213
#include <linux/of.h>
@@ -628,6 +629,18 @@ isl1208_rtc_interrupt(int irq, void *data)
628629
struct isl1208_state *isl1208 = i2c_get_clientdata(client);
629630
int handled = 0, sr, err;
630631

632+
if (!isl1208->config->has_tamper) {
633+
/*
634+
* The INT# output is pulled low 250ms after the alarm is
635+
* triggered. After the INT# output is pulled low, it is low for
636+
* at least 250ms, even if the correct action is taken to clear
637+
* it. It is impossible to clear ALM if it is still active. The
638+
* host must wait for the RTC to progress past the alarm time
639+
* plus the 250ms delay before clearing ALM.
640+
*/
641+
msleep(250);
642+
}
643+
631644
/*
632645
* I2C reads get NAK'ed if we read straight away after an interrupt?
633646
* Using a mdelay/msleep didn't seem to help either, so we work around

0 commit comments

Comments
 (0)