Skip to content

Commit 599b082

Browse files
PinglinuxJiri Kosina
authored andcommitted
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 <[email protected]> Reviewed-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent c2848f2 commit 599b082

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/hid/wacom_wac.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -750,13 +750,6 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
750750
return 2;
751751
}
752752

753-
/* don't report other events if we don't know the ID */
754-
if (!wacom->id[idx]) {
755-
/* but reschedule a read of the current tool */
756-
wacom_intuos_schedule_prox_event(wacom);
757-
return 1;
758-
}
759-
760753
return 0;
761754
}
762755

@@ -897,6 +890,13 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
897890
data[0] != WACOM_REPORT_INTUOS_PEN)
898891
return 0;
899892

893+
/* don't report events if we don't know the tool ID */
894+
if (!wacom->id[idx]) {
895+
/* but reschedule a read of the current tool */
896+
wacom_intuos_schedule_prox_event(wacom);
897+
return 1;
898+
}
899+
900900
x = (be16_to_cpup((__be16 *)&data[2]) << 1) | ((data[9] >> 1) & 1);
901901
y = (be16_to_cpup((__be16 *)&data[4]) << 1) | (data[9] & 1);
902902
distance = data[9] >> 2;

0 commit comments

Comments
 (0)