Skip to content

Commit 43696b3

Browse files
bijudasalexandrebelloni
authored andcommitted
rtc: isl1208: Update correct procedure for clearing alarm
As per the latest HW manual[1], there is an internal delay(~250 microsec) from setting ALME = 0 to disabling the alarm function, so the user must add a short delay of greater than 250µs between setting ALME = 0 and clearing ALM. Currently setting of ALME = 0 is done after clearing the ALM, so just reverse the operation and add a delay of 275 microsec. [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 0dbd610 commit 43696b3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/rtc/rtc-isl1208.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,13 @@ isl1208_rtc_interrupt(int irq, void *data)
663663

664664
rtc_update_irq(isl1208->rtc, 1, RTC_IRQF | RTC_AF);
665665

666+
/* Disable the alarm */
667+
err = isl1208_rtc_toggle_alarm(client, 0);
668+
if (err)
669+
return err;
670+
671+
fsleep(275);
672+
666673
/* Clear the alarm */
667674
sr &= ~ISL1208_REG_SR_ALM;
668675
sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr);
@@ -671,11 +678,6 @@ isl1208_rtc_interrupt(int irq, void *data)
671678
__func__);
672679
else
673680
handled = 1;
674-
675-
/* Disable the alarm */
676-
err = isl1208_rtc_toggle_alarm(client, 0);
677-
if (err)
678-
return err;
679681
}
680682

681683
if (isl1208->config->has_tamper && (sr & ISL1208_REG_SR_EVT)) {

0 commit comments

Comments
 (0)