diff options
author | Jason Gerecke <killertofu@gmail.com> | 2015-05-01 02:51:54 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-05-04 10:00:22 +0200 |
commit | 042628abd59c9a034797bd3083f806fa17cda62d (patch) | |
tree | 32251d6b256514a68f1eb48d3292b54053fbf464 /drivers/hid/wacom_wac.h | |
parent | HID: wacom: Do not add suffix to name of devices with an unknown type (diff) | |
download | linux-042628abd59c9a034797bd3083f806fa17cda62d.tar.xz linux-042628abd59c9a034797bd3083f806fa17cda62d.zip |
HID: wacom: Discover device_type from HID descriptor for all devices
Currently, we assume a device_type of BTN_TOOL_PEN before scanning the
HID descriptor and then change the device_type if what we discover
proves that assumption wrong. This way of doing things makes it more
difficult to figure out if a device (particularly a HID_GENERIC device)
actually does tablet/touch input or is something completley different.
This patch leaves device_type at its initial value of 0 and then calls
'wacom_parse_hid' for every device (not just those that have touch).
As we map the usages, we can set the device_type as before. After we're
finished, we can then check if the value is still zero and do whatever
is most appropriate.
Detecting the pen can be a little tricky on most Wacom devices because
the descriptors describe opaque blobs. Fortunately, older Wacom tablets
have the HID_DG_DIGITIZER usage on the pen's application collection and
newer tablets seem to have a similar vendor-defined usage that we can
trigger on.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_wac.h')
-rw-r--r-- | drivers/hid/wacom_wac.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index f5a5f686bc98..9a5ee623cb44 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -72,10 +72,14 @@ #define WACOM_QUIRK_MONITOR 0x0004 #define WACOM_QUIRK_BATTERY 0x0008 +#define WACOM_VENDORDEFINED_PEN 0xff0d0001 + #define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ ((f)->physical == HID_DG_STYLUS) || \ ((f)->physical == HID_DG_PEN) || \ - ((f)->application == HID_DG_PEN)) + ((f)->application == HID_DG_PEN) || \ + ((f)->application == HID_DG_DIGITIZER) || \ + ((f)->application == WACOM_VENDORDEFINED_PEN)) #define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \ ((f)->physical == HID_DG_FINGER) || \ ((f)->application == HID_DG_TOUCHSCREEN)) |