mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
rtc: i2c_rtc_emul: catch any write to the "reset" register
It's more natural that any write that happens to touch the reset register should cause a reset, rather than just a write that starts at that offset. Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
This commit is contained in:
parent
9fb6a41cda
commit
a3e36525a9
1 changed files with 2 additions and 1 deletions
|
@ -197,7 +197,8 @@ static int sandbox_i2c_rtc_xfer(struct udevice *emul, struct i2c_msg *msg,
|
|||
|
||||
/* Write the register */
|
||||
memcpy(plat->reg + offset, ptr, len);
|
||||
if (offset == REG_RESET)
|
||||
/* If the reset register was written to, do reset. */
|
||||
if (offset <= REG_RESET && REG_RESET < offset + len)
|
||||
reset_time(emul);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue