From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Ciprian Costea <ciprianmarian.costea@oss.nxp.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Alexander Stein <alexander.stein@ew.tq-group.com>,
linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, s32@nxp.com, imx@lists.linux.dev,
Christophe Lizzi <clizzi@redhat.com>,
Alberto Ruiz <aruizrui@redhat.com>,
Enric Balletbo <eballetb@redhat.com>,
Eric Chanudet <echanude@redhat.com>,
Larisa Grigore <larisa.grigore@nxp.com>
Subject: Re: [PATCH 2/2] rtc: pcf85063: handle stopped oscillator at startup
Date: Thu, 10 Apr 2025 11:17:39 +0200 [thread overview]
Message-ID: <202504100917398f7244e9@mail.local> (raw)
In-Reply-To: <20250410082548.3821228-3-ciprianmarian.costea@oss.nxp.com>
On 10/04/2025 11:25:48+0300, Ciprian Costea wrote:
> From: Ciprian Marian Costea <ciprianmarian.costea@oss.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.
>
No, there is no point in starting the oscillator with a know wrong
time/date. The oscillator must only be started once the time is known
good, that is in .set_time
> Co-developed-by: Larisa Grigore <larisa.grigore@nxp.com>
> Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
> Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@oss.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
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-04-10 9:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 8:25 [PATCH 0/2] enable PCF85063 RTC support for S32G274A-RDB2 and S32G399A-RDB3 boards Ciprian Costea
2025-04-10 8:25 ` [PATCH 1/2] dt-bindings: rtc: nxp,pcf85063: add 'no-battery' property Ciprian Costea
2025-04-10 14:46 ` Frank Li
2025-04-10 14:51 ` Ciprian Marian Costea
2025-04-10 8:25 ` [PATCH 2/2] rtc: pcf85063: handle stopped oscillator at startup Ciprian Costea
2025-04-10 9:17 ` Alexandre Belloni [this message]
2025-04-10 12:56 ` Ciprian Marian Costea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202504100917398f7244e9@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=aruizrui@redhat.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=clizzi@redhat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eballetb@redhat.com \
--cc=echanude@redhat.com \
--cc=imx@lists.linux.dev \
--cc=krzk+dt@kernel.org \
--cc=larisa.grigore@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=s32@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox