aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-05-20 14:41:10 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-05-20 14:45:44 -0700
commit4dd265730710bd881c45d6ccf41050c3738ffccd (patch)
treea5f8310625ac2cf316a9c2fc16fc426599f77902 /drivers/input/mouse/alps.h
parentInput: alps - decode the position packet first (diff)
downloadlinux-dev-4dd265730710bd881c45d6ccf41050c3738ffccd.tar.xz
linux-dev-4dd265730710bd881c45d6ccf41050c3738ffccd.zip
Input: alps - use more accurate coordinates for first touch in semi-mt mode
All alps semi-mt touchpads give us the following data when 2 (or more) fingers are touching: 1 more or less accurate touch for the first finger down, and a bitmap with columns and rows in which 1 or more fingers are seen resulting in a crude (low res) bounding box. So far for v3, rushmore and v4 touchpads we've been reporting the coordinates of 2 opposite corners of the box when 2 fingers are touching. Ignoring the much better resolution data given in the normal position packet. This commit actually uses this data for the first touch, figures out which corner of the bounding box is closest to the first touch, and reports the coordinates of the opposite corner for the second touch, resulting in much better data for the first touch and for the single touch pointer-emulation events. This approach is similar to the one in alps_process_bitmap_dolphin, that function takes the single accurate touch info, calculates the distance to the center of the bounding box, and then puts the 2nd touch mirrored to the center. The downside of that approach is that if both touches move slowly in the same direction, the bounding box will stay the same for a while (as it is low res) and the second touch will thus been seen moving in the opposite direction until the bounding box actually changes, and then the second touch snaps to its new position resulting in a saw tooth pattern in the coordinates for the second touch, hence this new approach. This commit fixes 2 finger scrolling being choppy / jumpy on these touchpads. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/input/mouse/alps.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
index 6dfdccc3a7c6..d37f814dc447 100644
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -278,6 +278,7 @@ struct alps_data {
int prev_fin;
int multi_packet;
+ int second_touch;
unsigned char multi_data[6];
struct alps_fields f;
u8 quirks;