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>
Tue, 24 Nov 2015 22:53:42 +0000 (14:53 -0800)
commit6b85505fba68ceaf061fcc7a951e16d19339c00e
treef1235c645b99fef6486ffd318e7e852f0f7f223a
parent2c76701874b4a22b9f73f7a7399a96b83208faf0
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 1702947

Change-Id: I732909ebffc139cce6ed92b2388284dbf817c7e2
Signed-off-by: David Pu <dpu@nvidia.com>
Reviewed-on: http://git-master/r/834216
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Todd Poynter <tpoynter@nvidia.com>
drivers/input/touchscreen/lr388k7_ts.c