linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: eeti_ts - Convert to dev_pm_ops
@ 2011-01-05 19:06 Mark Brown
  2011-01-06  9:52 ` Sven Neumann
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-01-05 19:06 UTC (permalink / raw)
  To: Daniel Mack, Sven Neumann, Dmitry Torokhov; +Cc: linux-input, Mark Brown

There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the eeti_ts driver over.

Compile tested only.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/input/touchscreen/eeti_ts.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 7a3a916..1f0ef91 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -261,8 +261,9 @@ static int __devexit eeti_ts_remove(struct i2c_client *client)
 }
 
 #ifdef CONFIG_PM
-static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
+static int eeti_ts_suspend(struct device *dev)
 {
+	struct i2c_client *client = to_i2c_client(dev);
 	struct eeti_ts_priv *priv = i2c_get_clientdata(client);
 	struct input_dev *input_dev = priv->input;
 
@@ -279,8 +280,9 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
 	return 0;
 }
 
-static int eeti_ts_resume(struct i2c_client *client)
+static int eeti_ts_resume(struct device *dev)
 {
+	struct i2c_client *client = to_i2c_client(dev);
 	struct eeti_ts_priv *priv = i2c_get_clientdata(client);
 	struct input_dev *input_dev = priv->input;
 
@@ -296,9 +298,10 @@ static int eeti_ts_resume(struct i2c_client *client)
 
 	return 0;
 }
+
+static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);
 #else
-#define eeti_ts_suspend NULL
-#define eeti_ts_resume NULL
+#define eeti_ts_pm NULL
 #endif
 
 static const struct i2c_device_id eeti_ts_id[] = {
@@ -310,11 +313,10 @@ MODULE_DEVICE_TABLE(i2c, eeti_ts_id);
 static struct i2c_driver eeti_ts_driver = {
 	.driver = {
 		.name = "eeti_ts",
+		.pm = &eeti_ts_pm,
 	},
 	.probe = eeti_ts_probe,
 	.remove = __devexit_p(eeti_ts_remove),
-	.suspend = eeti_ts_suspend,
-	.resume = eeti_ts_resume,
 	.id_table = eeti_ts_id,
 };
 
-- 
1.7.2.3


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

* Re: [PATCH] Input: eeti_ts - Convert to dev_pm_ops
  2011-01-05 19:06 [PATCH] Input: eeti_ts - Convert to dev_pm_ops Mark Brown
@ 2011-01-06  9:52 ` Sven Neumann
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Neumann @ 2011-01-06  9:52 UTC (permalink / raw)
  To: Mark Brown; +Cc: Daniel Mack, Dmitry Torokhov, linux-input

On Wed, 2011-01-05 at 19:06 +0000, Mark Brown wrote:
> There is a general move towards the use of dev_pm_ops rather than
> bus specific suspend APIs as this simplifies both the bus and PM core
> implementations. Convert the eeti_ts driver over.
> 
> Compile tested only.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---

Tested-by: Sven Neumann <s.neumann@raumfeld.com>

>  drivers/input/touchscreen/eeti_ts.c |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
> index 7a3a916..1f0ef91 100644
> --- a/drivers/input/touchscreen/eeti_ts.c
> +++ b/drivers/input/touchscreen/eeti_ts.c
> @@ -261,8 +261,9 @@ static int __devexit eeti_ts_remove(struct i2c_client *client)
>  }
>  
>  #ifdef CONFIG_PM
> -static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
> +static int eeti_ts_suspend(struct device *dev)
>  {
> +	struct i2c_client *client = to_i2c_client(dev);
>  	struct eeti_ts_priv *priv = i2c_get_clientdata(client);
>  	struct input_dev *input_dev = priv->input;
>  
> @@ -279,8 +280,9 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg)
>  	return 0;
>  }
>  
> -static int eeti_ts_resume(struct i2c_client *client)
> +static int eeti_ts_resume(struct device *dev)
>  {
> +	struct i2c_client *client = to_i2c_client(dev);
>  	struct eeti_ts_priv *priv = i2c_get_clientdata(client);
>  	struct input_dev *input_dev = priv->input;
>  
> @@ -296,9 +298,10 @@ static int eeti_ts_resume(struct i2c_client *client)
>  
>  	return 0;
>  }
> +
> +static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);
>  #else
> -#define eeti_ts_suspend NULL
> -#define eeti_ts_resume NULL
> +#define eeti_ts_pm NULL
>  #endif
>  
>  static const struct i2c_device_id eeti_ts_id[] = {
> @@ -310,11 +313,10 @@ MODULE_DEVICE_TABLE(i2c, eeti_ts_id);
>  static struct i2c_driver eeti_ts_driver = {
>  	.driver = {
>  		.name = "eeti_ts",
> +		.pm = &eeti_ts_pm,
>  	},
>  	.probe = eeti_ts_probe,
>  	.remove = __devexit_p(eeti_ts_remove),
> -	.suspend = eeti_ts_suspend,
> -	.resume = eeti_ts_resume,
>  	.id_table = eeti_ts_id,
>  };
>  



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

end of thread, other threads:[~2011-01-06 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 19:06 [PATCH] Input: eeti_ts - Convert to dev_pm_ops Mark Brown
2011-01-06  9:52 ` Sven Neumann

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).