Skip to content

Commit

Permalink
Input: alps - fix v4 button press recognition
Browse files Browse the repository at this point in the history
Since the change to struct input_mt_pos some variables are now bitfields
instead of integers. Automatic conversion from integer to bitfield entry
destroys information, therefore enforce boolean interpretation instead.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1114768
Fixes: 02d0425 ("Input: alps - use struct input_mt_pos to track coordinates")
Signed-off-by: Andreas Bosch <linux@progandy.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Andreas Bosch authored and Dmitry Torokhov committed Oct 15, 2014
1 parent 4af6600 commit b0cfb79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/mouse/alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse)
f->fingers = alps_process_bitmap(priv, f);
}

f->left = packet[4] & 0x01;
f->right = packet[4] & 0x02;
f->left = !!(packet[4] & 0x01);
f->right = !!(packet[4] & 0x02);

f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) |
((packet[0] & 0x30) >> 4);
Expand Down

0 comments on commit b0cfb79

Please sign in to comment.