Skip to content

Commit 8d411cb

Browse files
jigpuJiri Kosina
authored andcommitted
HID: wacom: Do not completely map WACOM_HID_WD_TOUCHRINGSTATUS usage
The WACOM_HID_WD_TOUCHRINGSTATUS usage is a single bit which tells us whether the touchring is currently in use or not. Because we need to reset the axis value to 0 when the finger is removed, we call 'wacom_map_usage' to ensure that the required type/code values are associated with the usage. The 'wacom_map_usage' also sets up the axis range and resolution, however, which is not desired in this particular case. Although xf86-input-wacom doesn't do really do anything with the ring's range or resolution, the libinput driver (for Wayland environments) uses these values to provide proper angle indications to userspace. Fixes: 60a2218 ("HID: wacom: generic: add support for touchring") Cc: [email protected] Signed-off-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b448cbe commit 8d411cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/hid/wacom_wac.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,13 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev,
18461846
features->device_type |= WACOM_DEVICETYPE_PAD;
18471847
break;
18481848
case WACOM_HID_WD_TOUCHRINGSTATUS:
1849-
wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0);
1849+
/*
1850+
* Only set up type/code association. Completely mapping
1851+
* this usage may overwrite the axis resolution and range.
1852+
*/
1853+
usage->type = EV_ABS;
1854+
usage->code = ABS_WHEEL;
1855+
set_bit(EV_ABS, input->evbit);
18501856
features->device_type |= WACOM_DEVICETYPE_PAD;
18511857
break;
18521858
case WACOM_HID_WD_BUTTONCONFIG:

0 commit comments

Comments
 (0)