diff options
author | Sundar Iyer <sundar.iyer@stericsson.com> | 2010-09-15 01:00:54 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-28 18:29:34 -0400 |
commit | 208c4343192c052048ddf096d8e189162e5ee219 (patch) | |
tree | 9473aab77f78e0511657881f5199d22788c8167a /drivers/mfd | |
parent | 02bf07492341d94e29890082201dd69dbf406570 (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.c | 32 |
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 | ||
877 | static 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 | |||
887 | static 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 | |||
876 | static int __devinit stmpe_probe(struct i2c_client *i2c, | 898 | static 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 | }; |
961 | MODULE_DEVICE_TABLE(i2c, stmpe_id); | 983 | MODULE_DEVICE_TABLE(i2c, stmpe_id); |
962 | 984 | ||
985 | #ifdef CONFIG_PM | ||
986 | static const struct dev_pm_ops stmpe_dev_pm_ops = { | ||
987 | .suspend = stmpe_suspend, | ||
988 | .resume = stmpe_resume, | ||
989 | }; | ||
990 | #endif | ||
991 | |||
963 | static struct i2c_driver stmpe_driver = { | 992 | static 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, |