提交 cfbb88d3 编写于 作者: T Troy Kisky 提交者: Heiko Schocher

mxc_i2c.c: code i2c_probe as a 0 length i2c_write

Signed-off-by: NTroy Kisky <troy.kisky@boundarydevices.com>
Acked-by: NMarek Vasut <marex@denx.de>
Acked-by: NStefano Babic <sbabic@denx.de>
上级 c4330d28
......@@ -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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册