[PATCH 1/2] mxc_i2c: fix i2c_probe() failure by using i2c_reset()

Eric Miao eric.miao at linaro.org
Sat Oct 8 15:22:39 UTC 2011


From: Eric Miao <eric.miao at canonical.com>

i2c_reset() is the better fit to be used in i2c_probe(), and
it also fixes the bug of i2c_probe() failure on mx53loco with
a MC34708 PMIC.

Signed-off-by: Eric Miao <eric.miao at linaro.org>
---
 drivers/i2c/mxc_i2c.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index ebde3c5..77369ec 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -167,8 +167,7 @@ int i2c_probe(uchar chip)
 {
 	int ret;
 
-	writew(0, I2C_BASE + I2CR); /* Reset module */
-	writew(I2CR_IEN, I2C_BASE + I2CR);
+	i2c_reset();
 
 	writew(I2CR_IEN |  I2CR_MSTA | I2CR_MTX, I2C_BASE + I2CR);
 	ret = tx_byte(chip << 1);
-- 
1.7.4.1




More information about the linaro-dev mailing list