All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Mike Rapoport <mike@compulab.co.il>,
	Dmitry Torokhov <dtor@mail.ru>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: synaptics_i2c - Convert to dev_pm_ops
Date: Mon, 14 Feb 2011 11:31:22 +0200	[thread overview]
Message-ID: <4D58F66A.8000705@compulab.co.il> (raw)
In-Reply-To: <1297438904-27430-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On 02/11/11 17:41, Mark Brown wrote:

> There is a general move to convert drivers to dev_pm_ops rather than bus
> specific PM ops in order to facilitate core development. Do this converison
> for synaptics-i2c.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
>  drivers/input/mouse/synaptics_i2c.c |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
> index 0ae62f0..f6aa26d 100644
> --- a/drivers/input/mouse/synaptics_i2c.c
> +++ b/drivers/input/mouse/synaptics_i2c.c
> @@ -18,6 +18,7 @@
>  #include <linux/delay.h>
>  #include <linux/workqueue.h>
>  #include <linux/slab.h>
> +#include <linux/pm.h>
>  
>  #define DRIVER_NAME		"synaptics_i2c"
>  /* maximum product id is 15 characters */
> @@ -619,8 +620,9 @@ static int __devexit synaptics_i2c_remove(struct i2c_client *client)
>  }
>  
>  #ifdef CONFIG_PM
> -static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
> +static int synaptics_i2c_suspend(struct device *dev)
>  {
> +	struct i2c_client *client = to_i2c_client(dev);
>  	struct synaptics_i2c *touch = i2c_get_clientdata(client);
>  
>  	cancel_delayed_work_sync(&touch->dwork);
> @@ -631,9 +633,10 @@ static int synaptics_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
>  	return 0;
>  }
>  
> -static int synaptics_i2c_resume(struct i2c_client *client)
> +static int synaptics_i2c_resume(struct device *dev)
>  {
>  	int ret;
> +	struct i2c_client *client = to_i2c_client(dev);
>  	struct synaptics_i2c *touch = i2c_get_clientdata(client);
>  
>  	ret = synaptics_i2c_reset_config(client);
> @@ -645,11 +648,11 @@ static int synaptics_i2c_resume(struct i2c_client *client)
>  
>  	return 0;
>  }
> -#else
> -#define synaptics_i2c_suspend	NULL
> -#define synaptics_i2c_resume	NULL
>  #endif
>  
> +static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
> +			 synaptics_i2c_resume);
> +
>  static const struct i2c_device_id synaptics_i2c_id_table[] = {
>  	{ "synaptics_i2c", 0 },
>  	{ },
> @@ -660,13 +663,12 @@ static struct i2c_driver synaptics_i2c_driver = {
>  	.driver = {
>  		.name	= DRIVER_NAME,
>  		.owner	= THIS_MODULE,
> +		.pm	= &synaptics_i2c_pm,
>  	},
>  
>  	.probe		= synaptics_i2c_probe,
>  	.remove		= __devexit_p(synaptics_i2c_remove),
>  
> -	.suspend	= synaptics_i2c_suspend,
> -	.resume		= synaptics_i2c_resume,
>  	.id_table	= synaptics_i2c_id_table,
>  };
>  

-- 
Regards,
Igor.


      reply	other threads:[~2011-02-14  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11 15:41 [PATCH] Input: synaptics_i2c - Convert to dev_pm_ops Mark Brown
2011-02-14  9:31 ` Igor Grinberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D58F66A.8000705@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=mike@compulab.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.