aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2014-11-24 18:32:12 -0500
committerJiri Kosina <jkosina@suse.cz>2014-11-27 08:45:25 -0500
commitc376e7167e0ff390e07d60b4320398c3baae72a6 (patch)
treed7dbf71096ab60c27b59ec1152d0724a228e2691
parent954df6ad00ea2ba732e2e7ae6a68b3111eee4e09 (diff)
HID: wacom: Consult the application usage when determining field type
It is not necessarily sufficient to look only at the physical and logical usages when determining if a field is for the pen or touch. Some fields are not contained in a sub-collection and thus only have an application usage. Not checking the application usage in such cases causes us to ignore the field entirely, which may lead to incorrect behavior. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/wacom_wac.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 9565d31262ec..1468f008bfbd 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1484,9 +1484,11 @@ static void wacom_wac_finger_report(struct hid_device *hdev,
1484} 1484}
1485 1485
1486#define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ 1486#define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \
1487 ((f)->physical == HID_DG_STYLUS)) 1487 ((f)->physical == HID_DG_STYLUS) || \
1488 ((f)->application == HID_DG_PEN))
1488#define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \ 1489#define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \
1489 ((f)->physical == HID_DG_FINGER)) 1490 ((f)->physical == HID_DG_FINGER) || \
1491 ((f)->application == HID_DG_TOUCHSCREEN))
1490 1492
1491void wacom_wac_usage_mapping(struct hid_device *hdev, 1493void wacom_wac_usage_mapping(struct hid_device *hdev,
1492 struct hid_field *field, struct hid_usage *usage) 1494 struct hid_field *field, struct hid_usage *usage)