public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c-omap.c modified for 2430 I2C controller
@ 2006-12-03 20:34 Syed Mohammed, Khasim
  2006-12-11 21:45 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Syed Mohammed, Khasim @ 2006-12-03 20:34 UTC (permalink / raw)
  To: linux-omap-open-source

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

Hi,

 

In OMAP 2430 the DATA register is only 8 bits. In existing bus driver
(i2c-omap.c) we were writing 16 bits (if len>1). 

 

In order to do a multi byte read / write we need to update the I2C FIFO
threshold values and do a continuous write/read from DATA register. I
will take up this task later some time along with I2C HS. For now, the
attached patch makes I2C functional for 2430.

 

Regards,

Khasim


[-- Attachment #2: i2c_omap.patch --]
[-- Type: application/octet-stream, Size: 1512 bytes --]

In OMAP 2430 the I2C DATA Register is 8bit wide, the logic to write 16bit word doesn't apply for OMAP2430 I2C controller.

Signed-off-by: Syed Mohammed Khasim  <x0khasim@ti.com>

Files Changed:
 i2c-omap.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

=============================================================================
diff -purN linux-omap/drivers/i2c/busses/i2c-omap.c devpt_branch/drivers/i2c/busses/i2c-omap.c
--- linux-omap/drivers/i2c/busses/i2c-omap.c	2006-11-20 21:55:22.000000000 -0600
+++ devpt_branch/drivers/i2c/busses/i2c-omap.c	2006-12-03 13:07:34.000000000 -0600
@@ -478,9 +478,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
 			if (dev->buf_len) {
 				*dev->buf++ = w;
 				dev->buf_len--;
-				if (dev->buf_len) {
-					*dev->buf++ = w >> 8;
-					dev->buf_len--;
+				/*
+				 * Data reg in 2430 is 8 bit wide, 
+				 */
+				if (!cpu_is_omap2430()) {
+					if (dev->buf_len) {
+						*dev->buf++ = w >> 8;
+						dev->buf_len--;
+					}
 				}
 			} else
 				dev_err(dev->dev, "RRDY IRQ while no data"
@@ -493,9 +498,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
 			if (dev->buf_len) {
 				w = *dev->buf++;
 				dev->buf_len--;
-				if (dev->buf_len) {
-					w |= *dev->buf++ << 8;
-					dev->buf_len--;
+				/*
+				 * Data reg in 2430 is 8 bit wide, 
+				 */
+				if (!cpu_is_omap2430()) {
+					if (dev->buf_len) {
+						w |= *dev->buf++ << 8;
+						dev->buf_len--;
+					}
 				}
 			} else
 				dev_err(dev->dev, "XRDY IRQ while no"

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] i2c-omap.c modified for 2430 I2C controller
  2006-12-03 20:34 [PATCH] i2c-omap.c modified for 2430 I2C controller Syed Mohammed, Khasim
@ 2006-12-11 21:45 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2006-12-11 21:45 UTC (permalink / raw)
  To: Syed Mohammed, Khasim; +Cc: linux-omap-open-source

* Syed Mohammed, Khasim <x0khasim@ti.com> [061203 12:34]:
> Hi,
> 
>  
> 
> In OMAP 2430 the DATA register is only 8 bits. In existing bus driver
> (i2c-omap.c) we were writing 16 bits (if len>1). 
> 
>  
> 
> In order to do a multi byte read / write we need to update the I2C FIFO
> threshold values and do a continuous write/read from DATA register. I
> will take up this task later some time along with I2C HS. For now, the
> attached patch makes I2C functional for 2430.

Pushing today.

Tony

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

end of thread, other threads:[~2006-12-11 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03 20:34 [PATCH] i2c-omap.c modified for 2430 I2C controller Syed Mohammed, Khasim
2006-12-11 21:45 ` Tony Lindgren

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