public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
@ 2009-01-23  6:54 Pakaravoor, Jagadeesh
       [not found] ` <EAF47CD23C76F840A9E7FCE10091EFAB02A39CF069-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  2009-02-02 14:05 ` Ben Dooks
  0 siblings, 2 replies; 7+ messages in thread
From: Pakaravoor, Jagadeesh @ 2009-01-23  6:54 UTC (permalink / raw)
  To: linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org; +Cc: Jean Delvare

From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>

Save and restore should include OMAP_I2C_SYSC_REG.

Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
CC: Jouni Hogander <jouni.hogander@nokia.com>
---
Index: linux-omap-2.6/drivers/i2c/busses/i2c-omap.c
===================================================================
--- linux-omap-2.6.orig/drivers/i2c/busses/i2c-omap.c	2009-01-22 12:11:12.000000000 +0530
+++ linux-omap-2.6/drivers/i2c/busses/i2c-omap.c	2009-01-22 12:44:12.202367296 +0530
@@ -182,6 +182,7 @@ struct omap_i2c_dev {
 	u16			scllstate;
 	u16			sclhstate;
 	u16			bufstate;
+	u16			syscstate;
 };
 
 static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
@@ -240,6 +241,7 @@ static void omap_i2c_unidle(struct omap_
 		omap_i2c_write_reg(dev, OMAP_I2C_SCLL_REG, dev->scllstate);
 		omap_i2c_write_reg(dev, OMAP_I2C_SCLH_REG, dev->sclhstate);
 		omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG, dev->bufstate);
+		omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, dev->syscstate);
 	}
 	dev->idle = 0;
 	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
