linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops
@ 2011-02-11 15:13 Mark Brown
  2011-02-11 15:13 ` [PATCH 2/2] Input: ad714x-spi " Mark Brown
  2011-02-11 15:15 ` [PATCH 1/2] Input: ad714x-i2c " Michael Hennerich
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2011-02-11 15:13 UTC (permalink / raw)
  To: Bryan Wu, Michael Hennerich, Mike Frysinger, Dmitry Torokhov
  Cc: linux-input, Mark Brown

There is a general move to convert drivers to use dev_pm_ops rather than
bus specific PM operations in order to facilitate core work. Do this
conversion for ad714x-i2c.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/misc/ad714x-i2c.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
index 2bef8fa..e21deb1 100644
--- a/drivers/input/misc/ad714x-i2c.c
+++ b/drivers/input/misc/ad714x-i2c.c
@@ -10,23 +10,23 @@
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/pm.h>
 #include "ad714x.h"
 
 #ifdef CONFIG_PM
-static int ad714x_i2c_suspend(struct i2c_client *client, pm_message_t message)
+static int ad714x_i2c_suspend(struct device *dev)
 {
-	return ad714x_disable(i2c_get_clientdata(client));
+	return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
 }
 
-static int ad714x_i2c_resume(struct i2c_client *client)
+static int ad714x_i2c_resume(struct device *dev)
 {
-	return ad714x_enable(i2c_get_clientdata(client));
+	return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev)));
 }
-#else
-# define ad714x_i2c_suspend NULL
-# define ad714x_i2c_resume  NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume);
+
 static int ad714x_i2c_write(struct device *dev, unsigned short reg,
 				unsigned short data)
 {
@@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id);
 static struct i2c_driver ad714x_i2c_driver = {
 	.driver = {
 		.name = "ad714x_captouch",
+		.pm   = &ad714x_i2c_pm,
 	},
 	.probe    = ad714x_i2c_probe,
 	.remove   = __devexit_p(ad714x_i2c_remove),
-	.suspend  = ad714x_i2c_suspend,
-	.resume	  = ad714x_i2c_resume,
 	.id_table = ad714x_id,
 };
 
-- 
1.7.2.3


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

