Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 105affbf authored by Hans de Goede's avatar Hans de Goede Committed by Dmitry Torokhov
Browse files

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: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 036e6c7b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -342,14 +342,13 @@ static void alps_get_bitmap_points(unsigned int map,
		if (bit) {
			if (!prev_bit) {
				point->start_bit = i;
				point->num_bits = 0;
				(*fingers)++;
			}
			point->num_bits++;
		} else {
			if (prev_bit)
				point = high;
			else
				point->num_bits = 0;
		}
		prev_bit = bit;
	}