From 08b380ec7b79a40666d8fcc1e48573fe530b313f Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 1 Sep 2014 20:26:33 +0200 Subject: [PATCH] omap24xx_i2c: Proper SCLH calculation Signed-off-by: Paul Kocialkowski --- drivers/omap24xx_i2c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/omap24xx_i2c.c b/drivers/omap24xx_i2c.c index 7782e9d..1198fa2 100644 --- a/drivers/omap24xx_i2c.c +++ b/drivers/omap24xx_i2c.c @@ -52,8 +52,9 @@ void i2c_init (int speed, int slaveadd) /* 12Mhz I2C module clock */ outw (0, I2C_PSC); speed = speed/1000; /* 100 or 400 */ - scl = ((12000/(speed*2)) - 7); /* use 7 when PSC = 0 */ + scl = ((12000/(speed*2)) - 7); outw (scl, I2C_SCLL); + scl = ((12000/(speed*2)) - 5); outw (scl, I2C_SCLH); /* own address */ outw (slaveadd, I2C_OA); -- 2.11.0