aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorJett.Zhou <jtzhou@marvell.com>2012-02-27 09:44:20 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 12:46:49 -0500
commit2853378b6eafd8b9e2f0e39ab599c93ce518b04d (patch)
tree2e92700fe3714e3b919cbd920709fcbc4fb8aed8 /drivers/mfd
parentb8b8d7932bb83300d0ae6553e320ab1aecb37990 (diff)
mfd: Add ability to wake the system for 88pm860x
For 88pm860x pmic, it can wake the system from low power mode by irq, its sub-devs like RTC and onkey can be enabled for this usage. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/88pm860x-i2c.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c
index f93dd9571c3c..b2cfdc458561 100644
--- a/drivers/mfd/88pm860x-i2c.c
+++ b/drivers/mfd/88pm860x-i2c.c
@@ -334,10 +334,35 @@ static int __devexit pm860x_remove(struct i2c_client *client)
334 return 0; 334 return 0;
335} 335}
336 336
337#ifdef CONFIG_PM_SLEEP
338static int pm860x_suspend(struct device *dev)
339{
340 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
341 struct pm860x_chip *chip = i2c_get_clientdata(client);
342
343 if (device_may_wakeup(dev) && chip->wakeup_flag)
344 enable_irq_wake(chip->core_irq);
345 return 0;
346}
347
348static int pm860x_resume(struct device *dev)
349{
350 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
351 struct pm860x_chip *chip = i2c_get_clientdata(client);
352
353 if (device_may_wakeup(dev) && chip->wakeup_flag)
354 disable_irq_wake(chip->core_irq);
355 return 0;
356}
357#endif
358
359static SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
360
337static struct i2c_driver pm860x_driver = { 361static struct i2c_driver pm860x_driver = {
338 .driver = { 362 .driver = {
339 .name = "88PM860x", 363 .name = "88PM860x",
340 .owner = THIS_MODULE, 364 .owner = THIS_MODULE,
365 .pm = &pm860x_pm_ops,
341 }, 366 },
342 .probe = pm860x_probe, 367 .probe = pm860x_probe,
343 .remove = __devexit_p(pm860x_remove), 368 .remove = __devexit_p(pm860x_remove),