Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220604
b: refs/heads/master
c: 208c434
h: refs/heads/master
v: v3
  • Loading branch information
Sundar Iyer authored and Samuel Ortiz committed Oct 28, 2010
1 parent 5fed047 commit 97d2408
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: 02bf07492341d94e29890082201dd69dbf406570
refs/heads/master: 208c4343192c052048ddf096d8e189162e5ee219
32 changes: 32 additions & 0 deletions trunk/drivers/mfd/stmpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,28 @@ static int __devinit stmpe_devices_init(struct stmpe *stmpe)
return ret;
}

#ifdef CONFIG_PM
static int stmpe_suspend(struct device *dev)
{
struct i2c_client *i2c = to_i2c_client(dev);

if (device_may_wakeup(&i2c->dev))
enable_irq_wake(i2c->irq);

return 0;
}

static int stmpe_resume(struct device *dev)
{
struct i2c_client *i2c = to_i2c_client(dev);

if (device_may_wakeup(&i2c->dev))
disable_irq_wake(i2c->irq);

return 0;
}
#endif

static int __devinit stmpe_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -960,9 +982,19 @@ static const struct i2c_device_id stmpe_id[] = {
};
MODULE_DEVICE_TABLE(i2c, stmpe_id);

#ifdef CONFIG_PM
static const struct dev_pm_ops stmpe_dev_pm_ops = {
.suspend = stmpe_suspend,
.resume = stmpe_resume,
};
#endif

static struct i2c_driver stmpe_driver = {
.driver.name = "stmpe",
.driver.owner = THIS_MODULE,
#ifdef CONFIG_PM
.driver.pm = &stmpe_dev_pm_ops,
#endif
.probe = stmpe_probe,
.remove = __devexit_p(stmpe_remove),
.id_table = stmpe_id,
Expand Down

0 comments on commit 97d2408

Please sign in to comment.