aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSundar Iyer <sundar.iyer@stericsson.com>2010-09-15 01:00:54 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2010-10-28 18:29:34 -0400
commit208c4343192c052048ddf096d8e189162e5ee219 (patch)
tree9473aab77f78e0511657881f5199d22788c8167a /drivers/mfd
parent02bf07492341d94e29890082201dd69dbf406570 (diff)
mfd: Add PM support to STMPE devices
Add PM helpers to STMPE and add support to enable wakeup from low power states Acked-by: Rabin VINCENT <rabin.vincent@stericsson.com> Acked-by: Linus WALLEIJ <linus.walleij@stericsson.com> Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/stmpe.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 0754c5e91995..b11487f1e1cb 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -873,6 +873,28 @@ static int __devinit stmpe_devices_init(struct stmpe *stmpe)
873 return ret; 873 return ret;
874} 874}
875 875
876#ifdef CONFIG_PM
877static int stmpe_suspend(struct device *dev)
878{
879 struct i2c_client *i2c = to_i2c_client(dev);
880
881 if (device_may_wakeup(&i2c->dev))
882 enable_irq_wake(i2c->irq);
883
884 return 0;
885}
886
887static int stmpe_resume(struct device *dev)
888{
889 struct i2c_client *i2c = to_i2c_client(dev);
890
891 if (device_may_wakeup(&i2c->dev))
892 disable_irq_wake(i2c->irq);
893
894 return 0;
895}
896#endif
897
876static int __devinit stmpe_probe(struct i2c_client *i2c, 898static int __devinit stmpe_probe(struct i2c_client *i2c,
877 const struct i2c_device_id *id) 899 const struct i2c_device_id *id)
878{ 900{
@@ -960,9 +982,19 @@ static const struct i2c_device_id stmpe_id[] = {
960}; 982};
961MODULE_DEVICE_TABLE(i2c, stmpe_id); 983MODULE_DEVICE_TABLE(i2c, stmpe_id);
962 984
985#ifdef CONFIG_PM
986static const struct dev_pm_ops stmpe_dev_pm_ops = {
987 .suspend = stmpe_suspend,
988 .resume = stmpe_resume,
989};
990#endif
991
963static struct i2c_driver stmpe_driver = { 992static struct i2c_driver stmpe_driver = {
964 .driver.name = "stmpe", 993 .driver.name = "stmpe",
965 .driver.owner = THIS_MODULE, 994 .driver.owner = THIS_MODULE,
995#ifdef CONFIG_PM
996 .driver.pm = &stmpe_dev_pm_ops,
997#endif
966 .probe = stmpe_probe, 998 .probe = stmpe_probe,
967 .remove = __devexit_p(stmpe_remove), 999 .remove = __devexit_p(stmpe_remove),
968 .id_table = stmpe_id, 1000 .id_table = stmpe_id,