diff mbox

[PM] OMAP3: PM: Save and restore I2C wakeup sources

Message ID 1237988300-25985-1-git-send-email-aaro.koskinen@nokia.com (mailing list archive)
State Accepted
Delegated to: Kevin Hilman
Headers show

Commit Message

Koskinen, Aaro (Nokia - FI/Espoo) March 25, 2009, 1:38 p.m. UTC
Save and restore I2C wakeup sources.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 drivers/i2c/busses/i2c-omap.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Comments

Kevin Hilman March 25, 2009, 5:50 p.m. UTC | #1
Aaro Koskinen <aaro.koskinen@nokia.com> writes:

> Save and restore I2C wakeup sources.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Thanks, pushing to PM branch.

Kevin

> ---
>  drivers/i2c/busses/i2c-omap.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 50f3285..5ce055c 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -183,6 +183,7 @@ struct omap_i2c_dev {
>  	u16			sclhstate;
>  	u16			bufstate;
>  	u16			syscstate;
> +	u16			westate;
>  };
>  
>  static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
> @@ -242,6 +243,7 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
>  		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);
> +		omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
>  	}
>  	dev->idle = 0;
>  	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
> @@ -316,8 +318,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
>  			 * WFI instruction.
>  			 * REVISIT: Some wkup sources might not be needed.
>  			 */
> -			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG,
> -							OMAP_I2C_WE_ALL);
> +			dev->westate = OMAP_I2C_WE_ALL;
> +			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
>  
>  		}
>  	}
> -- 
> 1.5.4.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
--
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
Kevin Hilman April 20, 2009, 11:15 p.m. UTC | #2
Aaro Koskinen <aaro.koskinen@nokia.com> writes:

> Save and restore I2C wakeup sources.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Sorry for the delay, this one slipped through the cracks.
Pushing to PM branch.

Kevin

> ---
>  drivers/i2c/busses/i2c-omap.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 50f3285..5ce055c 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -183,6 +183,7 @@ struct omap_i2c_dev {
>  	u16			sclhstate;
>  	u16			bufstate;
>  	u16			syscstate;
> +	u16			westate;
>  };
>  
>  static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
> @@ -242,6 +243,7 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
>  		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);
> +		omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
>  	}
>  	dev->idle = 0;
>  	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
> @@ -316,8 +318,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
>  			 * WFI instruction.
>  			 * REVISIT: Some wkup sources might not be needed.
>  			 */
> -			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG,
> -							OMAP_I2C_WE_ALL);
> +			dev->westate = OMAP_I2C_WE_ALL;
> +			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
>  
>  		}
>  	}
> -- 
> 1.5.4.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
--
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
Kevin Hilman May 13, 2009, 2:54 p.m. UTC | #3
Aaro Koskinen <aaro.koskinen@nokia.com> writes:

> Save and restore I2C wakeup sources.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Thanks, pushing to PM branch.

Kevin

> ---
>  drivers/i2c/busses/i2c-omap.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 50f3285..5ce055c 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -183,6 +183,7 @@ struct omap_i2c_dev {
>  	u16			sclhstate;
>  	u16			bufstate;
>  	u16			syscstate;
> +	u16			westate;
>  };
>  
>  static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
> @@ -242,6 +243,7 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
>  		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);
> +		omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
>  	}
>  	dev->idle = 0;
>  	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
> @@ -316,8 +318,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
>  			 * WFI instruction.
>  			 * REVISIT: Some wkup sources might not be needed.
>  			 */
> -			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG,
> -							OMAP_I2C_WE_ALL);
> +			dev->westate = OMAP_I2C_WE_ALL;
> +			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
>  
>  		}
>  	}
> -- 
> 1.5.4.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
--
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
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 50f3285..5ce055c 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -183,6 +183,7 @@  struct omap_i2c_dev {
 	u16			sclhstate;
 	u16			bufstate;
 	u16			syscstate;
+	u16			westate;
 };
 
 static inline void omap_i2c_write_reg(struct omap_i2c_dev *i2c_dev,
@@ -242,6 +243,7 @@  static void omap_i2c_unidle(struct omap_i2c_dev *dev)
 		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);
+		omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
 	}
 	dev->idle = 0;
 	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
@@ -316,8 +318,8 @@  static int omap_i2c_init(struct omap_i2c_dev *dev)
 			 * WFI instruction.
 			 * REVISIT: Some wkup sources might not be needed.
 			 */
-			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG,
-							OMAP_I2C_WE_ALL);
+			dev->westate = OMAP_I2C_WE_ALL;
+			omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
 
 		}
 	}