diff mbox

[U-Boot,1/4] blackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024

Message ID 1390888416-23534-1-git-send-email-sonic.adi@gmail.com
State Accepted
Delegated to: Heiko Schocher
Headers show

Commit Message

Sonic Zhang Jan. 28, 2014, 5:53 a.m. UTC
From: Sonic Zhang <sonic.zhang@analog.com>

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/i2c/bfin-twi_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heiko Schocher Jan. 30, 2014, 5:27 a.m. UTC | #1
Hello Sonic,

Am 28.01.2014 06:53, schrieb Sonic Zhang:
> From: Sonic Zhang<sonic.zhang@analog.com>
>
> Signed-off-by: Sonic Zhang<sonic.zhang@analog.com>
> ---
>   drivers/i2c/bfin-twi_i2c.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)


Applied to u-boot-i2c.git, thanks!

bye,
Heiko
diff mbox

Patch

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;