]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: i2c: sandbox: Add debugging to the speed limit
authorSimon Glass <sjg@chromium.org>
Mon, 20 Apr 2015 18:37:13 +0000 (12:37 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 6 May 2015 02:58:19 +0000 (20:58 -0600)
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>
drivers/i2c/sandbox_i2c.c

index d6adc0f721b85cb6b352d1993641da444aa62919..621caecf044013e383d7b352c001cd2f47d482f6 100644 (file)
@@ -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);
 }