diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2016-07-13 12:06:13 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-08-05 07:39:21 -0400 |
commit | 5a0fe8abd169be4f2e1f73ad851419d502b5a832 (patch) | |
tree | 7cc710aa59b6e8975dcdbb8d09577db1de4d1222 | |
parent | 34736aa96e313d304ffe0746519833167e66c978 (diff) |
HID: wacom: leds: make sure Cintiq 21UX2 and 24HD control the right LEDs
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>
-rw-r--r-- | drivers/hid/wacom_wac.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 00e0c80be6d5..a9693d5d2e93 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c | |||
@@ -2768,6 +2768,15 @@ static bool wacom_is_led_toggled(struct wacom *wacom, int button_count, | |||
2768 | { | 2768 | { |
2769 | int button_per_group; | 2769 | int button_per_group; |
2770 | 2770 | ||
2771 | /* | ||
2772 | * 24HD and 21UX2 have LED group 1 to the left and LED group 0 | ||
2773 | * to the right. We need to reverse the group to match this | ||
2774 | * historical behavior. | ||
2775 | */ | ||
2776 | if (wacom->wacom_wac.features.type == WACOM_24HD || | ||
2777 | wacom->wacom_wac.features.type == WACOM_21UX2) | ||
2778 | group = 1 - group; | ||
2779 | |||
2771 | button_per_group = button_count/wacom->led.count; | 2780 | button_per_group = button_count/wacom->led.count; |
2772 | 2781 | ||
2773 | return mask & (1 << (group * button_per_group)); | 2782 | return mask & (1 << (group * button_per_group)); |