public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add sram34xx.S
@ 2008-03-28 11:46 Tony Lindgren
  2008-03-28 11:46 ` [PATCH 1/2] ARM: OMAP3: Add 34xx SRAM functions Tony Lindgren
  2008-05-15 21:40 ` [PATCH 0/2] Add sram34xx.S Tony Lindgren
  0 siblings, 2 replies; 15+ messages in thread
From: Tony Lindgren @ 2008-03-28 11:46 UTC (permalink / raw)
  To: linux-omap; +Cc: Dasu, Karthik P, Tony Lindgren

Hi all,

Following two patches add sram34xx.S based on Karthik's patch and what's
at [1]. Looks like the sram code in [1] is newer so I've used that.
Let me know if that's not the case.

Karthik, can you please check and ack? I've only compile tested them.

Regards,

Tony

[1] http://linux.omap.com/pub/kernel/3430zoom/linux-ldp-v1.0b.tar.gz

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH] I2C: Fix twl4030 timeouts on omap3430
@ 2008-03-28  8:41 Tony Lindgren
  2008-03-31 10:43 ` Tony Lindgren
  0 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2008-03-28  8:41 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Hi all,

This helps with the annoying I2C timeouts. Does anybody have an idea
why the twl4030 chip does not like doing multiple transfers in a row?

To me the only difference seems to be that clocks are idled between
writing the twl4030 register and reading the register value.

Regards,

Tony

[-- Attachment #2: i2c-twl4030-timeout.patch --]
[-- Type: text/x-diff, Size: 1640 bytes --]

>From 25c4c8f449819cb6f40b59ed1a9b25ebcc7cd72e Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Thu, 27 Mar 2008 19:05:30 +0200
Subject: [PATCH] I2C: Fix twl4030 timeouts on omap3430

For some reason doing a twl4030 write-read cycle can hang the I2C bus
on omap3430. And doing the write and read separately in twl4030_i2c_read()
seems to fix the problem...

Not intended for applying, just a temporary workaround.

diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
index ded86e7..62868b0 100644
--- a/drivers/i2c/chips/twl4030-core.c
+++ b/drivers/i2c/chips/twl4030-core.c
@@ -327,6 +327,7 @@ int twl4030_i2c_read(u8 mod_no, u8 * value, u8 reg, u8 num_bytes)
 		return -EPERM;
 	}
 	mutex_lock(&twl->xfer_lock);
+
 	/* [MSG1] fill the register address data */
 	msg = &twl->xfer_msg[0];
 	msg->addr = twl->address;
@@ -334,18 +335,25 @@ int twl4030_i2c_read(u8 mod_no, u8 * value, u8 reg, u8 num_bytes)
 	msg->flags = 0;	/* Read the register value */
 	val = twl4030_map[mod_no].base + reg;
 	msg->buf = &val;
+	ret = i2c_transfer(twl->client.adapter, twl->xfer_msg, 1);
+	if (ret < 0)
+		goto out;
+ 
 	/* [MSG2] fill the data rx buffer */
 	msg = &twl->xfer_msg[1];
 	msg->addr = twl->address;
 	msg->flags = I2C_M_RD;	/* Read the register value */
 	msg->len = num_bytes;	/* only n bytes */
 	msg->buf = value;
-	ret = i2c_transfer(twl->client.adapter, twl->xfer_msg, 2);
+	ret = i2c_transfer(twl->client.adapter, twl->xfer_msg, 1);
+
+out:
 	mutex_unlock(&twl->xfer_lock);
 
 	/* i2cTransfer returns num messages.translate it pls.. */
 	if (ret >= 0)
 		ret = 0;
+
 	return ret;
 }
 

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

end of thread, other threads:[~2008-05-15 21:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 11:46 [PATCH 0/2] Add sram34xx.S Tony Lindgren
2008-03-28 11:46 ` [PATCH 1/2] ARM: OMAP3: Add 34xx SRAM functions Tony Lindgren
2008-03-28 11:46   ` [PATCH 2/2] ARCH: OMAP3: Make SRAM code from TI CDP compile and work Tony Lindgren
     [not found]     ` <1206704800-6768-4-git-send-email-tony@atomide.com>
2008-03-28 11:46       ` [PATCH] I2C: Fix twl4030 timeouts on omap3430 Tony Lindgren
2008-03-28 11:46         ` Tony Lindgren
2008-03-28 11:49           ` Tony Lindgren
2008-03-28 11:48         ` Tony Lindgren
2008-05-15 21:40 ` [PATCH 0/2] Add sram34xx.S Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-03-28  8:41 [PATCH] I2C: Fix twl4030 timeouts on omap3430 Tony Lindgren
2008-03-31 10:43 ` Tony Lindgren
2008-03-31 14:30   ` Tony Lindgren
2008-04-01 12:43     ` Tony Lindgren
2008-04-01 13:00       ` Peter 'p2' De Schrijver
2008-04-01 13:38         ` Tony Lindgren
2008-04-01 14:04           ` Tony Lindgren

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