Date:2011-04-07 01:55:20 (11 years 5 months ago)
Author:Benson Leung
Commit:8e7191d88a3b11a55ad52fbee95261d4ca07f610
Message:gpio-charger: Add gpio_charger_resume

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>

--
Version history :
v3 : Use SIMPLE_DEV_PM_OPS
v2 : Changed to use dev_ms_ops
v1 : Initial
Files: drivers/power/gpio-charger.c (1 diff)

Change Details

drivers/power/gpio-charger.c
161161    return 0;
162162}
163163
164#ifdef CONFIG_PM_SLEEP
165static int gpio_charger_resume(struct device *dev)
166{
167    struct platform_device *pdev = to_platform_device(dev);
168    struct gpio_charger *gpio_charger = platform_get_drvdata(pdev);
169
170    power_supply_changed(&gpio_charger->charger);
171
172    return 0;
173}
174#endif
175
176static SIMPLE_DEV_PM_OPS(gpio_charger_pm_ops, NULL, gpio_charger_resume);
177
164178static struct platform_driver gpio_charger_driver = {
165179    .probe = gpio_charger_probe,
166180    .remove = __devexit_p(gpio_charger_remove),
167181    .driver = {
168182        .name = "gpio-charger",
169183        .owner = THIS_MODULE,
184        .pm = &gpio_charger_pm_ops,
170185    },
171186};
172187

Archive Download the corresponding diff file



interactive