Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308702
b: refs/heads/master
c: 7e82d6f
h: refs/heads/master
v: v3
  • Loading branch information
Rabin Vincent authored and Samuel Ortiz committed May 1, 2012
1 parent 9467229 commit 238da46
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 44f72e53382c9c673fd54c3bab67a6b9a2d4526e
refs/heads/master: 7e82d6ff5d2c5e35d1fcb8c673287f7d780a13bb
32 changes: 32 additions & 0 deletions trunk/drivers/mfd/ab8500-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,42 @@ static const struct platform_device_id ab8500_id[] = {
{ }
};

#ifdef CONFIG_PM
static int ab8500_i2c_suspend(struct device *dev)
{
struct ab8500 *ab = dev_get_drvdata(dev);

disable_irq(ab->irq);
enable_irq_wake(ab->irq);

return 0;
}

static int ab8500_i2c_resume(struct device *dev)
{
struct ab8500 *ab = dev_get_drvdata(dev);

disable_irq_wake(ab->irq);
enable_irq(ab->irq);

return 0;
}

static const struct dev_pm_ops ab8500_i2c_pm_ops = {
.suspend = ab8500_i2c_suspend,
.resume = ab8500_i2c_resume,
};

#define AB8500_I2C_PM_OPS (&ab8500_i2c_pm_ops)
#else
#define AB8500_I2C_PM_OPS NULL
#endif

static struct platform_driver ab8500_i2c_driver = {
.driver = {
.name = "ab8500-i2c",
.owner = THIS_MODULE,
.pm = AB8500_I2C_PM_OPS,
},
.probe = ab8500_i2c_probe,
.remove = __devexit_p(ab8500_i2c_remove),
Expand Down

0 comments on commit 238da46

Please sign in to comment.