From 92cf458f8ad9410dedbedd41d048d26620ce5f12 Mon Sep 17 00:00:00 2001 From: Max Yang Date: Mon, 10 May 2021 05:23:37 +0000 Subject: [PATCH] rtc: m41t62: fix wrong register use for set/reset ST bit Fix wrong register use when set/reset ST bit. ST bit is in register M41T62_REG_SEC not in M41T62_REG_ALARM_HOUR. I have not actually tested this. But this seemed buggy from inspection. Fixes: 9bbe210512c4539 ("rtc: m41t62: add oscillator fail bit reset support") Signed-off-by: Max Yang --- drivers/rtc/m41t62.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c index 0a4e12d698..8be532c3e3 100644 --- a/drivers/rtc/m41t62.c +++ b/drivers/rtc/m41t62.c @@ -213,13 +213,13 @@ static int m41t62_rtc_restart_osc(struct udevice *dev) /* 1. Set stop bit */ val |= M41T62_SEC_ST; - ret = dm_i2c_write(dev, M41T62_REG_ALARM_HOUR, &val, sizeof(val)); + ret = dm_i2c_write(dev, M41T62_REG_SEC, &val, sizeof(val)); if (ret) return ret; /* 2. Clear stop bit */ val &= ~M41T62_SEC_ST; - ret = dm_i2c_write(dev, M41T62_REG_ALARM_HOUR, &val, sizeof(val)); + ret = dm_i2c_write(dev, M41T62_REG_SEC, &val, sizeof(val)); if (ret) return ret;