summaryrefslogtreecommitdiff
path: root/drivers/i2c/mxc_i2c.c
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2012-07-19 08:18:12 +0000
committerHeiko Schocher <hs@denx.de>2012-07-31 07:49:48 +0200
commit83a1a19038b0bf36c966b7c7b67708e19b45c3b5 (patch)
tree81a16f9a3d208bce1e50fcf7f047c182920ff098 /drivers/i2c/mxc_i2c.c
parent71e9f3cbeb99ad696b2034748092dfc93f67bf73 (diff)
downloadu-boot-imx-83a1a19038b0bf36c966b7c7b67708e19b45c3b5.zip
u-boot-imx-83a1a19038b0bf36c966b7c7b67708e19b45c3b5.tar.gz
u-boot-imx-83a1a19038b0bf36c966b7c7b67708e19b45c3b5.tar.bz2
mxc_i2c: place i2c_reset code inline
imx_reset is only referenced once so move to that location. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/i2c/mxc_i2c.c')
-rw-r--r--drivers/i2c/mxc_i2c.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 9efa9bd..717bc7a 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -114,17 +114,6 @@ static uint8_t i2c_imx_get_clk(unsigned int rate)
}
/*
- * Reset I2C Controller
- */
-void i2c_reset(void)
-{
- struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE;
-
- writeb(0, &i2c_regs->i2cr); /* Reset module */
- writeb(0, &i2c_regs->i2sr);
-}
-
-/*
* Init I2C Bus
*/
void i2c_init(int speed, int unused)
@@ -136,7 +125,9 @@ void i2c_init(int speed, int unused)
/* Store divider value */
writeb(idx, &i2c_regs->ifdr);
- i2c_reset();
+ /* Reset module */
+ writeb(0, &i2c_regs->i2cr);
+ writeb(0, &i2c_regs->i2sr);
}
/*