U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: m41t62: implements read8/write8 operations
@ 2023-03-17 14:22 thomas.perrot
  2023-03-18 20:20 ` Simon Glass
  2023-03-31 14:14 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: thomas.perrot @ 2023-03-17 14:22 UTC (permalink / raw)
  To: u-boot; +Cc: sjg, Thomas Perrot

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


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

* Re: [PATCH] rtc: m41t62: implements read8/write8 operations
  2023-03-17 14:22 [PATCH] rtc: m41t62: implements read8/write8 operations thomas.perrot
@ 2023-03-18 20:20 ` Simon Glass
  2023-03-31 14:14 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2023-03-18 20:20 UTC (permalink / raw)
  To: thomas.perrot; +Cc: u-boot

On Fri, 17 Mar 2023 at 08:25, <thomas.perrot@bootlin.com> wrote:
>
> 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(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* Re: [PATCH] rtc: m41t62: implements read8/write8 operations
  2023-03-17 14:22 [PATCH] rtc: m41t62: implements read8/write8 operations thomas.perrot
  2023-03-18 20:20 ` Simon Glass
@ 2023-03-31 14:14 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2023-03-31 14:14 UTC (permalink / raw)
  To: thomas.perrot; +Cc: u-boot, sjg

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

On Fri, Mar 17, 2023 at 03:22:41PM +0100, thomas.perrot@bootlin.com wrote:

> 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>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2023-03-31 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-17 14:22 [PATCH] rtc: m41t62: implements read8/write8 operations thomas.perrot
2023-03-18 20:20 ` Simon Glass
2023-03-31 14:14 ` Tom Rini

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