aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2013-09-20 12:48:46 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-09-20 12:58:54 -0400
commit4eb1830b492842023b4529bec901f576a4d9ed19 (patch)
tree25f4b7aabb09b8c982b67ae4aafb7e62df033b93 /drivers/input/tablet/wacom_wac.c
parent36d3c510e6f0a05d6aec6bc54eb708bc6f01c3b4 (diff)
Input: wacom - send proper tablet state info when pen leaves proximity
The EMR sensor of Intuos4 and newer devices can send a packet with 0x20 in its second byte which contains only location information. This packet is sent when the pen is too far away to reliably obtain other information. Because only the location is updated userspace will continue to see stale information for other values, most notably TOUCH, PRESSURE, and DISTANCE. This patch ensures userspace is not left with stale device state information when the pen re-enters proximity (possibly leading to the assumption the pen is still in contact even though it is actually hovering). Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 45984afb040d..102480621079 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -427,6 +427,13 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
427 (features->type == WACOM_21UX2)) 427 (features->type == WACOM_21UX2))
428 return 1; 428 return 1;
429 429
430 /* Range Report */
431 if ((data[1] & 0xfe) == 0x20) {
432 input_report_key(input, BTN_TOUCH, 0);
433 input_report_abs(input, ABS_PRESSURE, 0);
434 input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max);
435 }
436
430 /* Exit report */ 437 /* Exit report */
431 if ((data[1] & 0xfe) == 0x80) { 438 if ((data[1] & 0xfe) == 0x80) {
432 if (features->quirks == WACOM_QUIRK_MULTI_INPUT) 439 if (features->quirks == WACOM_QUIRK_MULTI_INPUT)