From: thomas.perrot@bootlin.com
To: u-boot@lists.denx.de
Cc: sjg@chromium.org, Thomas Perrot <thomas.perrot@bootlin.com>
Subject: [PATCH] rtc: m41t62: implements read8/write8 operations
Date: Fri, 17 Mar 2023 15:22:41 +0100 [thread overview]
Message-ID: <20230317142241.675894-1-thomas.perrot@bootlin.com> (raw)
From: Thomas Perrot <thomas.perrot@bootlin.com>
These operations are required by dm_rtc_read and
dm_bootcount_get helpers.
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
---
drivers/rtc/m41t62.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c
index 66a0faa0ecff..891fe09d311b 100644
--- a/drivers/rtc/m41t62.c
+++ b/drivers/rtc/m41t62.c
@@ -283,6 +283,16 @@ static int m41t62_rtc_reset(struct udevice *dev)
return m41t62_sqw_enable(dev, true);
}
+static int m41t62_rtc_read8(struct udevice *dev, unsigned int reg)
+{
+ return dm_i2c_reg_read(dev, reg);
+}
+
+static int m41t62_rtc_write8(struct udevice *dev, unsigned int reg, int val)
+{
+ return dm_i2c_reg_write(dev, reg, val);
+}
+
/*
* Make sure HT bit is cleared. This bit is set on entering battery backup
* mode, so do this before the first read access.
@@ -296,6 +306,8 @@ static const struct rtc_ops m41t62_rtc_ops = {
.get = m41t62_rtc_get,
.set = m41t62_rtc_set,
.reset = m41t62_rtc_reset,
+ .read8 = m41t62_rtc_read8,
+ .write8 = m41t62_rtc_write8,
};
static const struct udevice_id m41t62_rtc_ids[] = {
--
2.39.2
next reply other threads:[~2023-03-17 14:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-17 14:22 thomas.perrot [this message]
2023-03-18 20:20 ` [PATCH] rtc: m41t62: implements read8/write8 operations Simon Glass
2023-03-31 14:14 ` Tom Rini
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=20230317142241.675894-1-thomas.perrot@bootlin.com \
--to=thomas.perrot@bootlin.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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