summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rv3028.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-26 23:14:33 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-02-06 00:56:30 +0100
commitf007c479c2d0ca0a537286511aa5d07b75755513 (patch)
treede264127a8cdd8099ebd7f5c5d99a8043785d1c8 /drivers/rtc/rtc-rv3028.c
parent0c1095d334dafda22463454b0519c926447b555e (diff)
downloadlinux-f007c479c2d0ca0a537286511aa5d07b75755513.tar.bz2
rtc: rv3028: fix PORF handling
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
Diffstat (limited to 'drivers/rtc/rtc-rv3028.c')
-rw-r--r--drivers/rtc/rtc-rv3028.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index 2004f8c5397f..4f8f6092097a 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -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;