Skip to content
Snippets Groups Projects
Commit 1bde67b1 authored by Simon Glass's avatar Simon Glass
Browse files

dm: i2c: sandbox: Add debugging to the speed limit


Print a debug() message with the I2C speed is exceeded.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarHeiko Schocher <hs@denx.de>
parent bc5701e1
No related branches found
No related tags found
No related merge requests found
...@@ -73,8 +73,10 @@ static int sandbox_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, ...@@ -73,8 +73,10 @@ static int sandbox_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
* 400KHz for reads * 400KHz for reads
*/ */
is_read = nmsgs > 1; is_read = nmsgs > 1;
if (i2c->speed_hz > (is_read ? 400000 : 100000)) if (i2c->speed_hz > (is_read ? 400000 : 100000)) {
debug("%s: Max speed exceeded\n", __func__);
return -EINVAL; return -EINVAL;
}
return ops->xfer(emul, msg, nmsgs); return ops->xfer(emul, msg, nmsgs);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment