summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2012-07-19 08:18:08 +0000
committerHeiko Schocher <hs@denx.de>2012-07-31 07:43:51 +0200
commitcfbb88d338f8a4ff5a0b165521ffc030efe72f31 (patch)
treee47b249c9776098cffbe245d062ad419685816cb /drivers/i2c
parentc4330d283cefbd3574366e82910da3e918324b86 (diff)
mxc_i2c.c: code i2c_probe as a 0 length i2c_write
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/mxc_i2c.c25
1 files changed, 8 insertions, 17 deletions
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
@@ -302,23 +302,6 @@ exit:
}
/*
- * 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
*/
int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
@@ -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);
+}