input: touch: sharp:fix unbalanced irq disable.
authorDavid Pu <dpu@nvidia.com>
Tue, 17 Nov 2015 23:12:34 +0000 (15:12 -0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 3 Dec 2015 04:41:44 +0000 (20:41 -0800)
commit2a39fe00de14d3567013e4f04c28d50eacbdbb81
tree0e00497979c10d833b289a4dc12ad1e311b9e439
parentbb8ac409d87be9ae92210a6c55a9e10ecd254f24
input: touch: sharp:fix unbalanced irq disable.

it is not multi-process safe when accessing touch driver sysfs
/sys/class/misc/touch/wakeup_enable and
/sys/class/input/input0/enabled at same time.
it leads to wakeup_enable flag inconsistent state during changing
waekup_enable and enabled node at sametime. In such case disable_irq
would be called twice and it will never comes back to balanced
state(changing between irq depth between -1 and 0 instead of 0 and 1).

This change keeps irq always enabled after touch input is enabled.
Also move enable/disable irq wake to system suspend/resume routine to
keep it always balanced.

Bug 1709007
Bug 1702947

Change-Id: I732909ebffc139cce6ed92b2388284dbf817c7e2
Signed-off-by: David Pu <dpu@nvidia.com>
Reviewed-on: http://git-master/r/834216
(cherry picked from commit 6b85505fba68ceaf061fcc7a951e16d19339c00e)
Reviewed-on: http://git-master/r/837259
Reviewed-by: Todd Poynter <tpoynter@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
drivers/input/touchscreen/lr388k7_ts.c