From: Troy Kisky Date: Thu, 19 Jul 2012 08:18:08 +0000 (+0000) Subject: mxc_i2c.c: code i2c_probe as a 0 length i2c_write X-Git-Tag: v2012.10-rc1~415^2~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cfbb88d338f8a4ff5a0b165521ffc030efe72f31;p=u-boot mxc_i2c.c: code i2c_probe as a 0 length i2c_write Signed-off-by: Troy Kisky Acked-by: Marek Vasut Acked-by: Stefano Babic --- diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index 55a688a802..626e13eb11 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -301,23 +301,6 @@ exit: return ret; } -/* - * Try if a chip add given address responds (probe the chip) - */ -int i2c_probe(uchar chip) -{ - struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE; - int ret; - - ret = i2c_imx_start(); - if (ret) - return ret; - - ret = tx_byte(i2c_regs, chip << 1); - i2c_imx_stop(); - return ret; -} - /* * Read data from I2C device */ @@ -406,3 +389,11 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) return ret; } + +/* + * Test if a chip at a given address responds (probe the chip) + */ +int i2c_probe(uchar chip) +{ + return i2c_write(chip, 0, 0, NULL, 0); +}