summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom_wac.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2024-11-18 21:29:33 +0100
committerJiri Kosina <jkosina@suse.com>2024-11-18 21:29:33 +0100
commitf33e46a0c6bddd341d0989484a2546bba7ac4a3c (patch)
tree4918985ab00890205c8d77d0553472e12e01cd55 /drivers/hid/wacom_wac.c
parent66ef47faa90d838cda131fe1f7776456cc3b59f2 (diff)
parenta025b0dbd83f85cf81ff447431cfd8b2d3cacb0a (diff)
downloadlwn-f33e46a0c6bddd341d0989484a2546bba7ac4a3c.tar.gz
lwn-f33e46a0c6bddd341d0989484a2546bba7ac4a3c.zip
Merge branch 'for-6.13/wacom' into for-linus
- Sanitization of BTN_TOOL_RUBBER handling (Jason Gerecke)
Diffstat (limited to 'drivers/hid/wacom_wac.c')
-rw-r--r--drivers/hid/wacom_wac.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 5a599c90e7a2..5501a560fb07 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2422,9 +2422,11 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field
wacom_wac->hid_data.sense_state = value;
return;
case HID_DG_INVERT:
- wacom_wac->hid_data.invert_state = value;
+ wacom_wac->hid_data.eraser |= value;
return;
case HID_DG_ERASER:
+ wacom_wac->hid_data.eraser |= value;
+ fallthrough;
case HID_DG_TIPSWITCH:
wacom_wac->hid_data.tipswitch |= value;
return;
@@ -2565,7 +2567,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
if (entering_range) { /* first in range */
/* Going into range select tool */
- if (wacom_wac->hid_data.invert_state)
+ if (wacom_wac->hid_data.eraser)
wacom_wac->tool[0] = BTN_TOOL_RUBBER;
else if (wacom_wac->features.quirks & WACOM_QUIRK_AESPEN)
wacom_wac->tool[0] = BTN_TOOL_PEN;
@@ -2619,6 +2621,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
}
wacom_wac->hid_data.tipswitch = false;
+ wacom_wac->hid_data.eraser = false;
input_sync(input);
}