HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact [Linux 4.14.129]

HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact [Linux 4.14.129]

This Linux kernel change "HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact" is included in the Linux 4.14.129 release. This change is authored by Jason Gerecke <jason.gerecke [at] wacom.com> on Tue May 7 11:53:20 2019 -0700. The commit for this change in Linux stable tree is 7212a4c (patch) which is from upstream commit fe7f8d7. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream fe7f8d7.

HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact

commit fe7f8d73d1af19b678171170e4e5384deb57833d upstream.

The Bluetooth reports from the 2nd-gen Intuos Pro have separate bits for
indicating if the tip or eraser is in contact with the tablet. At the
moment, only the tip contact bit controls the state of the BTN_TOUCH
event. This prevents the eraser from working as expected. This commit
changes the driver to send BTN_TOUCH whenever either the tip or eraser
contact bit is set.

Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface")
Cc: <[email protected]> # 4.11+
Signed-off-by: Jason Gerecke <[email protected]>
Reviewed-by: Aaron Skomra <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/hid/wacom_wac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 2748672..b42bb95 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1275,7 +1275,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
            input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5]));
            input_report_abs(pen_input, ABS_DISTANCE, range ? frame[13] : wacom->features.distance_max);

-           input_report_key(pen_input, BTN_TOUCH, frame[0] & 0x01);
+           input_report_key(pen_input, BTN_TOUCH, frame[0] & 0x09);
            input_report_key(pen_input, BTN_STYLUS, frame[0] & 0x02);
            input_report_key(pen_input, BTN_STYLUS2, frame[0] & 0x04);

Leave a Reply

Your email address will not be published. Required fields are marked *