Skip to content

Commit

Permalink
HID: wacom: leds: make sure Cintiq 21UX2 and 24HD control the right LEDs
Browse files Browse the repository at this point in the history
The code for 21UX2 and 24HD makes the LED group 1 on the left, and
the group 0 on the right. The buttons are ordered in the other way,
but libwacom already exports those that way. So we simply can't reassign
LED group 0 to the left buttons, and have to quirk the incoming data...

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Aug 5, 2016
1 parent 34736aa commit 5a0fe8a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2768,6 +2768,15 @@ static bool wacom_is_led_toggled(struct wacom *wacom, int button_count,
{
int button_per_group;

/*
* 24HD and 21UX2 have LED group 1 to the left and LED group 0
* to the right. We need to reverse the group to match this
* historical behavior.
*/
if (wacom->wacom_wac.features.type == WACOM_24HD ||
wacom->wacom_wac.features.type == WACOM_21UX2)
group = 1 - group;

button_per_group = button_count/wacom->led.count;

return mask & (1 << (group * button_per_group));
Expand Down

0 comments on commit 5a0fe8a

Please sign in to comment.