From: Frank Li <Frank.Li@nxp.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Jacky Bai <ping.bai@nxp.com>, Peng Fan <peng.fan@nxp.com>,
linux-rtc@vger.kernel.org (open list:REAL TIME CLOCK (RTC)
SUBSYSTEM), linux-kernel@vger.kernel.org (open list)
Cc: imx@lists.linux.dev
Subject: [PATCH 1/1] rtc: bbnsm: Enable RTC by default to fix time read failure
Date: Fri, 15 Nov 2024 14:48:58 -0500 [thread overview]
Message-ID: <20241115194858.3837298-1-Frank.Li@nxp.com> (raw)
From: Jacky Bai <ping.bai@nxp.com>
Enable the RTC by default even when no valid time is set to ensure the
RTC's time read and alarm functions work properly. Without this, running
hwclock results in the following error:
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
Fixes: eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support")
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/rtc/rtc-nxp-bbnsm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/rtc/rtc-nxp-bbnsm.c b/drivers/rtc/rtc-nxp-bbnsm.c
index fa3b0328c7a25..6610db2f75125 100644
--- a/drivers/rtc/rtc-nxp-bbnsm.c
+++ b/drivers/rtc/rtc-nxp-bbnsm.c
@@ -189,6 +189,9 @@ static int bbnsm_rtc_probe(struct platform_device *pdev)
/* clear all the pending events */
regmap_write(bbnsm->regmap, BBNSM_EVENTS, 0x7A);
+ /* Enable the Real-Time counter */
+ regmap_update_bits(bbnsm->regmap, BBNSM_CTRL, RTC_EN_MSK, RTC_EN);
+
device_init_wakeup(&pdev->dev, true);
dev_pm_set_wake_irq(&pdev->dev, bbnsm->irq);
--
2.34.1
next reply other threads:[~2024-11-15 19:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 19:48 Frank Li [this message]
2024-11-16 19:36 ` [PATCH 1/1] rtc: bbnsm: Enable RTC by default to fix time read failure Alexandre Belloni
2024-11-17 22:08 ` Alexandre Belloni
2024-11-18 19:25 ` Frank Li
2024-12-05 17:20 ` Frank Li
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=20241115194858.3837298-1-Frank.Li@nxp.com \
--to=frank.li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=ping.bai@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