[PATCH 1/4] HID: wacom - request tool info only when we get general events

Subsystems: hid core layer, hid wacom driver, the rest

STALE3847d REVIEWED: 1 (1M)

1 review trailer (1 from subsystem maintainers).

2 messages, 2 authors, 2016-01-18 · open the first message on its own page

[PATCH 1/4] HID: wacom - request tool info only when we get general events

From: Ping Cheng <hidden>
Date: 2016-01-09 01:15:18

Move wacom_intuos_schedule_prox_event inside wacom_intuos_general
so we don't call it when general event data isn't ready.

Signed-off-by: Ping Cheng <redacted>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
---
 drivers/hid/wacom_wac.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index f706604..6449547 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -746,13 +746,6 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 		return 2;
 	}
 
-	/* don't report other events if we don't know the ID */
-	if (!wacom->id[idx]) {
-		/* but reschedule a read of the current tool */
-		wacom_intuos_schedule_prox_event(wacom);
-		return 1;
-	}
-
 	return 0;
 }
 
@@ -893,6 +886,13 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
 		data[0] != WACOM_REPORT_INTUOS_PEN)
 		return 0;
 
+	/* don't report events if we don't know the tool ID */
+	if (!wacom->id[idx]) {
+		/* but reschedule a read of the current tool */
+		wacom_intuos_schedule_prox_event(wacom);
+		return 1;
+	}
+
 	x = (be16_to_cpup((__be16 *)&data[2]) << 1) | ((data[9] >> 1) & 1);
 	y = (be16_to_cpup((__be16 *)&data[4]) << 1) | (data[9] & 1);
 	distance = data[9] >> 2;
-- 
1.9.1

Re: [PATCH 1/4] HID: wacom - request tool info only when we get general events

From: Jiri Kosina <jikos@kernel.org>
Date: 2016-01-18 22:05:45

On Fri, 8 Jan 2016, Ping Cheng wrote:
Move wacom_intuos_schedule_prox_event inside wacom_intuos_general
so we don't call it when general event data isn't ready.

Signed-off-by: Ping Cheng <redacted>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
I've applied the whole series to for-4.6/wacom.

Thanks,

-- 
Jiri Kosina
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help