diff options
author | Marek Vasut <marex@denx.de> | 2012-11-12 14:34:30 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-11 13:17:30 -0700 |
commit | a157e0d5f6aa0b86bd7b6ae09d11b12a4a736d97 (patch) | |
tree | 7f58ba05a191e7c9ae318f754562345b50540f16 /drivers | |
parent | a06f590f7fce2f484d3bc0bff48a7aa90b70f13d (diff) | |
download | u-boot-a157e0d5f6aa0b86bd7b6ae09d11b12a4a736d97.tar.gz u-boot-a157e0d5f6aa0b86bd7b6ae09d11b12a4a736d97.tar.xz u-boot-a157e0d5f6aa0b86bd7b6ae09d11b12a4a736d97.zip |
i2c: mxs: Use i2c_set_bus_speed() in i2c_init()
Use i2c_set_bus_speed() in i2c_init() within the mxs i2c driver
to avoid duplication of code.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/mxs_i2c.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/i2c/mxs_i2c.c b/drivers/i2c/mxs_i2c.c index 4152242d96..3771452b9f 100644 --- a/drivers/i2c/mxs_i2c.c +++ b/drivers/i2c/mxs_i2c.c @@ -287,22 +287,8 @@ unsigned int i2c_get_bus_speed(void) void i2c_init(int speed, int slaveadd) { - struct mxs_i2c_regs *i2c_regs = (struct mxs_i2c_regs *)MXS_I2C0_BASE; - struct mxs_i2c_speed_table *spd = mxs_i2c_speed_to_cfg(speed); - - if (!spd) { - printf("MXS I2C: Invalid speed selected (%d Hz)\n", speed); - return; - } - mxs_i2c_reset(); - - writel(spd->timing0, &i2c_regs->hw_i2c_timing0); - writel(spd->timing1, &i2c_regs->hw_i2c_timing1); - - writel((0x0015 << I2C_TIMING2_BUS_FREE_OFFSET) | - (0x000d << I2C_TIMING2_LEADIN_COUNT_OFFSET), - &i2c_regs->hw_i2c_timing2); + i2c_set_bus_speed(speed); return; } |