Skip to content

Commit

Permalink
HID: wacom: Fix pad button range for CINTIQ_COMPANION_2
Browse files Browse the repository at this point in the history
Commit c7f0522 incorrectly constructs the 'buttons' variable for the
CINTIQ_COMPANION_2 case. The high nybble of data[2] is shifted four
bits too far, leaving the bits associated with BTN_7 through BTN_A
unset.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jason Gerecke authored and Jiri Kosina committed Dec 17, 2015
1 parent aaae03e commit 0402b6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
* d-pad down -> data[4] & 0x80
* d-pad center -> data[3] & 0x01
*/
buttons = ((data[2] & 0xF0) << 7) |
buttons = ((data[2] >> 4) << 7) |
((data[1] & 0x04) << 6) |
((data[2] & 0x0F) << 2) |
(data[1] & 0x03);
Expand Down

0 comments on commit 0402b6b

Please sign in to comment.