aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-07-26 01:42:53 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-26 17:03:15 -0400
commit28835f4540564e6319028c9c1aeadf16604bed9c (patch)
treec9bea32a138b7e88b4313914cf73c57a41cb0069
parent105affbfd588d5aec4171234051f7d589f7e62c1 (diff)
Input: alps - process_bitmap: round down when spreading adjescent fingers over 2 points
This fixes 2 fingers at the same height or width on the touchpad getting reported at different y / x coordinates. Note num_bits is always at least 1. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/alps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 5b35f4fc4d2f..1c9917828956 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -391,13 +391,13 @@ static int alps_process_bitmap(struct alps_data *priv,
391 * adjacent fingers. Divide the single contact between the two points. 391 * adjacent fingers. Divide the single contact between the two points.
392 */ 392 */
393 if (fingers_x == 1) { 393 if (fingers_x == 1) {
394 i = x_low.num_bits / 2; 394 i = (x_low.num_bits - 1) / 2;
395 x_low.num_bits = x_low.num_bits - i; 395 x_low.num_bits = x_low.num_bits - i;
396 x_high.start_bit = x_low.start_bit + i; 396 x_high.start_bit = x_low.start_bit + i;
397 x_high.num_bits = max(i, 1); 397 x_high.num_bits = max(i, 1);
398 } 398 }
399 if (fingers_y == 1) { 399 if (fingers_y == 1) {
400 i = y_low.num_bits / 2; 400 i = (y_low.num_bits - 1) / 2;
401 y_low.num_bits = y_low.num_bits - i; 401 y_low.num_bits = y_low.num_bits - i;
402 y_high.start_bit = y_low.start_bit + i; 402 y_high.start_bit = y_low.start_bit + i;
403 y_high.num_bits = max(i, 1); 403 y_high.num_bits = max(i, 1);