diff options
Diffstat (limited to 'drivers/mfd/stmpe.c')
-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, |