Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233574
b: refs/heads/master
c: adf6e07
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hilman authored and Ben Dooks committed Feb 22, 2011
1 parent 759f356 commit 35191f2
Show file tree
Hide file tree
Showing 2 changed files with 29 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: f10820e49585f281706ac07570a9e1652bdb5dd9
refs/heads/master: adf6e07922255937c8bfeea777d19502b4c9a2be
28 changes: 28 additions & 0 deletions trunk/drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,12 +1137,40 @@ omap_i2c_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_SUSPEND
static int omap_i2c_suspend(struct device *dev)
{
if (!pm_runtime_suspended(dev))
if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend)
dev->bus->pm->runtime_suspend(dev);

return 0;
}

static int omap_i2c_resume(struct device *dev)
{
if (!pm_runtime_suspended(dev))
if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume)
dev->bus->pm->runtime_resume(dev);

return 0;
}

static struct dev_pm_ops omap_i2c_pm_ops = {
.suspend = omap_i2c_suspend,
.resume = omap_i2c_resume,
};
#else
#define omap_i2c_pm_ops NULL
#endif

static struct platform_driver omap_i2c_driver = {
.probe = omap_i2c_probe,
.remove = omap_i2c_remove,
.driver = {
.name = "omap_i2c",
.owner = THIS_MODULE,
.pm = &omap_i2c_pm_ops,
},
};

Expand Down

0 comments on commit 35191f2

Please sign in to comment.