public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: rtc: rv3028: check and update PORF flag during probe
@ 2024-03-29 10:19 Karthikeyan Krishnasamy
  2024-03-29 10:28 ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Karthikeyan Krishnasamy @ 2024-03-29 10:19 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: linux-rtc, linux-kernel, parthiban, saravanan,
	Karthikeyan Krishnasamy

PORF flag is set during power reset and voltage drop below Vpor
data in rtc device is no longer valid if PORF flag is set
and software must reset to 0, in order to perform sanity
check on rtc data

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
---
 drivers/rtc/rtc-rv3028.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index 2f001c59c61d..e9699ff0c4e8 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -951,6 +951,13 @@ static int rv3028_probe(struct i2c_client *client)
 	if (ret < 0)
 		return ret;
 
+	if (status & RV3028_STATUS_PORF) {
+		ret = regmap_update_bits(rv3028->regmap, RV3028_STATUS,
+					 RV3028_STATUS_PORF, 0);
+		if (ret < 0)
+			return ret;
+	}
+
 	if (status & RV3028_STATUS_AF)
 		dev_warn(&client->dev, "An alarm may have been missed.\n");
 
-- 
2.34.1


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

end of thread, other threads:[~2024-03-29 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 10:19 [PATCH] drivers: rtc: rv3028: check and update PORF flag during probe Karthikeyan Krishnasamy
2024-03-29 10:28 ` Alexandre Belloni
2024-03-29 16:03   ` karthikeyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox