From: Jason Gerecke Date: Mon, 24 Nov 2014 23:32:12 +0000 (-0800) Subject: HID: wacom: Consult the application usage when determining field type X-Git-Tag: v4.14-rc1~6322^2^10~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c376e7167e0ff390e07d60b4320398c3baae72a6;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 9565d31..1468f00 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, } #define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ - ((f)->physical == HID_DG_STYLUS)) + ((f)->physical == HID_DG_STYLUS) || \ + ((f)->application == HID_DG_PEN)) #define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \ - ((f)->physical == HID_DG_FINGER)) + ((f)->physical == HID_DG_FINGER) || \ + ((f)->application == HID_DG_TOUCHSCREEN)) void wacom_wac_usage_mapping(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage)