diff options
| author | Chris Chiu <chiu@endlessm.com> | 2018-12-03 01:46:20 -0500 |
|---|---|---|
| committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2018-12-05 09:46:26 -0500 |
| commit | 2fc00c1e0f9d2abe0df74c33cf9f40d12b9b892f (patch) | |
| tree | 437e1fdb7e59d2e3678802539b59556b55ee06d7 /include | |
| parent | e195ca6cb6f21633e56322d5aa11ed59cdb22fb2 (diff) | |
HID: use macros in IS_INPUT_APPLICATION
Add missing definition for HID_DG_WHITEBOARD then replace the hid
usage hex with macros for better readibility.
Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hid.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index a355d61940f2..ce5f996c8d3d 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -238,6 +238,7 @@ struct hid_item { | |||
| 238 | #define HID_DG_LIGHTPEN 0x000d0003 | 238 | #define HID_DG_LIGHTPEN 0x000d0003 |
| 239 | #define HID_DG_TOUCHSCREEN 0x000d0004 | 239 | #define HID_DG_TOUCHSCREEN 0x000d0004 |
| 240 | #define HID_DG_TOUCHPAD 0x000d0005 | 240 | #define HID_DG_TOUCHPAD 0x000d0005 |
| 241 | #define HID_DG_WHITEBOARD 0x000d0006 | ||
| 241 | #define HID_DG_STYLUS 0x000d0020 | 242 | #define HID_DG_STYLUS 0x000d0020 |
| 242 | #define HID_DG_PUCK 0x000d0021 | 243 | #define HID_DG_PUCK 0x000d0021 |
| 243 | #define HID_DG_FINGER 0x000d0022 | 244 | #define HID_DG_FINGER 0x000d0022 |
| @@ -836,7 +837,10 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev, | |||
| 836 | 837 | ||
| 837 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | 838 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ |
| 838 | /* We ignore a few input applications that are not widely used */ | 839 | /* We ignore a few input applications that are not widely used */ |
| 839 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006))) | 840 | #define IS_INPUT_APPLICATION(a) \ |
| 841 | (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \ | ||
| 842 | || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \ | ||
| 843 | || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL)) | ||
| 840 | 844 | ||
| 841 | /* HID core API */ | 845 | /* HID core API */ |
| 842 | 846 | ||
