Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e9c0eb1 authored by Jason Gerecke's avatar Jason Gerecke Committed by Greg Kroah-Hartman
Browse files

HID: wacom: Don't report anything prior to the tool entering range



commit e92a7be7fe5b2510fa60965eaf25f9e3dc08b8cc upstream.

If the tool spends some time in prox before entering range, a series of
events (e.g. ABS_DISTANCE, MSC_SERIAL) can be sent before we or userspace
have any clue about the pen whose data is being reported. We need to hold
off on reporting anything until the pen has entered range. Since we still
want to report events that occur "in prox" after the pen has *left* range
we use 'wacom-tool[0]' as the indicator that the pen did at one point
enter range and provide us/userspace with tool type and serial number
information.

Fixes: a48324de ("HID: wacom: Bluetooth IRQ for Intuos Pro should handle prox/range")
Cc: <stable@vger.kernel.org> # 4.11+
Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: default avatarAaron Armstrong Skomra <aaron.skomra@wacom.com>
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52a7d604
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -1288,6 +1288,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
						 get_unaligned_le16(&frame[11]));
			}
		}

		if (wacom->tool[0]) {
			input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5]));
			if (wacom->features.type == INTUOSP2_BT) {
				input_report_abs(pen_input, ABS_DISTANCE,
@@ -1305,6 +1307,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
			input_event(pen_input, EV_MSC, MSC_SERIAL, wacom->serial[0]);
			input_report_abs(pen_input, ABS_MISC,
					 wacom_intuos_id_mangle(wacom->id[0])); /* report tool id */
		}

		wacom->shared->stylus_in_proximity = prox;