]> Git Repo - linux.git/commitdiff
rtc: isl1208: Update correct procedure for clearing alarm
authorBiju Das <[email protected]>
Tue, 18 Jun 2024 15:26:31 +0000 (16:26 +0100)
committerAlexandre Belloni <[email protected]>
Thu, 27 Jun 2024 22:34:21 +0000 (00:34 +0200)
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]>
drivers/rtc/rtc-isl1208.c

index 6877e2f3bde61d292622f3abb5c33b653ee4e06d..7b82e4a14b7a23703ebe254af3654fb195d25a4c 100644 (file)
@@ -663,6 +663,13 @@ isl1208_rtc_interrupt(int irq, void *data)
 
                rtc_update_irq(isl1208->rtc, 1, RTC_IRQF | RTC_AF);
 
+               /* Disable the alarm */
+               err = isl1208_rtc_toggle_alarm(client, 0);
+               if (err)
+                       return err;
+
+               fsleep(275);
+
                /* Clear the alarm */
                sr &= ~ISL1208_REG_SR_ALM;
                sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr);
@@ -671,11 +678,6 @@ isl1208_rtc_interrupt(int irq, void *data)
                                __func__);
                else
                        handled = 1;
-
-               /* Disable the alarm */
-               err = isl1208_rtc_toggle_alarm(client, 0);
-               if (err)
-                       return err;
        }
 
        if (isl1208->config->has_tamper && (sr & ISL1208_REG_SR_EVT)) {
This page took 0.060919 seconds and 4 git commands to generate.