All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rtc: rv3028: fix PORF handling
@ 2021-01-26 22:14 Alexandre Belloni
  2021-01-26 22:14 ` [PATCH 2/2] rtc: rv3028: remove useless warning messages Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2021-01-26 22:14 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, linux-kernel

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>
---
 drivers/rtc/rtc-rv3028.c | 2 ++
 1 file changed, 2 insertions(+)

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;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 1/2] rtc: rv3028: fix PORF handling
@ 2021-02-02 11:25 Alexandre Belloni
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2021-02-02 11:25 UTC (permalink / raw)
  To: linux-rtc, Alessandro Zummo, Alexandre Belloni; +Cc: linux-kernel

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>
---
 drivers/rtc/rtc-rv3028.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index f68baa055a0b..6d07f8261c69 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;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-02 11:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 22:14 [PATCH 1/2] rtc: rv3028: fix PORF handling Alexandre Belloni
2021-01-26 22:14 ` [PATCH 2/2] rtc: rv3028: remove useless warning messages Alexandre Belloni
2021-02-02 11:25 [PATCH 1/2] rtc: rv3028: fix PORF handling Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.