summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRobert Collins <rcollins@nvidia.com>2011-06-27 16:33:01 -0700
committerJeremy Wyman <jwyman@nvidia.com>2011-06-29 21:27:36 -0700
commitcc9652dc5a7564a5c9d897b1fc18cda8f3affd42 (patch)
tree69780d74373d8a65bd9d12edc1913cd2b8c851c1 /drivers
parent9170c550dc5630eebed72ef74ec2b6740d107b9f (diff)
input: touch: atmel_mxt_ts: Prevent double suspend/resume.
In the case where early suspend/resume is enabled, prevent suspend/resume from being called twice. Removing the default suspend/resume handlers while early suspend/resume is enabled prevents the double suspend/resume from occurring. BUG 843934 Change-Id: Ic3c740e4b84a7b6bb99793d0794d7def216687be Reviewed-on: http://git-master/r/39035 Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Chih-Lung Huang <lhuang@nvidia.com> Reviewed-by: Jeremy Wyman <jwyman@nvidia.com> Tested-by: Jeremy Wyman <jwyman@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/atmel_maxtouch.c3
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/atmel_maxtouch.c b/drivers/input/touchscreen/atmel_maxtouch.c
index 06372a5f4c61..4718ff65ae27 100644
--- a/drivers/input/touchscreen/atmel_maxtouch.c
+++ b/drivers/input/touchscreen/atmel_maxtouch.c
@@ -2098,9 +2098,10 @@ static struct i2c_driver mxt_driver = {
.id_table = mxt_idtable,
.probe = mxt_probe,
.remove = __devexit_p(mxt_remove),
+#if !defined(CONFIG_HAS_EARLYSUSPEND)
.suspend = mxt_suspend,
.resume = mxt_resume,
-
+#endif
};
static int __init mxt_init(void)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 33d49f8aacaf..a4eab12978a6 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1389,13 +1389,13 @@ static void mxt_early_resume(struct early_suspend *es)
dev_err(&mxt->client->dev, "%s: failed\n", __func__);
dev_info(dev, "MXT Early Resumed\n");
}
-#endif
-
+#else
static const struct dev_pm_ops mxt_pm_ops = {
.suspend = mxt_suspend,
.resume = mxt_resume,
};
#endif
+#endif
static const struct i2c_device_id mxt_id[] = {
{ "qt602240_ts", 0 },
@@ -1409,7 +1409,7 @@ static struct i2c_driver mxt_driver = {
.driver = {
.name = "atmel_mxt_ts",
.owner = THIS_MODULE,
-#ifdef CONFIG_PM
+#if !defined(CONFIG_HAS_EARLYSUSPEND)
.pm = &mxt_pm_ops,
#endif
},