提交 a3e36525 编写于 作者: R Rasmus Villemoes 提交者: Heiko Schocher

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: NSimon Glass <sjg@chromium.org>
Reviewed-by: NHeiko Schocher <hs@denx.de>
Signed-off-by: NRasmus Villemoes <rasmus.villemoes@prevas.dk>
上级 9fb6a41c
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册