Commit 0dbd610c authored by Biju Das's avatar Biju Das Committed by Alexandre Belloni

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=1506351Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20240618152635.48956-2-biju.das.jz@bp.renesas.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 840ac611
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -628,6 +629,18 @@ isl1208_rtc_interrupt(int irq, void *data) ...@@ -628,6 +629,18 @@ isl1208_rtc_interrupt(int irq, void *data)
struct isl1208_state *isl1208 = i2c_get_clientdata(client); struct isl1208_state *isl1208 = i2c_get_clientdata(client);
int handled = 0, sr, err; int handled = 0, sr, err;
if (!isl1208->config->has_tamper) {
/*
* The INT# output is pulled low 250ms 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.
*/
msleep(250);
}
/* /*
* I2C reads get NAK'ed if we read straight away after an interrupt? * I2C reads get NAK'ed if we read straight away after an interrupt?
* Using a mdelay/msleep didn't seem to help either, so we work around * Using a mdelay/msleep didn't seem to help either, so we work around
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment