[i2c] [Patch] scx200_acb: fix status-related error on cs5535

Ben Gardner gardner.ben at gmail.com
Tue Dec 12 23:42:52 CET 2006


I use the scx200_acb driver with the Geode GX/CS5535.
The current driver fails i2c-dev transactions (ie, returns -1) more
often than I'd like.
Repeating the transaction once usually succeeds.

Section of 6.11.1.2 of the Geode CS5535 datasheet indicates that some
status bits can be cleared by writing a 1. The attached patch writes
the status back to the SBM_STS/ACBST register.
I haven't observed a failure since I made this change.

This has only been tested on a Geode GX/CS5535 with 2.6.19.

Signed-off-by: Ben Gardner <gardner.ben at gmail.com>
-------------- next part --------------
Index: linux-2.6.19/drivers/i2c/busses/scx200_acb.c
===================================================================
--- linux-2.6.19.orig/drivers/i2c/busses/scx200_acb.c	2006-11-29 15:57:37.000000000 -0600
+++ linux-2.6.19/drivers/i2c/busses/scx200_acb.c	2006-12-12 16:03:36.000000000 -0600
@@ -236,6 +236,7 @@
 		status = inb(ACBST);
 
 		/* Reset the status register to avoid the hang */
+		outb(status, ACBST);
 		outb(0, ACBST);
 
 		if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) {


More information about the i2c mailing list