Skip to content
Commit 5866d9e3 authored by Jason Gerecke's avatar Jason Gerecke Committed by Dmitry Torokhov
Browse files

Input: wacom - use full 32-bit HID Usage value in switch statement



A HID Usage is a 32-bit value: an upper 16-bit "page" and a lower 16-bit
ID. While the two halves are normally reported seperately, only the
combination uniquely idenfifes a particular HID Usage.

The existing code performs the comparison in two steps, first performing a
switch on the ID and then verifying the page within each case. While this
works fine, it is very akward to handle two Usages that share a single ID,
such as HID_USAGE_PRESSURE and HID_USAGE_X because the case statement can
only have a single identifier.

To work around this, we now check the full 32-bit HID Usage directly rather
than first checking the ID and then the page.  This allows the switch
statement to have distinct cases for e.g. HID_USAGE_PRESSURE and
HID_USAGE_X.

Signed-off-by: default avatarJason Gerecke <killertofu@gmail.com>
Tested-by: default avatarAaron Skomra <Aaron.Skomra@wacom.com>
Reviewed-by: default avatarCarl Worth <cworth@cworth.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 91ae0e77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment