From: Sonic Zhang Date: Tue, 28 Jan 2014 05:53:33 +0000 (+0800) Subject: blackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024 X-Git-Tag: v2014.04-rc2~141 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bb0fad0ea095944c76dc94fcd13b91699413f79f;p=oweals%2Fu-boot.git blackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024 Signed-off-by: Sonic Zhang --- diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/bfin-twi_i2c.c index b3a04d3207..5c372809c9 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;