summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2016-01-09 04:14:54 +0300
committerJiri Kosina <jkosina@suse.cz>2016-01-19 01:02:55 +0300
commit599b082095432f083da89ff53d95b4a878e1fca1 (patch)
tree359050d381fa5ed5a444dffefb973feb35955d5f /drivers/hid
parentc2848f2eef4dd08b0fd2a8eba1694fd8e77ddb67 (diff)
downloadlinux-599b082095432f083da89ff53d95b4a878e1fca1.tar.xz
HID: wacom - request tool info only when we get general events
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 <pingc@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/wacom_wac.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 99ef77fcfb80..d5dc59af5bbf 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -750,13 +750,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;
}
@@ -897,6 +890,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;