All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] *** SUBJECT HERE ***
@ 2009-08-17 22:45 Moiz Sonasath
  2009-08-17 22:45 ` [PATCH 1/3] i2c-omap: Fix I2C status ACK Moiz Sonasath
  0 siblings, 1 reply; 7+ messages in thread
From: Moiz Sonasath @ 2009-08-17 22:45 UTC (permalink / raw)
  To: linux-omap; +Cc: Moiz Sonasath, Vikram Pandita

i2c-omap: I2C clean-up patch

This patch includes the following fixes:
-Fix I2C status ACK
-ACK pending [R/X]DR and [R/X]RDY interrupts in the error/completeion path
-Enable workaround for Errata 1.153 based on I2C IP block

Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>

Moiz Sonasath (3):
  i2c-omap: Fix I2C status ACK
  i2c-omap: ACK pending [R/X]DR and [R/X]RDY interrupts in the
    error/completeion path
  i2c-omap: Enable workaround for Errata 1.153 based on I2C IP block

 drivers/i2c/busses/i2c-omap.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


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

* [PATCH 1/3] i2c-omap: Fix I2C status ACK
  2009-08-17 22:45 [PATCH 0/3] *** SUBJECT HERE *** Moiz Sonasath
@ 2009-08-17 22:45 ` Moiz Sonasath
  2009-08-17 22:45   ` [PATCH 2/3] i2c-omap: ACK pending [R/X]DR and [R/X]RDY interrupts Moiz Sonasath
  0 siblings, 1 reply; 7+ messages in thread
From: Moiz Sonasath @ 2009-08-17 22:45 UTC (permalink / raw)
  To: linux-omap; +Cc: Nishanth Menon, Moiz Sonasath

From: Nishanth Menon <nm@ti.com>

I2C status ack for [RX]RDR and [RX]RDY could
cause race conditions of clearing the event
twice and a violation of the programing
sequence as defined in TRM This patch fixes
the same.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
---
 drivers/i2c/busses/i2c-omap.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index d258b02..94639d0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -674,7 +674,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
 
 		err = 0;
 complete:
-		omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
+		/*
+		 * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be
+		 * acked after the data operation is complete.
+		 * Ref: TRM SWPU114Q Figure 18-31
+		 */
+		omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &
+				~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
 
 		if (stat & OMAP_I2C_STAT_NACK) {
 			err |= OMAP_I2C_STAT_NACK;
-- 
1.5.6.3


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

* [PATCH 2/3] i2c-omap: ACK pending [R/X]DR and [R/X]RDY interrupts
  2009-08-17 22:45 ` [PATCH 1/3] i2c-omap: Fix I2C status ACK Moiz Sonasath
@ 2009-08-17 22:45   ` Moiz Sonasath
  2009-08-17 22:45     ` [PATCH 3/3] i2c-omap: Enable workaround for Errata 1.153 based on Moiz Sonasath
  0 siblings, 1 reply; 7+ messages in thread
From: Moiz Sonasath @ 2009-08-17 22:45 UTC (permalink / raw)
  To: linux-omap; +Cc: Moiz Sonasath, Vikram Pandita

