diff options
author | Bo Kim <bok@nvidia.com> | 2013-08-30 17:41:04 +0900 |
---|---|---|
committer | Gabby Lee <galee@nvidia.com> | 2013-09-02 06:43:31 -0700 |
commit | 87de1d533241169695c552e837f024208d98c670 (patch) | |
tree | ebb54a6563b88846b734379e85c3c29f2b41a524 /drivers | |
parent | 9c8338e70cddd6c4518f75944d20611c90e33ad5 (diff) |
input: touch: maxim_sti: Shutdown safely
Current shutdown implementation seems to be unsafe. Sometimes it can be
locked up due to interrupt from the chip but the interrupt cannot be
processed and cleared.
Bug 1349939
Bug 1359386
Change-Id: I585c03c2398eb9ab94563d5fe379bbafad7dc03c
Signed-off-by: Bo Kim <bok@nvidia.com>
Reviewed-on: http://git-master/r/268420
Reviewed-by: Gabby Lee <galee@nvidia.com>
Tested-by: Gabby Lee <galee@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/touchscreen/maxim_sti.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/maxim_sti.c b/drivers/input/touchscreen/maxim_sti.c index 8653c4ea4ad8..1d934f7acdde 100644 --- a/drivers/input/touchscreen/maxim_sti.c +++ b/drivers/input/touchscreen/maxim_sti.c @@ -1778,6 +1778,11 @@ static int remove(struct spi_device *spi) unsigned long flags; u8 i; + INFO("removing...\n"); + + if (dd->irq_registered) + disable_irq(dd->spi->irq); + if (dd->fusion_process != (pid_t)0) (void)kill_pid(find_get_pid(dd->fusion_process), SIGKILL, 1); @@ -1825,6 +1830,19 @@ static void shutdown(struct spi_device *spi) struct maxim_sti_pdata *pdata = spi->dev.platform_data; struct dev_data *dd = spi_get_drvdata(spi); + INFO("doing shutdown...\n"); + + if (dd->irq_registered) + disable_irq(dd->spi->irq); + + if (dd->fusion_process != (pid_t)0) + (void)kill_pid(find_get_pid(dd->fusion_process), SIGKILL, 1); + + dd->nl_enabled = false; + (void)kthread_stop(dd->thread); + + stop_scan_canned(dd); + pdata->reset(pdata, 0); usleep_range(100, 120); regulator_control(dd, false); |