Input: hgpk - rework spew detection
authorDaniel Drake <dsd@laptop.org>
Fri, 12 Nov 2010 06:20:02 +0000 (22:20 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 12 Nov 2010 06:21:19 +0000 (22:21 -0800)
commitc0dc8342656a1425c31dcc505072f2387f0f0c92
tree042c9a331a54ad2095688f01dc5602ae96889dbc
parentca94ec43540ce5d93fd30a3bf88321b6f11ed51a
Input: hgpk - rework spew detection

The old implementation of spew detection simply tracked the overall
position delta of the cursor over every 100 packets. We found that
this causes occasional false positives in spew detection, and also
that the conditions of the spewy packets are perhaps more fixed than
we once thought.

Rework the spew detection to look for packets of specific small
delta, and only recalibrating if the overall movement delta stays
within expected bounds.

Also discard duplicate packets in the advanced mode, which appear
to be very common. If we don't, the spew detection kicks in far
too early. If we get a large spew of duplicates, request a
recalibration straight up.

Based on earlier work by Paul Fox.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/mouse/hgpk.c
drivers/input/mouse/hgpk.h