summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2014-01-28 13:53:33 +0800
committerHeiko Schocher <hs@denx.de>2014-02-20 06:46:55 +0100
commitbb0fad0ea095944c76dc94fcd13b91699413f79f (patch)
treedb1c99c905ed2020b52d43b0f0df629bb38f3d29 /drivers/i2c
parent18948632a92f83cfad125edc6ff4a162a7d90a05 (diff)
downloadu-boot-imx-bb0fad0ea095944c76dc94fcd13b91699413f79f.zip
u-boot-imx-bb0fad0ea095944c76dc94fcd13b91699413f79f.tar.gz
u-boot-imx-bb0fad0ea095944c76dc94fcd13b91699413f79f.tar.bz2
blackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/bfin-twi_i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/bfin-twi_i2c.c
index b3a04d3..5c37280 100644
--- a/drivers/i2c/bfin-twi_i2c.c
+++ b/drivers/i2c/bfin-twi_i2c.c
@@ -274,7 +274,7 @@ unsigned int i2c_get_bus_speed(void)
*/
void i2c_init(int speed, int slaveaddr)
{
- uint8_t prescale = ((get_sclk() / 1024 / 1024 + 5) / 10) & 0x7F;
+ uint8_t prescale = ((get_sclk() / 1000 / 1000 + 5) / 10) & 0x7F;
/* Set TWI internal clock as 10MHz */
twi->control = prescale;