@@ -300,14 +302,15 @@ static int omap_i2c_init(struct omap_i2c
 		} else if (dev->rev >= OMAP_I2C_REV_ON_3430) {
 			u32 v;
 
-			v = SYSC_AUTOIDLE_MASK;
-			v |= SYSC_ENAWAKEUP_MASK;
-			v |= (SYSC_IDLEMODE_SMART <<
+			dev->syscstate = SYSC_AUTOIDLE_MASK;
+			dev->syscstate |= SYSC_ENAWAKEUP_MASK;
+			dev->syscstate |= (SYSC_IDLEMODE_SMART <<
 			      __ffs(SYSC_SIDLEMODE_MASK));
-			v |= (SYSC_CLOCKACTIVITY_FCLK <<
+			dev->syscstate |= (SYSC_CLOCKACTIVITY_FCLK <<
 			      __ffs(SYSC_CLOCKACTIVITY_MASK));
 
-			omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, v);
+			omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG,
+							dev->syscstate);
 			/*
 			 * Enabling all wakup sources to stop I2C freezing on
 			 * WFI instruction.

--
With Regards,
Jagadeesh Bhaskar P
 
----------------------------
Some men see things as they are and say why - I dream things that never were and say why not.
- George Bernard Shaw
----------------------------


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

* RE: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
       [not found] ` <EAF47CD23C76F840A9E7FCE10091EFAB02A39CF069-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2009-01-23  7:21   ` Pakaravoor, Jagadeesh
  2009-01-23  7:52     ` Jean Delvare
  2009-02-02 13:08     ` Aaro Koskinen
  0 siblings, 2 replies; 7+ messages in thread
From: Pakaravoor, Jagadeesh @ 2009-01-23  7:21 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Jean Delvare

Sorry. I forgot to mention that this patch does not apply on mainline. It is meant for Linux Omap tree only.

Please review/ACK the patch, if you have time.

Thank you.

--
Jagadeesh


-----Original Message-----
From: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Pakaravoor, Jagadeesh
Sent: Friday, January 23, 2009 12:25 PM
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Jean Delvare
Subject: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore

From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor-l0cyMroinI0@public.gmane.org>

Save and restore should include OMAP_I2C_SYSC_REG.

Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor-l0cyMroinI0@public.gmane.org>
CC: Jouni Hogander <jouni.hogander-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
---
Index: linux-omap-2.6/drivers/i2c/busses/i2c-omap.c
===================================================================
--- linux-omap-2.6.orig/drivers/i2c/busses/i2c-omap.c	2009-01-22 12:11:12.000000000 +0530
+++ linux-omap-2.6/drivers/i2c/busses/i2c-omap.c	2009-01-22 12:44:12.202367296 +0530
@@ -182,6 +182,7 @@ struct omap_i2c_dev {
 	u16			scllstate;
 	u16			sclhstate;
 	u16			bufstate;
+	u16			syscstate;
 };
 
 static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
@@ -240,6 +241,7 @@ static void omap_i2c_unidle(struct omap_
 		omap_i2c_write_reg(dev, OMAP_I2C_SCLL_REG, dev->scllstate);
 		omap_i2c_write_reg(dev, OMAP_I2C_SCLH_REG, dev->sclhstate);
 		omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG, dev->bufstate);
+		omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, dev->syscstate);
 	}
 	dev->idle = 0;
 	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
@@ -300,14 +302,15 @@ static int omap_i2c_init(struct omap_i2c
 		} else if (dev->rev >= OMAP_I2C_REV_ON_3430) {
 			u32 v;
 
-			v = SYSC_AUTOIDLE_MASK;
-			v |= SYSC_ENAWAKEUP_MASK;
-			v |= (SYSC_IDLEMODE_SMART <<
+			dev->syscstate = SYSC_AUTOIDLE_MASK;
+			dev->syscstate |= SYSC_ENAWAKEUP_MASK;
+			dev->syscstate |= (SYSC_IDLEMODE_SMART <<
 			      __ffs(SYSC_SIDLEMODE_MASK));
-			v |= (SYSC_CLOCKACTIVITY_FCLK <<
+			dev->syscstate |= (SYSC_CLOCKACTIVITY_FCLK <<
 			      __ffs(SYSC_CLOCKACTIVITY_MASK));
 
-			omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, v);
+			omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG,
+							dev->syscstate);
 			/*
 			 * Enabling all wakup sources to stop I2C freezing on
 			 * WFI instruction.

--
With Regards,
Jagadeesh Bhaskar P
 
----------------------------
Some men see things as they are and say why - I dream things that never were and say why not.
- George Bernard Shaw
----------------------------

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
  2009-01-23  7:21   ` Pakaravoor, Jagadeesh
@ 2009-01-23  7:52     ` Jean Delvare
  2009-02-02 13:08     ` Aaro Koskinen
  1 sibling, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2009-01-23  7:52 UTC (permalink / raw)
  To: Pakaravoor, Jagadeesh
  Cc: linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, Ben Dooks

Hi Jagadeesh,

On Fri, 23 Jan 2009 12:51:23 +0530, Pakaravoor, Jagadeesh wrote:
> Sorry. I forgot to mention that this patch does not apply on
> mainline. It is meant for Linux Omap tree only.
> 
> Please review/ACK the patch, if you have time.

You should Cc Ben Dooks rather than me on i2c-omap patches, I do not
deal with embedded platforms.

-- 
Jean Delvare

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

* Re: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
  2009-01-23  7:21   ` Pakaravoor, Jagadeesh
  2009-01-23  7:52     ` Jean Delvare
@ 2009-02-02 13:08     ` Aaro Koskinen
       [not found]       ` <4986F037.3090604-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Aaro Koskinen @ 2009-02-02 13:08 UTC (permalink / raw)
  To: ext Pakaravoor, Jagadeesh
  Cc: linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org,
	Jean Delvare, ben-linux

Hello,

ext Pakaravoor, Jagadeesh wrote:
> From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
> 
> Save and restore should include OMAP_I2C_SYSC_REG.
> 
> Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
> CC: Jouni Hogander <jouni.hogander@nokia.com>
> ---
> Index: linux-omap-2.6/drivers/i2c/busses/i2c-omap.c
> ===================================================================
> --- linux-omap-2.6.orig/drivers/i2c/busses/i2c-omap.c   2009-01-22 12:11:12.000000000 +0530
> +++ linux-omap-2.6/drivers/i2c/busses/i2c-omap.c        2009-01-22 12:44:12.202367296 +0530
> @@ -182,6 +182,7 @@ struct omap_i2c_dev {
>         u16                     scllstate;
>         u16                     sclhstate;
>         u16                     bufstate;
> +       u16                     syscstate;
>  };
> 
>  static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
> @@ -240,6 +241,7 @@ static void omap_i2c_unidle(struct omap_
>                 omap_i2c_write_reg(dev, OMAP_I2C_SCLL_REG, dev->scllstate);
>                 omap_i2c_write_reg(dev, OMAP_I2C_SCLH_REG, dev->sclhstate);
>                 omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG, dev->bufstate);
> +               omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, dev->syscstate);
>         }
>         dev->idle = 0;
>         omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
> @@ -300,14 +302,15 @@ static int omap_i2c_init(struct omap_i2c
>                 } else if (dev->rev >= OMAP_I2C_REV_ON_3430) {
>                         u32 v;

This local variable is left unused, so you will get a compiler warning.

> -                       v = SYSC_AUTOIDLE_MASK;
> -                       v |= SYSC_ENAWAKEUP_MASK;
> -                       v |= (SYSC_IDLEMODE_SMART <<
> +                       dev->syscstate = SYSC_AUTOIDLE_MASK;
> +                       dev->syscstate |= SYSC_ENAWAKEUP_MASK;
> +                       dev->syscstate |= (SYSC_IDLEMODE_SMART <<
>                               __ffs(SYSC_SIDLEMODE_MASK));
> -                       v |= (SYSC_CLOCKACTIVITY_FCLK <<
> +                       dev->syscstate |= (SYSC_CLOCKACTIVITY_FCLK <<
>                               __ffs(SYSC_CLOCKACTIVITY_MASK));
> 
> -                       omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, v);
> +                       omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG,
> +                                                       dev->syscstate);
>                         /*
>                          * Enabling all wakup sources to stop I2C freezing on
>                          * WFI instruction.
> 
> --
> With Regards,
> Jagadeesh Bhaskar P

A.

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

* Re: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
  2009-01-23  6:54 [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore Pakaravoor, Jagadeesh
       [not found] ` <EAF47CD23C76F840A9E7FCE10091EFAB02A39CF069-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2009-02-02 14:05 ` Ben Dooks
       [not found]   ` <20090202140525.GM8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Ben Dooks @ 2009-02-02 14:05 UTC (permalink / raw)
  To: Pakaravoor, Jagadeesh
  Cc: linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org,
	Jean Delvare

On Fri, Jan 23, 2009 at 12:24:45PM +0530, Pakaravoor, Jagadeesh wrote:
> From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
> 
> Save and restore should include OMAP_I2C_SYSC_REG.

is this necessary for inclusion as a bugfix, or can it wait
for a merge window?

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

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

* RE: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
       [not found]       ` <4986F037.3090604-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
@ 2009-02-02 15:22         ` Pakaravoor, Jagadeesh
  0 siblings, 0 replies; 7+ messages in thread
From: Pakaravoor, Jagadeesh @ 2009-02-02 15:22 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jean Delvare,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org

Hi,

> >         omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
> > @@ -300,14 +302,15 @@ static int omap_i2c_init(struct omap_i2c
> >                 } else if (dev->rev >= OMAP_I2C_REV_ON_3430) {
> >                         u32 v;
> 
> This local variable is left unused, so you will get a compiler warning.
> 
> > -                       v = SYSC_AUTOIDLE_MASK;
> > -                       v |= SYSC_ENAWAKEUP_MASK;
> > -                       v |= (SYSC_IDLEMODE_SMART <<
> > +                       dev->syscstate = SYSC_AUTOIDLE_MASK;
> > +                       dev->syscstate |= SYSC_ENAWAKEUP_MASK;
> > +                       dev->syscstate |= (SYSC_IDLEMODE_SMART <<
> >                               __ffs(SYSC_SIDLEMODE_MASK));
> > -                       v |= (SYSC_CLOCKACTIVITY_FCLK <<
> > +                       dev->syscstate |= (SYSC_CLOCKACTIVITY_FCLK <<
> >                               __ffs(SYSC_CLOCKACTIVITY_MASK));
> >
> > -                       omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, v);

The variable "v", holds the value to be written to OMAP_I2C_SYSC_REG. I compiled the code for omap_3430sdp_defconfig, and received no compiler warning.

-Jagadeesh

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

* RE: [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore
       [not found]   ` <20090202140525.GM8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
@ 2009-02-02 15:25     ` Pakaravoor, Jagadeesh
  0 siblings, 0 replies; 7+ messages in thread
From: Pakaravoor, Jagadeesh @ 2009-02-02 15:25 UTC (permalink / raw)
  To: Ben Dooks, Tony Lindgren
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jean Delvare

Ben,

> is this necessary for inclusion as a bugfix, or can it wait
> for a merge window?

This patch applies to Linux Omap tree only. It is a bug fix, and preferably taken ASAP. I'd like to incorporate your review comments, if you have any.

-Jagadeesh

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

end of thread, other threads:[~2009-02-02 15:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23  6:54 [PATCH] I2C: OMAP: Include OMAP_I2C_SYSC_REG in save and restore Pakaravoor, Jagadeesh
     [not found] ` <EAF47CD23C76F840A9E7FCE10091EFAB02A39CF069-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-01-23  7:21   ` Pakaravoor, Jagadeesh
2009-01-23  7:52     ` Jean Delvare
2009-02-02 13:08     ` Aaro Koskinen
     [not found]       ` <4986F037.3090604-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2009-02-02 15:22         ` Pakaravoor, Jagadeesh
2009-02-02 14:05 ` Ben Dooks
     [not found]   ` <20090202140525.GM8032-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-02-02 15:25     ` Pakaravoor, Jagadeesh

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