CHROMIUM: Input: atmel_mxt_ts - simplify event reporting
authorDaniel Kurtz <djkurtz@chromium.org>
Mon, 20 Feb 2012 15:31:55 +0000 (23:31 +0800)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:12:05 +0000 (15:12 -0700)
commit4f6d5421f1a1740b12c2a28b38334559d0ba49d2
tree303cfe6c06b7519991edebfbba7bc407893d0d54
parent2f411afb1345adf7445ece5ee320f76a8f5caca2
CHROMIUM: Input: atmel_mxt_ts - simplify event reporting

Instead of carrying around per-finger state in the driver instance, just
report each finger as it arrives to the input layer, and let the input
layer (evdev) hold the event state (which it does anyway).

Also, the atmel pad reports "amplitude", which is reported to userspace
using the "PRESSURE" event type.  The variables now reflect this.

Note: this driver does not really do MT-B properly. Each input report
(a goup of input events followed by a SYN_REPORT) only contains data for
a single contact.  When multiple fingers are present on a device, each is
properly reported in its own MT_SLOT.  However, there is only ever one
MT_SLOT per SYN_REPORT.  This is fixed in a subsequent patch.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:27713
TEST=builds clean; input events sent properly when using atmel device.
  A tracking ID, x, y, pressure and area (as touch_major) should be
     reported for each contact.
  BTN_TOUCH should be 1 when (at least) 1 finger is touching, else 0.

Change-Id: Ie7c9058da27d5158c7f47bd2d11862955978905d
Reviewed-on: https://gerrit.chromium.org/gerrit/17950
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
drivers/input/touchscreen/atmel_mxt_ts.c