ACK any pending read/write interrupts before exiting the ISR either after 
completing the operation [ARDY interrupt] or in case of an error 
[NACK|AL interrupt]

Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
---
 drivers/i2c/busses/i2c-omap.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 94639d0..16b39f4 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -694,6 +694,9 @@ complete:
 		}
 		if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
 					OMAP_I2C_STAT_AL)) {
+			omap_i2c_ack_stat(dev, stat &
+				(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
 			omap_i2c_complete_cmd(dev, err);
 			return IRQ_HANDLED;
 		}
-- 
1.5.6.3


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

* [PATCH 3/3] i2c-omap: Enable workaround for Errata 1.153 based on
  2009-08-17 22:45   ` [PATCH 2/3] i2c-omap: ACK pending [R/X]DR and [R/X]RDY interrupts Moiz Sonasath
@ 2009-08-17 22:45     ` Moiz Sonasath
  2009-08-18  7:04       ` Paul Walmsley
  0 siblings, 1 reply; 7+ messages in thread
From: Moiz Sonasath @ 2009-08-17 22:45 UTC (permalink / raw)
  To: linux-omap; +Cc: Moiz Sonasath

Silicon Errata 1.153 has been fixed on OMAP 3630|4430 with the use of a later
version of I2C IP block.

The errata impacts OMAP 2420|2430|3430, enable the workaround for these based 
on I2C IP block revision number instead of OMAP CPU type

Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com
---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 16b39f4..827da08 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -784,7 +784,7 @@ complete:
 				 * memory to the I2C interface.
 				 */
 
-				if (cpu_is_omap34xx()) {
+				if (dev->rev <= OMAP_I2C_REV_ON_3430) {
 						while (!(stat & OMAP_I2C_STAT_XUDF)) {
 							if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {
 								omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
-- 
1.5.6.3


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

* Re: [PATCH 3/3] i2c-omap: Enable workaround for Errata 1.153 based on
  2009-08-17 22:45     ` [PATCH 3/3] i2c-omap: Enable workaround for Errata 1.153 based on Moiz Sonasath
@ 2009-08-18  7:04       ` Paul Walmsley
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Walmsley @ 2009-08-18  7:04 UTC (permalink / raw)
  To: Moiz Sonasath; +Cc: linux-omap

On Mon, 17 Aug 2009, Moiz Sonasath wrote:

> Silicon Errata 1.153 has been fixed on OMAP 3630|4430 with the use of a later
> version of I2C IP block.
> 
> The errata impacts OMAP 2420|2430|3430, enable the workaround for these based 
> on I2C IP block revision number instead of OMAP CPU type
> 
> Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
> Signed-off-by: Vikram Pandita <vikram.pandita@ti.com

Reviewed-by: Paul Walmsley <paul@pwsan.com>

> ---
>  drivers/i2c/busses/i2c-omap.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 16b39f4..827da08 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -784,7 +784,7 @@ complete:
>  				 * memory to the I2C interface.
>  				 */
>  
> -				if (cpu_is_omap34xx()) {
> +				if (dev->rev <= OMAP_I2C_REV_ON_3430) {
>  						while (!(stat & OMAP_I2C_STAT_XUDF)) {
>  							if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {
>  								omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
> -- 
> 1.5.6.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


- Paul

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

* [PATCH 1/3] i2c-omap: Fix I2C status ACK
       [not found] ` <1250785276-31713-1-git-send-email-m-sonasath-l0cyMroinI0@public.gmane.org>
@ 2009-08-20 16:21   ` Moiz Sonasath
  0 siblings, 0 replies; 7+ messages in thread
From: Moiz Sonasath @ 2009-08-20 16:21 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg, Nishanth Menon, Moiz Sonasath

From: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>

I2C status ack for [RX]RDR and [RX]RDY could
cause race conditions of clearing the event
twice and a violation of the programing
sequence as defined in TRM This patch fixes
the same.

Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
Signed-off-by: Moiz Sonasath <m-sonasath-l0cyMroinI0@public.gmane.org>
---
 drivers/i2c/busses/i2c-omap.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index d258b02..94639d0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -674,7 +674,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
 
 		err = 0;
 complete:
-		omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
+		/*
+		 * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be
+		 * acked after the data operation is complete.
+		 * Ref: TRM SWPU114Q Figure 18-31
+		 */
+		omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &
+				~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
 
 		if (stat & OMAP_I2C_STAT_NACK) {
 			err |= OMAP_I2C_STAT_NACK;
-- 
1.5.6.3

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

* [PATCH 1/3] i2c-omap: Fix I2C status ACK
       [not found] <1250548931-18279-1-git-send-email-n>
@ 2009-08-17 22:42 ` Unknown, n
  0 siblings, 0 replies; 7+ messages in thread
From: Unknown, n @ 2009-08-17 22:42 UTC (permalink / raw)
  To: linux-omap; +Cc: Nishanth Menon, Moiz Sonasath

From: Nishanth Menon <nm@ti.com>

I2C status ack for [RX]RDR and [RX]RDY could
cause race conditions of clearing the event
twice and a violation of the programing
sequence as defined in TRM This patch fixes
the same.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
---
 drivers/i2c/busses/i2c-omap.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index d258b02..94639d0 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -674,7 +674,14 @@ omap_i2c_isr(int this_irq, void *dev_id)
 
 		err = 0;
 complete:
-		omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
+		/*
+		 * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be
+		 * acked after the data operation is complete.
+		 * Ref: TRM SWPU114Q Figure 18-31
+		 */
+		omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &
+				~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
 
 		if (stat & OMAP_I2C_STAT_NACK) {
 			err |= OMAP_I2C_STAT_NACK;
-- 
1.5.6.3


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

end of thread, other threads:[~2009-08-20 16:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17 22:45 [PATCH 0/3] *** SUBJECT HERE *** Moiz Sonasath
2009-08-17 22:45 ` [PATCH 1/3] i2c-omap: Fix I2C status ACK Moiz Sonasath
2009-08-17 22:45   ` [PATCH 2/3] i2c-omap: ACK pending [R/X]DR and [R/X]RDY interrupts Moiz Sonasath
2009-08-17 22:45     ` [PATCH 3/3] i2c-omap: Enable workaround for Errata 1.153 based on Moiz Sonasath
2009-08-18  7:04       ` Paul Walmsley
  -- strict thread matches above, loose matches on Subject: below --
2009-08-20 16:21 [PATCH 0/3] i2c-omap: I2C clean-up patch Moiz Sonasath
     [not found] ` <1250785276-31713-1-git-send-email-m-sonasath-l0cyMroinI0@public.gmane.org>
2009-08-20 16:21   ` [PATCH 1/3] i2c-omap: Fix I2C status ACK Moiz Sonasath
     [not found] <1250548931-18279-1-git-send-email-n>
2009-08-17 22:42 ` Unknown, n

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.