[U-Boot] [PATCH 15/24] mxc_i2c: add i2c_regs argument to i2c_imx_stop

Troy Kisky
2012-06-22T04:12:10Z

This is prep work for CONFIG_I2C_MULTI_BUS.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
drivers/i2c/mxc_i2c.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 802f70f..cb061f7 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -199,9 +199,8 @@ static int tx_byte(struct mxc_i2c_regs *i2c_regs, u8 byte)
/*
* Stop I2C transaction
*/
-void i2c_imx_stop(void)
+static void i2c_imx_stop(struct mxc_i2c_regs *i2c_regs)
{
- struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE;
unsigned int temp = readb(&i2c_regs->i2cr);

temp &= ~(I2CR_MSTA | I2CR_MTX);
@@ -331,7 +330,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
buf[i] = readb(&i2c_regs->i2dr);
}

- i2c_imx_stop();
+ i2c_imx_stop(i2c_regs);

return ret;
}
@@ -355,7 +354,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
return ret;
}

- i2c_imx_stop();
+ i2c_imx_stop(i2c_regs);

return ret;
}
--
1.7.9.5