diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 22:21:48 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 22:21:48 -0400 |
| commit | 3c2c4b73aa79e4a1b601710b59e092441175f4bb (patch) | |
| tree | fbd08c3e18517871b25fe9c886caae423947d578 /include | |
| parent | f08b9c2f8af0d61faa1170aeae4fbca1eff6a504 (diff) | |
| parent | 99ce58ddc4eadec8c35d9a1d64ff57703fdcfacc (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID subsystem updates from Jiri Kosina:
"Apart from various driver updates and added support for a number of
new devices (mostly multitouch ones, but not limited to), there is one
change that is worth pointing out explicitly: creation of HID device
groups and proper autoloading of hid-multitouch, implemented by Henrik
Rydberg."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (50 commits)
HID: wacom: fix build breakage without CONFIG_LEDS_CLASS
HID: waltop: Extend barrel button fix
HID: hyperv: Set the hid drvdata correctly
HID: wacom: Unify speed setting
HID: wacom: Add speed setting for Intuos4 WL
HID: wacom: Move Graphire raport header check.
HID: uclogic: Add support for UC-Logic TWHL850
HID: explain the signed/unsigned handling in hid_add_field()
HID: handle logical min/max signedness properly in parser
HID: logitech: read all 32 bits of report type bitfield
HID: wacom: Add LED selector control for Wacom Intuos4 WL
HID: hid-multitouch: fix wrong protocol detection
HID: wiimote: Fix IR data parser
HID: wacom: Add tilt reporting for Intuos4 WL
HID: multitouch: MT interface matching for Baanto
HID: hid-multitouch: Only match MT interfaces
HID: Create a common generic driver
HID: hid-multitouch: Switch to device groups
HID: Create a generic device group
HID: Allow bus wildcard matching
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hid.h | 36 | ||||
| -rw-r--r-- | include/linux/hidraw.h | 4 | ||||
| -rw-r--r-- | include/linux/mod_devicetable.h | 4 |
3 files changed, 23 insertions, 21 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 3a95da60fd3e..449fa385703d 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -317,7 +317,6 @@ struct hid_item { | |||
| 317 | #define HID_QUIRK_BADPAD 0x00000020 | 317 | #define HID_QUIRK_BADPAD 0x00000020 |
| 318 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | 318 | #define HID_QUIRK_MULTI_INPUT 0x00000040 |
| 319 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 | 319 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 |
| 320 | #define HID_QUIRK_MULTITOUCH 0x00000100 | ||
| 321 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 320 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
| 322 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 321 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
| 323 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 | 322 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 |
| @@ -325,6 +324,12 @@ struct hid_item { | |||
| 325 | #define HID_QUIRK_NO_INPUT_SYNC 0x80000000 | 324 | #define HID_QUIRK_NO_INPUT_SYNC 0x80000000 |
| 326 | 325 | ||
| 327 | /* | 326 | /* |
| 327 | * HID device groups | ||
| 328 | */ | ||
| 329 | #define HID_GROUP_GENERIC 0x0001 | ||
| 330 | #define HID_GROUP_MULTITOUCH 0x0002 | ||
| 331 | |||
| 332 | /* | ||
| 328 | * This is the global environment of the parser. This information is | 333 | * This is the global environment of the parser. This information is |
| 329 | * persistent for main-items. The global environment can be saved and | 334 | * persistent for main-items. The global environment can be saved and |
| 330 | * restored with PUSH/POP statements. | 335 | * restored with PUSH/POP statements. |
| @@ -467,6 +472,8 @@ struct hid_driver; | |||
| 467 | struct hid_ll_driver; | 472 | struct hid_ll_driver; |
| 468 | 473 | ||
| 469 | struct hid_device { /* device report descriptor */ | 474 | struct hid_device { /* device report descriptor */ |
| 475 | __u8 *dev_rdesc; | ||
| 476 | unsigned dev_rsize; | ||
| 470 | __u8 *rdesc; | 477 | __u8 *rdesc; |
| 471 | unsigned rsize; | 478 | unsigned rsize; |
| 472 | struct hid_collection *collection; /* List of HID collections */ | 479 | struct hid_collection *collection; /* List of HID collections */ |
| @@ -474,6 +481,7 @@ struct hid_device { /* device report descriptor */ | |||
| 474 | unsigned maxcollection; /* Number of parsed collections */ | 481 | unsigned maxcollection; /* Number of parsed collections */ |
| 475 | unsigned maxapplication; /* Number of applications */ | 482 | unsigned maxapplication; /* Number of applications */ |
| 476 | __u16 bus; /* BUS ID */ | 483 | __u16 bus; /* BUS ID */ |
| 484 | __u16 group; /* Report group */ | ||
| 477 | __u32 vendor; /* Vendor ID */ | 485 | __u32 vendor; /* Vendor ID */ |
| 478 | __u32 product; /* Product ID */ | 486 | __u32 product; /* Product ID */ |
| 479 | __u32 version; /* HID version */ | 487 | __u32 version; /* HID version */ |
| @@ -578,12 +586,12 @@ struct hid_descriptor { | |||
| 578 | struct hid_class_descriptor desc[1]; | 586 | struct hid_class_descriptor desc[1]; |
| 579 | } __attribute__ ((packed)); | 587 | } __attribute__ ((packed)); |
| 580 | 588 | ||
| 581 | #define HID_DEVICE(b, ven, prod) \ | 589 | #define HID_DEVICE(b, g, ven, prod) \ |
| 582 | .bus = (b), \ | 590 | .bus = (b), .group = (g), .vendor = (ven), .product = (prod) |
| 583 | .vendor = (ven), .product = (prod) | 591 | #define HID_USB_DEVICE(ven, prod) \ |
| 584 | 592 | .bus = BUS_USB, .vendor = (ven), .product = (prod) | |
| 585 | #define HID_USB_DEVICE(ven, prod) HID_DEVICE(BUS_USB, ven, prod) | 593 | #define HID_BLUETOOTH_DEVICE(ven, prod) \ |
| 586 | #define HID_BLUETOOTH_DEVICE(ven, prod) HID_DEVICE(BUS_BLUETOOTH, ven, prod) | 594 | .bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod) |
| 587 | 595 | ||
| 588 | #define HID_REPORT_ID(rep) \ | 596 | #define HID_REPORT_ID(rep) \ |
| 589 | .report_type = (rep) | 597 | .report_type = (rep) |
| @@ -735,6 +743,7 @@ void hid_output_report(struct hid_report *report, __u8 *data); | |||
| 735 | struct hid_device *hid_allocate_device(void); | 743 | struct hid_device *hid_allocate_device(void); |
| 736 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); | 744 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); |
| 737 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 745 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
| 746 | int hid_open_report(struct hid_device *device); | ||
| 738 | int hid_check_keys_pressed(struct hid_device *hid); | 747 | int hid_check_keys_pressed(struct hid_device *hid); |
| 739 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 748 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
| 740 | void hid_disconnect(struct hid_device *hid); | 749 | void hid_disconnect(struct hid_device *hid); |
| @@ -805,16 +814,7 @@ static inline void hid_map_usage_clear(struct hid_input *hidinput, | |||
| 805 | */ | 814 | */ |
| 806 | static inline int __must_check hid_parse(struct hid_device *hdev) | 815 | static inline int __must_check hid_parse(struct hid_device *hdev) |
| 807 | { | 816 | { |
| 808 | int ret; | 817 | return hid_open_report(hdev); |
| 809 | |||
| 810 | if (hdev->status & HID_STAT_PARSED) | ||
| 811 | return 0; | ||
| 812 | |||
| 813 | ret = hdev->ll_driver->parse(hdev); | ||
| 814 | if (!ret) | ||
| 815 | hdev->status |= HID_STAT_PARSED; | ||
| 816 | |||
| 817 | return ret; | ||
| 818 | } | 818 | } |
| 819 | 819 | ||
| 820 | /** | 820 | /** |
| @@ -896,7 +896,7 @@ static inline int hid_hw_power(struct hid_device *hdev, int level) | |||
| 896 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; | 896 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; |
| 897 | } | 897 | } |
| 898 | 898 | ||
| 899 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 899 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
| 900 | int interrupt); | 900 | int interrupt); |
| 901 | 901 | ||
| 902 | extern int hid_generic_init(void); | 902 | extern int hid_generic_init(void); |
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h index 4b88e697c4e9..45e9fcb8d877 100644 --- a/include/linux/hidraw.h +++ b/include/linux/hidraw.h | |||
| @@ -76,13 +76,13 @@ struct hidraw_list { | |||
| 76 | #ifdef CONFIG_HIDRAW | 76 | #ifdef CONFIG_HIDRAW |
| 77 | int hidraw_init(void); | 77 | int hidraw_init(void); |
| 78 | void hidraw_exit(void); | 78 | void hidraw_exit(void); |
| 79 | void hidraw_report_event(struct hid_device *, u8 *, int); | 79 | int hidraw_report_event(struct hid_device *, u8 *, int); |
| 80 | int hidraw_connect(struct hid_device *); | 80 | int hidraw_connect(struct hid_device *); |
| 81 | void hidraw_disconnect(struct hid_device *); | 81 | void hidraw_disconnect(struct hid_device *); |
| 82 | #else | 82 | #else |
| 83 | static inline int hidraw_init(void) { return 0; } | 83 | static inline int hidraw_init(void) { return 0; } |
| 84 | static inline void hidraw_exit(void) { } | 84 | static inline void hidraw_exit(void) { } |
| 85 | static inline void hidraw_report_event(struct hid_device *hid, u8 *data, int len) { } | 85 | static inline int hidraw_report_event(struct hid_device *hid, u8 *data, int len) { return 0; } |
| 86 | static inline int hidraw_connect(struct hid_device *hid) { return -1; } | 86 | static inline int hidraw_connect(struct hid_device *hid) { return -1; } |
| 87 | static inline void hidraw_disconnect(struct hid_device *hid) { } | 87 | static inline void hidraw_disconnect(struct hid_device *hid) { } |
| 88 | #endif | 88 | #endif |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 501da4cb8a6d..5db93821f9c7 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -132,10 +132,12 @@ struct usb_device_id { | |||
| 132 | #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 | 132 | #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 |
| 133 | 133 | ||
| 134 | #define HID_ANY_ID (~0) | 134 | #define HID_ANY_ID (~0) |
| 135 | #define HID_BUS_ANY 0xffff | ||
| 136 | #define HID_GROUP_ANY 0x0000 | ||
| 135 | 137 | ||
| 136 | struct hid_device_id { | 138 | struct hid_device_id { |
| 137 | __u16 bus; | 139 | __u16 bus; |
| 138 | __u16 pad1; | 140 | __u16 group; |
| 139 | __u32 vendor; | 141 | __u32 vendor; |
| 140 | __u32 product; | 142 | __u32 product; |
| 141 | kernel_ulong_t driver_data | 143 | kernel_ulong_t driver_data |
