rtc: rv3028: fix PORF handling
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 26 Jan 2021 22:14:33 +0000 (23:14 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 5 Feb 2021 23:56:30 +0000 (00:56 +0100)
The PORF bit is cleared on interrupts which prevents the driver to know
when the time and date are invalid. Stop clearing PORF in the interrupt
handler.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210126221435.2152339-1-alexandre.belloni@bootlin.com
drivers/rtc/rtc-rv3028.c

index 2004f8c..4f8f609 100644 (file)
@@ -268,6 +268,8 @@ static irqreturn_t rv3028_handle_irq(int irq, void *dev_id)
        if (status & RV3028_STATUS_PORF)
                dev_warn(&rv3028->rtc->dev, "Voltage low, data loss detected.\n");
 
+       status &= ~RV3028_STATUS_PORF;
+
        if (status & RV3028_STATUS_TF) {
                status |= RV3028_STATUS_TF;
                ctrl |= RV3028_CTRL2_TIE;