summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXiaohui Tao <xtao@nvidia.com>2013-08-28 17:18:01 -0700
committerGabby Lee <galee@nvidia.com>2013-09-01 19:03:04 -0700
commit9700803ce3d59714dbc50d425f77d9c0b986c9c9 (patch)
treed7690441e070bc167afac5ff8f7d4a0bd9de4a65 /drivers
parent1f8fa18c03f135d8d12116528971d71cb0d670c6 (diff)
input: touch: maxim: Refine power control
(1) Move regulator control from threaded func to probe func since the current machanism will kill the direct touch daemon and restart it when it is not responding. Keeping the regulator code there will make ref count go up, which will keep the power rail always on. (2) Do not call suspend/resume in display off case for touch. Touch suspend/resume should be consistent with display off/on. There is no need to turn touch on/off in display off case. Bug 1353325 Bug 1350928 Change-Id: Id9719f04398be0032faf2c9f685400b292458b06 Signed-off-by: Xiaohui Tao <xtao@nvidia.com> Reviewed-on: http://git-master/r/267625 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bo Kim <bok@nvidia.com> Tested-by: Bo Kim <bok@nvidia.com> Reviewed-by: Gabby Lee <galee@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/maxim_sti.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/maxim_sti.c b/drivers/input/touchscreen/maxim_sti.c
index 764bf4597fa3..1fea097f8992 100644
--- a/drivers/input/touchscreen/maxim_sti.c
+++ b/drivers/input/touchscreen/maxim_sti.c
@@ -1563,15 +1563,6 @@ static int processing_thread(void *arg)
if (ret != 0)
msleep(100);
} while (ret != 0 && !kthread_should_stop());
-
- /* power-up and reset-high */
- ret = regulator_control(dd, true);
- if (ret < 0)
- ERROR("failed to enable regulators");
-
- usleep_range(300, 400);
- pdata->reset(pdata, 1);
-
dd->start_fusion = false;
}
if (kthread_should_stop())
@@ -1696,6 +1687,13 @@ static int probe(struct spi_device *spi)
if (ret < 0)
goto platform_failure;
+ /* power-up and reset-high */
+ ret = regulator_control(dd, true);
+ if (ret < 0)
+ goto platform_failure;
+ usleep_range(300, 400);
+ pdata->reset(pdata, 1);
+
/* start processing thread */
dd->thread_sched.sched_priority = MAX_USER_RT_PRIO / 2;
dd->thread = kthread_run(processing_thread, dd, pdata->nl_family);
@@ -1852,7 +1850,7 @@ static struct spi_driver driver = {
.driver = {
.name = MAXIM_STI_NAME,
.owner = THIS_MODULE,
-#ifdef CONFIG_PM_SLEEP
+#if defined(CONFIG_PM_SLEEP) && !INPUT_ENABLE_DISABLE
.pm = &pm_ops,
#endif
},