CHROMIUM: Input: atmel_mxt_ts - release all fingers on resume
authorYufeng Shen <miletus@chromium.org>
Tue, 9 Oct 2012 20:51:52 +0000 (16:51 -0400)
committerGerrit <chrome-bot@google.com>
Wed, 10 Oct 2012 18:09:03 +0000 (11:09 -0700)
commit1e9ee2c39d4f6887c2a8fc2641410a744d55ad03
tree2064cf59fe1e1ce1a1b0eb9dea385568eb864d02
parentc1884ac2c30aaa9c3c356f2e6fd0425c74608424
CHROMIUM: Input: atmel_mxt_ts - release all fingers on resume

Currently lid close/open can generate noise touch events on system
suspend and resume. One case is that touch down is generated before
suspend, and touch liftoff is processed on resume. The driver will
discard any pending messages on resume which might make the system
enter ghost finger state (touch down without ever liftoff).

To workaround the ghost finger case, this patch forces release of
all possible fingers on resume. And to avoid the unwanted click
resulted from the forced release, move these fingers first to (0,0)
and assign them with maximal PRESSURE and TOUCH_MAJOR value so to
make them look like palms.

Signed-off-by: Yufeng Shen <miletus@chromium.org>
BUG=chromium:154383
TEST=use evtest to monitor the touch device; put fingers on the
     touch device; close the lid; remove fingers after making
     sure the system enters suspend; Open the lid;
     Make sure to see finger move events with pressue and
     touch_major = 255 and the release events.

Change-Id: Ic9f0659a2e731c2db03255eb2107be88b333541a
Reviewed-on: https://gerrit.chromium.org/gerrit/35046
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
drivers/input/touchscreen/atmel_mxt_ts.c