All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Benson Leung <bleung@chromium.org>
Cc: cbouatmailru@gmail.com, rklein@nvidia.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] gpio-charger: Add gpio_charger_resume
Date: Thu, 07 Apr 2011 02:15:35 +0200	[thread overview]
Message-ID: <4D9D0227.3000807@metafoo.de> (raw)
In-Reply-To: <1302134120-29589-1-git-send-email-bleung@chromium.org>

On 04/07/2011 01:55 AM, Benson Leung wrote:
> Gpio charger should notify if the gpio state had changed
> during suspend. This will send a CHANGED event each time
> the system resumes, ensuring a plug/unplug of the charger
> is not missed.
> 
> Signed-off-by: Benson Leung <bleung@chromium.org>
Acked-By: Lars-Peter Clausen <lars@metafoo.de>

> 
> --
> Version history :
> v3 : Use SIMPLE_DEV_PM_OPS
> v2 : Changed to use dev_ms_ops
> v1 : Initial
> ---
>  drivers/power/gpio-charger.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
> index 25b88ac..718f2c5 100644
> --- a/drivers/power/gpio-charger.c
> +++ b/drivers/power/gpio-charger.c
> @@ -161,12 +161,27 @@ static int __devexit gpio_charger_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_PM_SLEEP
> +static int gpio_charger_resume(struct device *dev)
> +{
> +	struct platform_device *pdev = to_platform_device(dev);
> +	struct gpio_charger *gpio_charger = platform_get_drvdata(pdev);
> +
> +	power_supply_changed(&gpio_charger->charger);
> +
> +	return 0;
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(gpio_charger_pm_ops, NULL, gpio_charger_resume);
> +
>  static struct platform_driver gpio_charger_driver = {
>  	.probe = gpio_charger_probe,
>  	.remove = __devexit_p(gpio_charger_remove),
>  	.driver = {
>  		.name = "gpio-charger",
>  		.owner = THIS_MODULE,
> +		.pm = &gpio_charger_pm_ops,
>  	},
>  };
>  


  reply	other threads:[~2011-04-07  0:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-03  2:13 [PATCH v2] gpio-charger: Add gpio_charger_resume Benson Leung
2011-04-06  9:08 ` Benson Leung
2011-04-06 14:40   ` Lars-Peter Clausen
2011-04-06 20:58     ` Benson Leung
2011-04-06 23:55 ` [PATCH v3] " Benson Leung
2011-04-07  0:15   ` Lars-Peter Clausen [this message]
2011-04-12  4:19     ` Benson Leung
2011-04-20 17:25       ` Anton Vorontsov

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=4D9D0227.3000807@metafoo.de \
    --to=lars@metafoo.de \
    --cc=bleung@chromium.org \
    --cc=cbouatmailru@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rklein@nvidia.com \
    /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.