diff options
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 36 |
1 files changed, 18 insertions, 18 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); |