Merge branches 'for-4.20/upstream-fixes', 'for-4.21/core', 'for-4.21/hid-asus', ...
[linux-2.6-block.git] / include / linux / hid.h
index a355d61940f28957ec61b4424d49732a85118ffd..d99287327ef23f630e321d4705da2ef0248a257a 100644 (file)
@@ -219,6 +219,7 @@ struct hid_item {
 #define HID_GD_VBRZ            0x00010045
 #define HID_GD_VNO             0x00010046
 #define HID_GD_FEATURE         0x00010047
+#define HID_GD_RESOLUTION_MULTIPLIER   0x00010048
 #define HID_GD_SYSTEM_CONTROL  0x00010080
 #define HID_GD_UP              0x00010090
 #define HID_GD_DOWN            0x00010091
@@ -232,12 +233,14 @@ struct hid_item {
 #define HID_DC_BATTERYSTRENGTH 0x00060020
 
 #define HID_CP_CONSUMER_CONTROL        0x000c0001
+#define HID_CP_AC_PAN          0x000c0238
 
 #define HID_DG_DIGITIZER       0x000d0001
 #define HID_DG_PEN             0x000d0002
 #define HID_DG_LIGHTPEN                0x000d0003
 #define HID_DG_TOUCHSCREEN     0x000d0004
 #define HID_DG_TOUCHPAD                0x000d0005
+#define HID_DG_WHITEBOARD      0x000d0006
 #define HID_DG_STYLUS          0x000d0020
 #define HID_DG_PUCK            0x000d0021
 #define HID_DG_FINGER          0x000d0022
@@ -427,6 +430,7 @@ struct hid_local {
  */
 
 struct hid_collection {
+       struct hid_collection *parent;
        unsigned type;
        unsigned usage;
        unsigned level;
@@ -436,12 +440,16 @@ struct hid_usage {
        unsigned  hid;                  /* hid usage code */
        unsigned  collection_index;     /* index into collection array */
        unsigned  usage_index;          /* index into usage array */
+       __s8      resolution_multiplier;/* Effective Resolution Multiplier
+                                          (HUT v1.12, 4.3.1), default: 1 */
        /* hidinput data */
+       __s8      wheel_factor;         /* 120/resolution_multiplier */
        __u16     code;                 /* input driver code */
        __u8      type;                 /* input driver type */
        __s8      hat_min;              /* hat switch fun */
        __s8      hat_max;              /* ditto */
        __s8      hat_dir;              /* ditto */
+       __s16     wheel_accumulated;    /* hi-res wheel */
 };
 
 struct hid_input;
@@ -650,6 +658,7 @@ struct hid_parser {
        unsigned int         *collection_stack;
        unsigned int          collection_stack_ptr;
        unsigned int          collection_stack_size;
+       struct hid_collection *active_collection;
        struct hid_device    *device;
        unsigned int          scan_flags;
 };
@@ -836,7 +845,11 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
 
 /* Applications from HID Usage Tables 4/8/99 Version 1.1 */
 /* We ignore a few input applications that are not widely used */
-#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
+#define IS_INPUT_APPLICATION(a) \
+               (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \
+               || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \
+               || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL) \
+               || (a == HID_GD_WIRELESS_RADIO_CTLS))
 
 /* HID core API */
 
@@ -892,6 +905,8 @@ struct hid_report *hid_validate_values(struct hid_device *hid,
                                       unsigned int type, unsigned int id,
                                       unsigned int field_index,
                                       unsigned int report_counts);
+
+void hid_setup_resolution_multiplier(struct hid_device *hid);
 int hid_open_report(struct hid_device *device);
 int hid_check_keys_pressed(struct hid_device *hid);
 int hid_connect(struct hid_device *hid, unsigned int connect_mask);