summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Huddleston2009-06-03 16:29:39 +0200
committerDmitry Torokhov2009-06-03 16:37:54 +0200
commit05e882f890038c702a4f15d385135d03cf74ad48 (patch)
tree7a502c2946359809e3739a7c0f32e1ffcf04373a
parentInput: wacom - clear Intuos4 wheel data when finger leaves proximity (diff)
downloadkernel-qcow2-linux-05e882f890038c702a4f15d385135d03cf74ad48.tar.gz
kernel-qcow2-linux-05e882f890038c702a4f15d385135d03cf74ad48.tar.xz
kernel-qcow2-linux-05e882f890038c702a4f15d385135d03cf74ad48.zip
Input: appletouch - improve finger detection
The appletouch driver is prone to reporting multiple fingers when only one is pressing. The appletouch driver queries an array of pressure sensors and counts local maxima in pressure to determine the number of fingers. It just does this on the raw values, so a data stream like: 0 100 250 300 299 300 250 100 0 actually registers as 2 fingers. This patch updates the logic to ignore small dips in pressure that are less than the threshold. Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/mouse/appletouch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index e0140fdc02a5..908b5b44052f 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -361,7 +361,7 @@ static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact,
(!is_increasing && xy_sensors[i - 1] < xy_sensors[i])) {
(*fingers)++;
is_increasing = 1;
- } else if (i > 0 && xy_sensors[i - 1] >= xy_sensors[i]) {
+ } else if (i > 0 && (xy_sensors[i - 1] - xy_sensors[i] > threshold)) {
is_increasing = 0;
}