S3C24XX: fix small bug in write
Subsystems (2)
PATCH 1/1 S3C24XX: fix small bug in write
This affects a few devices on i2c, where the i2c controller on the S3C2410 simply stops working when writing to the bus.
Adding a small delay by reading the IICSTAT register 6 times seesm to be good enough to allow the controller to continue without stopping the bus transaction.
Signed-off-by Ben Dooks <ben-linux at fluff.org>
drivers/i2c/busses/i2c-s3c2410.c +9 -0
@@ -269,6 +269,7 @@ static int i2s_s3c_irq_nextbyte(struct sunsigned long tmp;unsigned char byte;int ret =0 ; +int i;switch (i2c->state) {
@@ -325,6 +326,14 @@ static int i2s_s3c_irq_nextbyte(struct s byte = i2c->msg->buf[i2c->msg_ptr++];writeb (byte, i2c->regs +S3C2410_IICDS ); +/* sometimes write operations fail if the write is +* let go too quickly, slow down the proceedings +* slightly. +*/ + +for (i =0 ; i <6 ; i++) + tmp +=readl (i2c->regs +S3C2410_IICSTAT ); + }else if (!is_lastmsg (i2c)) {/* we need to go to the next i2c message */
PATCH 1/1 S3C24XX: fix small bug in write
Hi Ben,
Please resubmit this into new i2c mailing list.
http://lists.lm-sensors.org/mailman/listinfo/i2c
Thanks,
Regards
Rudolf