aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-07-26 01:41:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-26 17:03:15 -0400
commit105affbfd588d5aec4171234051f7d589f7e62c1 (patch)
tree375537f5cc293c97cc2974fb3ad15a4382aa741d
parent036e6c7b541a9a57b4e294ee4727045d81f68ca0 (diff)
Input: alps - process_bitmap: fix counting of high point bits
alps_process_bitmap was resetting the point bit-count as soon as it saw 2 0 bits in a row. This means that unless the high point actually is at the end of the bitmap, it would always get its num_bits set to 0. Instead reset num_bits to 0 on a 0->1 transition, so that with > 2 fingers we only count the number of bits occupied by the highest finger. 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.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index c6af590a07d3..5b35f4fc4d2f 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -342,14 +342,13 @@ static void alps_get_bitmap_points(unsigned int map,
342 if (bit) { 342 if (bit) {
343 if (!prev_bit) { 343 if (!prev_bit) {
344 point->start_bit = i; 344 point->start_bit = i;
345 point->num_bits = 0;
345 (*fingers)++; 346 (*fingers)++;
346 } 347 }
347 point->num_bits++; 348 point->num_bits++;
348 } else { 349 } else {
349 if (prev_bit) 350 if (prev_bit)
350 point = high; 351 point = high;
351 else
352 point->num_bits = 0;
353 } 352 }
354 prev_bit = bit; 353 prev_bit = bit;
355 } 354 }