diff options
Diffstat (limited to 'drivers/mfd/88pm860x-i2c.c')
-rw-r--r-- | drivers/mfd/88pm860x-i2c.c | 25 |
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 | ||
338 | static 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 | |||
348 | static 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 | |||
359 | static SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume); | ||
360 | |||
337 | static struct i2c_driver pm860x_driver = { | 361 | static 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), |