From: Hans de Goede Date: Sat, 26 Jul 2014 05:42:53 +0000 (-0700) Subject: Input: alps - process_bitmap: round down when spreading adjescent fingers over 2... X-Git-Tag: v5.15~74^2~972 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28835f4540564e6319028c9c1aeadf16604bed9c;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 5b35f4f..1c99178 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, * adjacent fingers. Divide the single contact between the two points. */ if (fingers_x == 1) { - i = x_low.num_bits / 2; + i = (x_low.num_bits - 1) / 2; x_low.num_bits = x_low.num_bits - i; x_high.start_bit = x_low.start_bit + i; x_high.num_bits = max(i, 1); } if (fingers_y == 1) { - i = y_low.num_bits / 2; + i = (y_low.num_bits - 1) / 2; y_low.num_bits = y_low.num_bits - i; y_high.start_bit = y_low.start_bit + i; y_high.num_bits = max(i, 1);