* [PATCH 2/2] Input: ad714x-spi - Convert to dev_pm_ops
  2011-02-11 15:13 [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops Mark Brown
@ 2011-02-11 15:13 ` Mark Brown
  2011-02-11 15:14   ` Michael Hennerich
  2011-02-11 15:15 ` [PATCH 1/2] Input: ad714x-i2c " Michael Hennerich
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2011-02-11 15:13 UTC (permalink / raw)
  To: Bryan Wu, Michael Hennerich, Mike Frysinger, Dmitry Torokhov
  Cc: linux-input, Mark Brown

There is a general move to convert drivers to use dev_pm_ops rather than
bus specific PM operations in order to facilitate core work. Do this
conversion for ad714x-spi.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/misc/ad714x-spi.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
index 7f8dedf..4120dd5 100644
--- a/drivers/input/misc/ad714x-spi.c
+++ b/drivers/input/misc/ad714x-spi.c
@@ -9,6 +9,7 @@
 #include <linux/input.h>	/* BUS_I2C */
 #include <linux/module.h>
 #include <linux/spi/spi.h>
+#include <linux/pm.h>
 #include <linux/types.h>
 #include "ad714x.h"
 
@@ -16,20 +17,19 @@
 #define AD714x_SPI_READ            BIT(10)
 
 #ifdef CONFIG_PM
-static int ad714x_spi_suspend(struct spi_device *spi, pm_message_t message)
+static int ad714x_spi_suspend(struct device *dev)
 {
-	return ad714x_disable(spi_get_drvdata(spi));
+	return ad714x_disable(spi_get_drvdata(to_spi_device(dev)));
 }
 
-static int ad714x_spi_resume(struct spi_device *spi)
+static int ad714x_spi_resume(struct device *dev)
 {
-	return ad714x_enable(spi_get_drvdata(spi));
+	return ad714x_enable(spi_get_drvdata(to_spi_device(dev)));
 }
-#else
-# define ad714x_spi_suspend NULL
-# define ad714x_spi_resume  NULL
 #endif
 
+static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume);
+
 static int ad714x_spi_read(struct device *dev, unsigned short reg,
 		unsigned short *data)
 {
@@ -79,11 +79,10 @@ static struct spi_driver ad714x_spi_driver = {
 	.driver = {
 		.name	= "ad714x_captouch",
 		.owner	= THIS_MODULE,
+		.pm	= &ad714x_spi_pm,
 	},
 	.probe		= ad714x_spi_probe,
 	.remove		= __devexit_p(ad714x_spi_remove),
-	.suspend	= ad714x_spi_suspend,
-	.resume		= ad714x_spi_resume,
 };
 
 static __init int ad714x_spi_init(void)
-- 
1.7.2.3


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

* Re: [PATCH 2/2] Input: ad714x-spi - Convert to dev_pm_ops
  2011-02-11 15:13 ` [PATCH 2/2] Input: ad714x-spi " Mark Brown
@ 2011-02-11 15:14   ` Michael Hennerich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Hennerich @ 2011-02-11 15:14 UTC (permalink / raw)
  To: Mark Brown
  Cc: Bryan Wu, Mike Frysinger, Dmitry Torokhov,
	linux-input@vger.kernel.org

On 02/11/2011 04:13 PM, Mark Brown wrote:
> There is a general move to convert drivers to use dev_pm_ops rather than
> bus specific PM operations in order to facilitate core work. Do this
> conversion for ad714x-spi.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>   
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
>  drivers/input/misc/ad714x-spi.c |   17 ++++++++---------
>  1 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
> index 7f8dedf..4120dd5 100644
> --- a/drivers/input/misc/ad714x-spi.c
> +++ b/drivers/input/misc/ad714x-spi.c
> @@ -9,6 +9,7 @@
>  #include <linux/input.h>	/* BUS_I2C */
>  #include <linux/module.h>
>  #include <linux/spi/spi.h>
> +#include <linux/pm.h>
>  #include <linux/types.h>
>  #include "ad714x.h"
>  
> @@ -16,20 +17,19 @@
>  #define AD714x_SPI_READ            BIT(10)
>  
>  #ifdef CONFIG_PM
> -static int ad714x_spi_suspend(struct spi_device *spi, pm_message_t message)
> +static int ad714x_spi_suspend(struct device *dev)
>  {
> -	return ad714x_disable(spi_get_drvdata(spi));
> +	return ad714x_disable(spi_get_drvdata(to_spi_device(dev)));
>  }
>  
> -static int ad714x_spi_resume(struct spi_device *spi)
> +static int ad714x_spi_resume(struct device *dev)
>  {
> -	return ad714x_enable(spi_get_drvdata(spi));
> +	return ad714x_enable(spi_get_drvdata(to_spi_device(dev)));
>  }
> -#else
> -# define ad714x_spi_suspend NULL
> -# define ad714x_spi_resume  NULL
>  #endif
>  
> +static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume);
> +
>  static int ad714x_spi_read(struct device *dev, unsigned short reg,
>  		unsigned short *data)
>  {
> @@ -79,11 +79,10 @@ static struct spi_driver ad714x_spi_driver = {
>  	.driver = {
>  		.name	= "ad714x_captouch",
>  		.owner	= THIS_MODULE,
> +		.pm	= &ad714x_spi_pm,
>  	},
>  	.probe		= ad714x_spi_probe,
>  	.remove		= __devexit_p(ad714x_spi_remove),
> -	.suspend	= ad714x_spi_suspend,
> -	.resume		= ad714x_spi_resume,
>  };
>  
>  static __init int ad714x_spi_init(void)
>   


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif


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

* Re: [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops
  2011-02-11 15:13 [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops Mark Brown
  2011-02-11 15:13 ` [PATCH 2/2] Input: ad714x-spi " Mark Brown
@ 2011-02-11 15:15 ` Michael Hennerich
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Hennerich @ 2011-02-11 15:15 UTC (permalink / raw)
  To: Mark Brown
  Cc: Bryan Wu, Mike Frysinger, Dmitry Torokhov,
	linux-input@vger.kernel.org,
	device-drivers-devel@blackfin.uclinux.org

On 02/11/2011 04:13 PM, Mark Brown wrote:
> There is a general move to convert drivers to use dev_pm_ops rather than
> bus specific PM operations in order to facilitate core work. Do this
> conversion for ad714x-i2c.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>   
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
>  drivers/input/misc/ad714x-i2c.c |   17 ++++++++---------
>  1 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
> index 2bef8fa..e21deb1 100644
> --- a/drivers/input/misc/ad714x-i2c.c
> +++ b/drivers/input/misc/ad714x-i2c.c
> @@ -10,23 +10,23 @@
>  #include <linux/i2c.h>
>  #include <linux/module.h>
>  #include <linux/types.h>
> +#include <linux/pm.h>
>  #include "ad714x.h"
>  
>  #ifdef CONFIG_PM
> -static int ad714x_i2c_suspend(struct i2c_client *client, pm_message_t message)
> +static int ad714x_i2c_suspend(struct device *dev)
>  {
> -	return ad714x_disable(i2c_get_clientdata(client));
> +	return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
>  }
>  
> -static int ad714x_i2c_resume(struct i2c_client *client)
> +static int ad714x_i2c_resume(struct device *dev)
>  {
> -	return ad714x_enable(i2c_get_clientdata(client));
> +	return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev)));
>  }
> -#else
> -# define ad714x_i2c_suspend NULL
> -# define ad714x_i2c_resume  NULL
>  #endif
>  
> +static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume);
> +
>  static int ad714x_i2c_write(struct device *dev, unsigned short reg,
>  				unsigned short data)
>  {
> @@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id);
>  static struct i2c_driver ad714x_i2c_driver = {
>  	.driver = {
>  		.name = "ad714x_captouch",
> +		.pm   = &ad714x_i2c_pm,
>  	},
>  	.probe    = ad714x_i2c_probe,
>  	.remove   = __devexit_p(ad714x_i2c_remove),
> -	.suspend  = ad714x_i2c_suspend,
> -	.resume	  = ad714x_i2c_resume,
>  	.id_table = ad714x_id,
>  };
>  
>   


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif


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

end of thread, other threads:[~2011-02-11 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 15:13 [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops Mark Brown
2011-02-11 15:13 ` [PATCH 2/2] Input: ad714x-spi " Mark Brown
2011-02-11 15:14   ` Michael Hennerich
2011-02-11 15:15 ` [PATCH 1/2] Input: ad714x-i2c " Michael Hennerich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).