]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact
authorJason Gerecke <jason.gerecke@wacom.com>
Tue, 7 May 2019 18:53:20 +0000 (11:53 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838824
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: <stable@vger.kernel.org> # 4.11+
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/wacom_wac.c

index 369a5cfaceb8e8c0cae5a7c2694195e5f807776f..18098e6f8a4f2f0f12449e4f9eaef32334554456 100644 (file)
@@ -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);