From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Tue, 21 Apr 2015 07:04:32 +0200 Subject: [U-Boot] [PATCH 02/20] dm: i2c: sandbox: Add debugging to the speed limit In-Reply-To: <1429555051-22335-3-git-send-email-sjg@chromium.org> References: <1429555051-22335-1-git-send-email-sjg@chromium.org> <1429555051-22335-3-git-send-email-sjg@chromium.org> Message-ID: <5535DA60.5070702@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, Am 20.04.2015 20:37, schrieb Simon Glass: > Print a debug() message with the I2C speed is exceeded. > > Signed-off-by: Simon Glass > --- > > drivers/i2c/sandbox_i2c.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c > index d6adc0f..621caec 100644 > --- a/drivers/i2c/sandbox_i2c.c > +++ b/drivers/i2c/sandbox_i2c.c > @@ -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; > + } Why different speeds for reading/writing? bye, Heiko > return ops->xfer(emul, msg, nmsgs); > } > > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany