public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] possible bug in i2c-algo-bit's inb function
@ 2005-02-27  4:49 Andreas Oberritter
  2005-02-27  9:35 ` Jean Delvare
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Oberritter @ 2005-02-27  4:49 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, sensors, simon

Hi,

while writing a driver for a cardbus card which is supposed to use the
bit-banging algorithm I noticed that communication with the I2C slave
(Philips TDA10046) would fail without this patch. It forces SDA to high
for every bit in i2c_inb() instead of once per byte. Can this patch go
into the mainline kernel or will this break other drivers? I am using
Kernel version 2.6.10.

Signed-off-by: Andreas Oberritter <obi@saftware.de>

--- linux-2.6/drivers/i2c/algos/i2c-algo-bit.c.orig	2005-02-27 04:39:33.663444536 +0100
+++ linux-2.6/drivers/i2c/algos/i2c-algo-bit.c	2005-02-27 04:39:54.978204200 +0100
@@ -197,8 +197,8 @@ static int i2c_inb(struct i2c_adapter *i
 	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
 
 	/* assert: scl is low */
-	sdahi(adap);
 	for (i=0;i<8;i++) {
+		sdahi(adap);
 		if (sclhi(adap)<0) { /* timeout */
 			DEB2(printk(KERN_DEBUG " i2c_inb: timeout at bit #%d\n", 7-i));
 			return -ETIMEDOUT;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-27 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-27  4:49 [PATCH] possible bug in i2c-algo-bit's inb function Andreas Oberritter
2005-02-27  9:35 ` Jean Delvare
2005-02-27 18:13   ` Andreas Oberritter
2005-02-27 18:52     ` Jean Delvare
2005-02-27 21:55       ` Andreas Oberritter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox