aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-10-04 14:40:44 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-10-04 14:46:51 -0400
commita831776323e7c532ef9c88d0d62512ae15d78415 (patch)
tree08b81fcc217d0a8cacb721feda78d85c738aa810
parent4777ac220c430173e297237b896932ed5fd8aaf3 (diff)
Input: ALPS - handle 0-pressure 1F events
While a button is held SS5 hardware will give us single-finger packets with x, y, and pressure equal to zero. This causes annoying jumps in pointer position if a touch is released while the button is held. Handle this by claiming zero contacts to ensure that no position events are provided to the user. Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Ben Gamari <ben@smart-cactus.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/alps.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 8e15783d2932..a76e5c6fce54 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1198,7 +1198,13 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
1198 f->mt[0].x = SS4_1F_X_V2(p); 1198 f->mt[0].x = SS4_1F_X_V2(p);
1199 f->mt[0].y = SS4_1F_Y_V2(p); 1199 f->mt[0].y = SS4_1F_Y_V2(p);
1200 f->pressure = ((SS4_1F_Z_V2(p)) * 2) & 0x7f; 1200 f->pressure = ((SS4_1F_Z_V2(p)) * 2) & 0x7f;
1201 f->fingers = 1; 1201 /*
1202 * When a button is held the device will give us events
1203 * with x, y, and pressure of 0. This causes annoying jumps
1204 * if a touch is released while the button is held.
1205 * Handle this by claiming zero contacts.
1206 */
1207 f->fingers = f->pressure > 0 ? 1 : 0;
1202 f->first_mp = 0; 1208 f->first_mp = 0;
1203 f->is_mp = 0; 1209 f->is_mp = 0;
1204 break; 1210 break;