diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-06 12:30:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-06 12:30:36 -0400 |
commit | 22e04f6b4b04a8afe9af9239224591d06ba3b24d (patch) | |
tree | 9bb72350400153ab232e227a378f94e95ad27569 /include/linux | |
parent | ec0ad730802173ec17e942f4b652a1819b1025b2 (diff) | |
parent | 4e5a494e4b4ba7e6aa1a8a285e98e3665fcb396e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina:
"Highlights:
- conversion of HID subsystem to use devm-based resource management,
from Benjamin Tissoires
- i2c-hid support for DT bindings, from Benjamin Tissoires
- much improved support for Win8-multitouch devices, from Benjamin
Tissoires
- cleanup of core code using common hidinput_input_event(), from
David Herrmann
- fix for bug in implement() access to the bit stream (causing oops)
that has been present in the code for ages, but devices that are
able to trigger it have started to appear only now, from Jiri
Kosina
- fixes for CVE-2013-2899, CVE-2013-2898, CVE-2013-2896,
CVE-2013-2892, CVE-2013-2888 (all triggerable only by specially
crafted malicious HW devices plugged into the system), from Kees
Cook
- hidraw oops fix, from Manoj Chourasia
- various smaller fixes here and there, support for a bunch of new
devices by various contributors"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (53 commits)
HID: MAINTAINERS: add roccat drivers
HID: hid-sensor-hub: change kmalloc + memcpy by kmemdup
HID: hid-sensor-hub: move to devm_kzalloc
HID: hid-sensor-hub: fix indentation accross the code
HID: move HID_REPORT_TYPES closer to the report-definitions
HID: check for NULL field when setting values
HID: picolcd_core: validate output report details
HID: sensor-hub: validate feature report details
HID: ntrig: validate feature report details
HID: pantherlord: validate output report details
HID: hid-wiimote: print small buffers via %*phC
HID: uhid: improve uhid example client
HID: Correct the USB IDs for the new Macbook Air 6
HID: wiimote: add support for Guitar-Hero guitars
HID: wiimote: add support for Guitar-Hero drums
Input: introduce BTN/ABS bits for drums and guitars
HID: battery: don't do DMA from stack
HID: roccat: add support for KonePureOptical v2
HID: picolcd: Prevent NULL pointer dereference on _remove()
HID: usbhid: quirk for N-Trig DuoSense Touch Screen
...
Diffstat (limited to 'include/linux')
-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 |
6 files changed, 18 insertions, 8 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 |