Commit 8d898335 authored by Jason Gerecke's avatar Jason Gerecke Committed by Greg Kroah-Hartman

HID: wacom: Do not completely map WACOM_HID_WD_TOUCHRINGSTATUS usage

commit 8d411cbf upstream.

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: 60a22186 ("HID: wacom: generic: add support for touchring")
Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5beb744c
...@@ -1846,7 +1846,13 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, ...@@ -1846,7 +1846,13 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev,
features->device_type |= WACOM_DEVICETYPE_PAD; features->device_type |= WACOM_DEVICETYPE_PAD;
break; break;
case WACOM_HID_WD_TOUCHRINGSTATUS: case WACOM_HID_WD_TOUCHRINGSTATUS:
wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0); /*
* Only set up type/code association. Completely mapping
* this usage may overwrite the axis resolution and range.
*/
usage->type = EV_ABS;
usage->code = ABS_WHEEL;
set_bit(EV_ABS, input->evbit);
features->device_type |= WACOM_DEVICETYPE_PAD; features->device_type |= WACOM_DEVICETYPE_PAD;
break; break;
case WACOM_HID_WD_BUTTONCONFIG: case WACOM_HID_WD_BUTTONCONFIG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment