Skip to content

Commit d8e9806

Browse files
skomraJiri Kosina
authored andcommitted
HID: wacom: generic: only switch the mode on devices with LEDs
Currently, the driver will attempt to set the mode on all devices with a center button, but some devices with a center button lack LEDs, and attempting to set the LEDs on devices without LEDs results in the kernel error message of the form: "leds input8::wacom-0.1: Setting an LED's brightness failed (-32)" This is because the generic codepath erroneously assumes that the BUTTON_CENTER usage indicates that the device has LEDs, the previously ignored TOUCH_RING_SETTING usage is a more accurate indication of the existence of LEDs on the device. Fixes: 10c55ca ("HID: wacom: generic: support LEDs") Cc: <[email protected]> # v4.11+ Signed-off-by: Aaron Armstrong Skomra <[email protected]> Reviewed-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b4dd05d commit d8e9806

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

drivers/hid/wacom_sys.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ static void wacom_feature_mapping(struct hid_device *hdev,
307307
wacom_hid_usage_quirk(hdev, field, usage);
308308

309309
switch (equivalent_usage) {
310+
case WACOM_HID_WD_TOUCH_RING_SETTING:
311+
wacom->generic_has_leds = true;
312+
break;
310313
case HID_DG_CONTACTMAX:
311314
/* leave touch_max as is if predefined */
312315
if (!features->touch_max) {

drivers/hid/wacom_wac.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,8 +1906,6 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev,
19061906
features->device_type |= WACOM_DEVICETYPE_PAD;
19071907
break;
19081908
case WACOM_HID_WD_BUTTONCENTER:
1909-
wacom->generic_has_leds = true;
1910-
/* fall through */
19111909
case WACOM_HID_WD_BUTTONHOME:
19121910
case WACOM_HID_WD_BUTTONUP:
19131911
case WACOM_HID_WD_BUTTONDOWN:

drivers/hid/wacom_wac.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
#define WACOM_HID_WD_OFFSETBOTTOM (WACOM_HID_UP_WACOMDIGITIZER | 0x0d33)
146146
#define WACOM_HID_WD_DATAMODE (WACOM_HID_UP_WACOMDIGITIZER | 0x1002)
147147
#define WACOM_HID_WD_DIGITIZERINFO (WACOM_HID_UP_WACOMDIGITIZER | 0x1013)
148+
#define WACOM_HID_WD_TOUCH_RING_SETTING (WACOM_HID_UP_WACOMDIGITIZER | 0x1032)
148149
#define WACOM_HID_UP_G9 0xff090000
149150
#define WACOM_HID_G9_PEN (WACOM_HID_UP_G9 | 0x02)
150151
#define WACOM_HID_G9_TOUCHSCREEN (WACOM_HID_UP_G9 | 0x11)

0 commit comments

Comments
 (0)