Skip to content

Commit

Permalink
HID: wacom: Hardcode (non-inverted) AES pens as BTN_TOOL_PEN
Browse files Browse the repository at this point in the history
commit 2934b12 upstream.

Unlike EMR tools which encode type information in their tool ID, tools
for AES sensors are all "generic pens". It is inappropriate to make use
of the wacom_intuos_get_tool_type function when dealing with these kinds
of devices. Instead, we should only ever report BTN_TOOL_PEN or
BTN_TOOL_RUBBER, as depending on the state of the Eraser and Invert
bits.

Reported-by: Daniel Jutz <[email protected]>
Closes: https://lore.kernel.org/linux-input/[email protected]/
Bisected-by: Christian Heusel <[email protected]>
Fixes: 9c2913b ("HID: wacom: more appropriate tool type categorization")
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1041
Link: linuxwacom/input-wacom#440
Signed-off-by: Jason Gerecke <[email protected]>
Cc: [email protected]
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jigpu authored and Sasha Levin committed Oct 15, 2024
1 parent ed14ce0 commit 9f05b98
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2501,6 +2501,8 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
/* Going into range select tool */
if (wacom_wac->hid_data.invert_state)
wacom_wac->tool[0] = BTN_TOOL_RUBBER;
else if (wacom_wac->features.quirks & WACOM_QUIRK_AESPEN)
wacom_wac->tool[0] = BTN_TOOL_PEN;
else if (wacom_wac->id[0])
wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);
else
Expand Down

0 comments on commit 9f05b98

Please sign in to comment.