diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hid-sensor-hub.h | 2 | ||||
-rw-r--r-- | include/linux/hid-sensor-ids.h | 2 | ||||
-rw-r--r-- | include/linux/hid.h | 16 | ||||
-rw-r--r-- | include/linux/hidraw.h | 1 | ||||
-rw-r--r-- | include/linux/i2c/i2c-hid.h | 3 | ||||
-rw-r--r-- | include/linux/mod_devicetable.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/input.h | 25 | ||||
-rw-r--r-- | include/uapi/linux/uhid.h | 4 |
8 files changed, 44 insertions, 11 deletions
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index ecefb7311dd6..32ba45158d39 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
@@ -172,7 +172,7 @@ struct hid_sensor_common { | |||
172 | struct hid_sensor_hub_attribute_info sensitivity; | 172 | struct hid_sensor_hub_attribute_info sensitivity; |
173 | }; | 173 | }; |
174 | 174 | ||
175 | /*Convert from hid unit expo to regular exponent*/ | 175 | /* Convert from hid unit expo to regular exponent */ |
176 | static inline int hid_sensor_convert_exponent(int unit_expo) | 176 | static inline int hid_sensor_convert_exponent(int unit_expo) |
177 | { | 177 | { |
178 | if (unit_expo < 0x08) | 178 | if (unit_expo < 0x08) |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 6f24446e7669..4f945d3ed49f 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 | 37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 |
38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 | 38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 |
39 | 39 | ||
40 | /*ORIENTATION: Compass 3D: (200083) */ | 40 | /* ORIENTATION: Compass 3D: (200083) */ |
41 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 | 41 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 |
42 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 | 42 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 |
43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 | 43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 0c48991b0402..ee1ffc5e19c9 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -252,6 +252,8 @@ struct hid_item { | |||
252 | #define HID_OUTPUT_REPORT 1 | 252 | #define HID_OUTPUT_REPORT 1 |
253 | #define HID_FEATURE_REPORT 2 | 253 | #define HID_FEATURE_REPORT 2 |
254 | 254 | ||
255 | #define HID_REPORT_TYPES 3 | ||
256 | |||
255 | /* | 257 | /* |
256 | * HID connect requests | 258 | * HID connect requests |
257 | */ | 259 | */ |
@@ -283,6 +285,7 @@ struct hid_item { | |||
283 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | 285 | #define HID_QUIRK_MULTI_INPUT 0x00000040 |
284 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 | 286 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 |
285 | #define HID_QUIRK_NO_EMPTY_INPUT 0x00000100 | 287 | #define HID_QUIRK_NO_EMPTY_INPUT 0x00000100 |
288 | #define HID_QUIRK_NO_INIT_INPUT_REPORTS 0x00000200 | ||
286 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 289 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
287 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 290 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
288 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 | 291 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 |
@@ -295,6 +298,7 @@ struct hid_item { | |||
295 | #define HID_GROUP_GENERIC 0x0001 | 298 | #define HID_GROUP_GENERIC 0x0001 |
296 | #define HID_GROUP_MULTITOUCH 0x0002 | 299 | #define HID_GROUP_MULTITOUCH 0x0002 |
297 | #define HID_GROUP_SENSOR_HUB 0x0003 | 300 | #define HID_GROUP_SENSOR_HUB 0x0003 |
301 | #define HID_GROUP_MULTITOUCH_WIN_8 0x0004 | ||
298 | 302 | ||
299 | /* | 303 | /* |
300 | * This is the global environment of the parser. This information is | 304 | * This is the global environment of the parser. This information is |
@@ -393,14 +397,14 @@ struct hid_report { | |||
393 | struct hid_device *device; /* associated device */ | 397 | struct hid_device *device; /* associated device */ |
394 | }; | 398 | }; |
395 | 399 | ||
400 | #define HID_MAX_IDS 256 | ||
401 | |||
396 | struct hid_report_enum { | 402 | struct hid_report_enum { |
397 | unsigned numbered; | 403 | unsigned numbered; |
398 | struct list_head report_list; | 404 | struct list_head report_list; |
399 | struct hid_report *report_id_hash[256]; | 405 | struct hid_report *report_id_hash[HID_MAX_IDS]; |
400 | }; | 406 | }; |
401 | 407 | ||
402 | #define HID_REPORT_TYPES 3 | ||
403 | |||
404 | #define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ | 408 | #define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ |
405 | #define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ | 409 | #define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ |
406 | #define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ | 410 | #define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ |
@@ -456,6 +460,7 @@ struct hid_device { /* device report descriptor */ | |||
456 | enum hid_type type; /* device type (mouse, kbd, ...) */ | 460 | enum hid_type type; /* device type (mouse, kbd, ...) */ |
457 | unsigned country; /* HID country */ | 461 | unsigned country; /* HID country */ |
458 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | 462 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; |
463 | struct work_struct led_work; /* delayed LED worker */ | ||
459 | 464 | ||
460 | struct semaphore driver_lock; /* protects the current driver, except during input */ | 465 | struct semaphore driver_lock; /* protects the current driver, except during input */ |
461 | struct semaphore driver_input_lock; /* protects the current driver */ | 466 | struct semaphore driver_input_lock; /* protects the current driver */ |
@@ -532,6 +537,8 @@ static inline void hid_set_drvdata(struct hid_device *hdev, void *data) | |||
532 | #define HID_GLOBAL_STACK_SIZE 4 | 537 | #define HID_GLOBAL_STACK_SIZE 4 |
533 | #define HID_COLLECTION_STACK_SIZE 4 | 538 | #define HID_COLLECTION_STACK_SIZE 4 |
534 | 539 | ||
540 | #define HID_SCAN_FLAG_MT_WIN_8 0x00000001 | ||
541 | |||
535 | struct hid_parser { | 542 | struct hid_parser { |
536 | struct hid_global global; | 543 | struct hid_global global; |
537 | struct hid_global global_stack[HID_GLOBAL_STACK_SIZE]; | 544 | struct hid_global global_stack[HID_GLOBAL_STACK_SIZE]; |
@@ -540,6 +547,7 @@ struct hid_parser { | |||
540 | unsigned collection_stack[HID_COLLECTION_STACK_SIZE]; | 547 | unsigned collection_stack[HID_COLLECTION_STACK_SIZE]; |
541 | unsigned collection_stack_ptr; | 548 | unsigned collection_stack_ptr; |
542 | struct hid_device *device; | 549 | struct hid_device *device; |
550 | unsigned scan_flags; | ||
543 | }; | 551 | }; |
544 | 552 | ||
545 | struct hid_class_descriptor { | 553 | struct hid_class_descriptor { |
@@ -744,6 +752,7 @@ struct hid_field *hidinput_get_led_field(struct hid_device *hid); | |||
744 | unsigned int hidinput_count_leds(struct hid_device *hid); | 752 | unsigned int hidinput_count_leds(struct hid_device *hid); |
745 | __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); | 753 | __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); |
746 | void hid_output_report(struct hid_report *report, __u8 *data); | 754 | void hid_output_report(struct hid_report *report, __u8 *data); |
755 | u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags); | ||
747 | struct hid_device *hid_allocate_device(void); | 756 | struct hid_device *hid_allocate_device(void); |
748 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); | 757 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); |
749 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 758 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
@@ -989,7 +998,6 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | |||
989 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); | 998 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); |
990 | int usbhid_quirks_init(char **quirks_param); | 999 | int usbhid_quirks_init(char **quirks_param); |
991 | void usbhid_quirks_exit(void); | 1000 | void usbhid_quirks_exit(void); |
992 | void usbhid_set_leds(struct hid_device *hid); | ||
993 | 1001 | ||
994 | #ifdef CONFIG_HID_PID | 1002 | #ifdef CONFIG_HID_PID |
995 | int hid_pidff_init(struct hid_device *hid); | 1003 | int hid_pidff_init(struct hid_device *hid); |
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h index 2451662c728a..ddf52612eed8 100644 --- a/include/linux/hidraw.h +++ b/include/linux/hidraw.h | |||
@@ -23,6 +23,7 @@ struct hidraw { | |||
23 | wait_queue_head_t wait; | 23 | wait_queue_head_t wait; |
24 | struct hid_device *hid; | 24 | struct hid_device *hid; |
25 | struct device *dev; | 25 | struct device *dev; |
26 | spinlock_t list_lock; | ||
26 | struct list_head list; | 27 | struct list_head list; |
27 | }; | 28 | }; |
28 | 29 | ||
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h index 60e411d764d4..7aa901d92058 100644 --- a/include/linux/i2c/i2c-hid.h +++ b/include/linux/i2c/i2c-hid.h | |||
@@ -19,7 +19,8 @@ | |||
19 | * @hid_descriptor_address: i2c register where the HID descriptor is stored. | 19 | * @hid_descriptor_address: i2c register where the HID descriptor is stored. |
20 | * | 20 | * |
21 | * Note that it is the responsibility of the platform driver (or the acpi 5.0 | 21 | * Note that it is the responsibility of the platform driver (or the acpi 5.0 |
22 | * driver) to setup the irq related to the gpio in the struct i2c_board_info. | 22 | * driver, or the flattened device tree) to setup the irq related to the gpio in |
23 | * the struct i2c_board_info. | ||
23 | * The platform driver should also setup the gpio according to the device: | 24 | * The platform driver should also setup the gpio according to the device: |
24 | * | 25 | * |
25 | * A typical example is the following: | 26 | * A typical example is the following: |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 45e921401b06..329aa307cb77 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -277,7 +277,7 @@ struct pcmcia_device_id { | |||
277 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 | 277 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 |
278 | #define INPUT_DEVICE_ID_KEY_MAX 0x2ff | 278 | #define INPUT_DEVICE_ID_KEY_MAX 0x2ff |
279 | #define INPUT_DEVICE_ID_REL_MAX 0x0f | 279 | #define INPUT_DEVICE_ID_REL_MAX 0x0f |
280 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f | 280 | #define INPUT_DEVICE_ID_ABS_MAX 0x4f |
281 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 | 281 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 |
282 | #define INPUT_DEVICE_ID_LED_MAX 0x0f | 282 | #define INPUT_DEVICE_ID_LED_MAX 0x0f |
283 | #define INPUT_DEVICE_ID_SND_MAX 0x07 | 283 | #define INPUT_DEVICE_ID_SND_MAX 0x07 |
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index d584047b072b..76457eef172a 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h | |||
@@ -716,6 +716,14 @@ struct input_keymap_entry { | |||
716 | #define BTN_DPAD_LEFT 0x222 | 716 | #define BTN_DPAD_LEFT 0x222 |
717 | #define BTN_DPAD_RIGHT 0x223 | 717 | #define BTN_DPAD_RIGHT 0x223 |
718 | 718 | ||
719 | #define BTN_FRET_FAR_UP 0x224 | ||
720 | #define BTN_FRET_UP 0x225 | ||
721 | #define BTN_FRET_MID 0x226 | ||
722 | #define BTN_FRET_LOW 0x227 | ||
723 | #define BTN_FRET_FAR_LOW 0x228 | ||
724 | #define BTN_STRUM_BAR_UP 0x229 | ||
725 | #define BTN_STRUM_BAR_DOWN 0x22a | ||
726 | |||
719 | #define BTN_TRIGGER_HAPPY 0x2c0 | 727 | #define BTN_TRIGGER_HAPPY 0x2c0 |
720 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 728 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
721 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 729 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
@@ -829,8 +837,21 @@ struct input_keymap_entry { | |||
829 | #define ABS_MT_TOOL_X 0x3c /* Center X tool position */ | 837 | #define ABS_MT_TOOL_X 0x3c /* Center X tool position */ |
830 | #define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ | 838 | #define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ |
831 | 839 | ||
832 | 840 | /* Drums and guitars (mostly toys) */ | |
833 | #define ABS_MAX 0x3f | 841 | #define ABS_TOM_FAR_LEFT 0x40 |
842 | #define ABS_TOM_LEFT 0x41 | ||
843 | #define ABS_TOM_RIGHT 0x42 | ||
844 | #define ABS_TOM_FAR_RIGHT 0x43 | ||
845 | #define ABS_CYMBAL_FAR_LEFT 0x44 | ||
846 | #define ABS_CYMBAL_LEFT 0x45 | ||
847 | #define ABS_CYMBAL_RIGHT 0x46 | ||
848 | #define ABS_CYMBAL_FAR_RIGHT 0x47 | ||
849 | #define ABS_BASS 0x48 | ||
850 | #define ABS_HI_HAT 0x49 | ||
851 | #define ABS_FRET_BOARD 0x4a /* Guitar fret board, vertical pos */ | ||
852 | #define ABS_WHAMMY_BAR 0x4b /* Guitar whammy bar (or vibrato) */ | ||
853 | |||
854 | #define ABS_MAX 0x4f | ||
834 | #define ABS_CNT (ABS_MAX+1) | 855 | #define ABS_CNT (ABS_MAX+1) |
835 | 856 | ||
836 | /* | 857 | /* |
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h index e9ed951e2b09..414b74be4da1 100644 --- a/include/uapi/linux/uhid.h +++ b/include/uapi/linux/uhid.h | |||
@@ -30,7 +30,7 @@ enum uhid_event_type { | |||
30 | UHID_OPEN, | 30 | UHID_OPEN, |
31 | UHID_CLOSE, | 31 | UHID_CLOSE, |
32 | UHID_OUTPUT, | 32 | UHID_OUTPUT, |
33 | UHID_OUTPUT_EV, | 33 | UHID_OUTPUT_EV, /* obsolete! */ |
34 | UHID_INPUT, | 34 | UHID_INPUT, |
35 | UHID_FEATURE, | 35 | UHID_FEATURE, |
36 | UHID_FEATURE_ANSWER, | 36 | UHID_FEATURE_ANSWER, |
@@ -69,6 +69,8 @@ struct uhid_output_req { | |||
69 | __u8 rtype; | 69 | __u8 rtype; |
70 | } __attribute__((__packed__)); | 70 | } __attribute__((__packed__)); |
71 | 71 | ||
72 | /* Obsolete! Newer kernels will no longer send these events but instead convert | ||
73 | * it into raw output reports via UHID_OUTPUT. */ | ||
72 | struct uhid_output_ev_req { | 74 | struct uhid_output_ev_req { |
73 | __u16 type; | 75 | __u16 type; |
74 | __u16 code; | 76 | __u16 code; |