diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-05-20 14:41:10 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-05-20 14:45:44 -0700 |
commit | 4dd265730710bd881c45d6ccf41050c3738ffccd (patch) | |
tree | a5f8310625ac2cf316a9c2fc16fc426599f77902 /drivers/input/mouse/alps.h | |
parent | 44b77f38dce59f57a679083df12509deab02cfcc (diff) | |
download | talos-obmc-linux-4dd265730710bd881c45d6ccf41050c3738ffccd.tar.gz talos-obmc-linux-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 'drivers/input/mouse/alps.h')
-rw-r--r-- | drivers/input/mouse/alps.h | 1 |
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; |