Volunteers to test i2c-algo-8xx on v2.6?

6 messages, 4 authors, 2005-08-09 · open the first message on its own page

Volunteers to test i2c-algo-8xx on v2.6?

From: Joakim Tjernlund <hidden>
Date: 2005-08-08 08:08:25

Hi

Had a look at my old driver and it needs a little care.

Basically this block has changed 
+	if(count > 16){
+		/* Chip bug, set enable here */
+		local_irq_save(flags);
+		i2c->i2c_i2cmr = 0x13;	/* Enable some interupts */
+		i2c->i2c_i2cer = 0xff;
+		i2c->i2c_i2mod |= 1;	/* Enable */
+		i2c->i2c_i2com |= 0x80;	/* Begin transmission */
+
+		/* Wait for IIC transfer */
+		tmo = interruptible_sleep_on_timeout(&iic_wait,1*HZ);
+		local_irq_restore(flags);
+	} else { /* busy wait for small transfers, its faster */
+		i2c->i2c_i2cmr = 0x00;	/* Disable I2C interupts */
+		i2c->i2c_i2cer = 0xff;
+		i2c->i2c_i2mod |= 1;	/* Enable */
+		i2c->i2c_i2com |= 0x80;	/* Begin transmission */
+		tmo = jiffies + 1*HZ;
+	       	/* Busy wait, with a timeout */
+		while(!(i2c->i2c_i2cer & 0x11 || time_after(jiffies, tmo)));
+	}
into
+		/* Chip bug, set enable here */
+		local_irq_save(flags);
+		i2c->i2c_i2cmr = 0x13;	/* Enable some interupts */
+		i2c->i2c_i2cer = 0xff;
+		i2c->i2c_i2mod |= 1;	/* Enable */
+		i2c->i2c_i2com |= 0x80 | 0x01; /* Begin transmission and force master.
                                              Some errors(CL) clears the M/S bit */
+
+		/* Wait for IIC transfer */
+		tmo = interruptible_sleep_on_timeout(&iic_wait,1*HZ);
+		local_irq_restore(flags);
I have done this for cpm_iic_read, cpm_iic_write and cpm_iic_try_address.
Also note the the addition of "| 0x01" to i2c->i2c_i2com.

Re: Volunteers to test i2c-algo-8xx on v2.6?

From: Aristeu Sergio Rozanski Filho <hidden>
Date: 2005-08-08 13:05:31

Hi,
I have done this for cpm_iic_read, cpm_iic_write and cpm_iic_try_address.
Also note the the addition of "| 0x01" to i2c->i2c_i2com.
the updated patch is attached, thanks Joakim.
seems Debora need this too for 2.4 version. Debora, could you please
generate a diff against latest Wolfgang's development tree and submit to
him?
Thanks

--
Aristeu

Re: Volunteers to test i2c-algo-8xx on v2.6?

From: Tom Rini <hidden>
Date: 2005-08-09 16:18:06

On Mon, Aug 08, 2005 at 10:05:23AM -0300, Aristeu Sergio Rozanski Filho wrote:
Hi,
quoted
I have done this for cpm_iic_read, cpm_iic_write and cpm_iic_try_address.
Also note the the addition of "| 0x01" to i2c->i2c_i2com.
the updated patch is attached, thanks Joakim.
seems Debora need this too for 2.4 version. Debora, could you please
generate a diff against latest Wolfgang's development tree and submit to
him?
I've tested this version with my cheesy sttm reader on an rpxlite, and
with the following, things work:

Signed-off-by: Tom Rini <redacted>
diff --git a/drivers/i2c/busses/i2c-rpx.c b/drivers/i2c/busses/i2c-rpx.c
--- a/drivers/i2c/busses/i2c-rpx.c
+++ b/drivers/i2c/busses/i2c-rpx.c
@@ -55,17 +55,7 @@ rpx_iic_init(struct i2c_algo_8xx_data *d
 	data->i2c = (i2c8xx_t *)&(((immap_t *)IMAP_ADDR)->im_i2c);
 }
 
-static int rpx_install_isr(int irq, void (*func)(void *, void *), void *data)
-{
-	/* install interrupt handler */
-	cpm_install_handler(irq, (void (*)(void *, struct pt_regs *)) func, data);
-
-	return 0;
-}
-
-static struct i2c_algo_8xx_data rpx_data = {
-	.setisr = rpx_install_isr
-};
+static struct i2c_algo_8xx_data rpx_data;
 
 static struct i2c_adapter rpx_ops = {
 	.owner		= THIS_MODULE,
-- 
Tom Rini
http://gate.crashing.org/~trini/

Re: Volunteers to test i2c-algo-8xx on v2.6?

From: Tom Rini <hidden>
Date: 2005-08-09 16:45:19

On Tue, Aug 09, 2005 at 01:29:44PM -0300, aris@conectiva.com.br wrote:
quoted
I've tested this version with my cheesy sttm reader on an rpxlite, and
with the following, things work:
ah, forgot the most important question: did you tested i2c driver?
Yes, my cheesy sttm reader app was able to print what looked like a
sane temperature (34 C, now up to 36 C).

-- 
Tom Rini
http://gate.crashing.org/~trini/

Re: Volunteers to test i2c-algo-8xx on v2.6?

From: <hidden>
Date: 2005-08-09 17:14:04

I've tested this version with my cheesy sttm reader on an rpxlite, and
with the following, things work:
ah, forgot the most important question: did you tested i2c driver?

-- 
Aristeu

Re: Volunteers to test i2c-algo-8xx on v2.6?

From: <hidden>
Date: 2005-08-09 17:24:57

I've tested this version with my cheesy sttm reader on an rpxlite, and
with the following, things work:
I already did that in a separate patch, already sent to Marcelo.
thanks anyway!

-- 
Aristeu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help