From: Thomas Perrot Date: Fri, 17 Mar 2023 14:22:41 +0000 (+0100) Subject: rtc: m41t62: implements read8/write8 operations X-Git-Tag: baikal/mips/sdk6.2~4^2~3^2~175^2~17^2~12 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=bc99d42871937dd25cc6f6c5faac0a035c6a4164;p=uboot.git rtc: m41t62: implements read8/write8 operations These operations are required by dm_rtc_read and dm_bootcount_get helpers. Signed-off-by: Thomas Perrot Reviewed-by: Simon Glass --- diff --git a/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c index 66a0faa0ec..891fe09d31 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[] = {