lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250410082548.3821228-3-ciprianmarian.costea@oss.nxp.com>
Date: Thu, 10 Apr 2025 11:25:48 +0300
From: Ciprian Costea <ciprianmarian.costea@....nxp.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Alexander Stein <alexander.stein@...tq-group.com>
Cc: linux-rtc@...r.kernel.org,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	s32@....com,
	imx@...ts.linux.dev,
	Christophe Lizzi <clizzi@...hat.com>,
	Alberto Ruiz <aruizrui@...hat.com>,
	Enric Balletbo <eballetb@...hat.com>,
	Eric Chanudet <echanude@...hat.com>,
	Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>,
	Larisa Grigore <larisa.grigore@....com>
Subject: [PATCH 2/2] rtc: pcf85063: handle stopped oscillator at startup

From: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>

If the RTC is not linked to any battery, the oscillator is stopped at
startup and a SW reset command is generated to the PCF85063 RTC.
Manually start the oscillator in case the PCF85063 RTC is not battery
backed.

Co-developed-by: Larisa Grigore <larisa.grigore@....com>
Signed-off-by: Larisa Grigore <larisa.grigore@....com>
Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
---
 drivers/rtc/rtc-pcf85063.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index 4fa5c4ecdd5a..6de7344d2469 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -590,6 +590,14 @@ static int pcf85063_probe(struct i2c_client *client)
 
 	i2c_set_clientdata(client, pcf85063);
 
+	if (of_property_read_bool(client->dev.of_node, "no-battery")) {
+		err = regmap_update_bits(pcf85063->regmap, PCF85063_REG_SC,
+					 PCF85063_REG_SC_OS, 0);
+		if (err)
+			return dev_err_probe(&client->dev, err,
+					"Failed to start the oscillator\n");
+	}
+
 	err = regmap_read(pcf85063->regmap, PCF85063_REG_SC, &tmp);
 	if (err)
 		return dev_err_probe(&client->dev, err, "RTC chip is not present\n");
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