rtc: m41t62: implements read8/write8 operations
PATCH 1/1 rtc: m41t62: implements read8/write8 operations
From: Thomas Perrot <[email protected]>
These operations are required by dm_rtc_read anddm_bootcount_get helpers.
Signed-off-by Thomas Perrot <[email protected]>
--- drivers/rtc/m41t62.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/rtc/m41t62.c +12 -0
@@ -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[] = {
Signature · 1 line
2.39.2
Quoted 11 lines · On Fri, 17 Mar 2023 at 08:25, <[email protected]> wrote:
From: Thomas Perrot <[email protected]>
These operations are required by
dm_rtc_readanddm_bootcount_gethelpers.Signed-off-by Thomas Perrot <[email protected]>--- drivers/rtc/m41t62.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Reviewed-by Simon Glass <[email protected]>
Quoted 7 lines · On Fri, Mar 17, 2023 at 03:22:41PM +0100, [email protected] wrote:
From: Thomas Perrot <[email protected]>
These operations are required by
dm_rtc_readanddm_bootcount_gethelpers.Signed-off-by Thomas Perrot <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom