mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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: 9bbe210512
("rtc: m41t62: add oscillator fail bit reset support")
Signed-off-by: Max Yang <max.yang@deltaww.com>
This commit is contained in:
parent
bc599042d4
commit
92cf458f8a
1 changed files with 2 additions and 2 deletions
|
@ -213,13 +213,13 @@ static int m41t62_rtc_restart_osc(struct udevice *dev)
|
||||||
|
|
||||||
/* 1. Set stop bit */
|
/* 1. Set stop bit */
|
||||||
val |= M41T62_SEC_ST;
|
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)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* 2. Clear stop bit */
|
/* 2. Clear stop bit */
|
||||||
val &= ~M41T62_SEC_ST;
|
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)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue