mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
dm: i2c: sandbox: Add debugging to the speed limit
Print a debug() message with the I2C speed is exceeded. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
bc5701e1b4
commit
1bde67b1f4
1 changed files with 3 additions and 1 deletions
|
@ -73,8 +73,10 @@ static int sandbox_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
|
|||
* 400KHz for reads
|
||||
*/
|
||||
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 ops->xfer(emul, msg, nmsgs);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue