aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 7330a0fef0c0..e14b465b1146 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -589,6 +589,7 @@ struct hid_usage_id {
589 * @raw_event: if report in report_table, this hook is called (NULL means nop) 589 * @raw_event: if report in report_table, this hook is called (NULL means nop)
590 * @usage_table: on which events to call event (NULL means all) 590 * @usage_table: on which events to call event (NULL means all)
591 * @event: if usage in usage_table, this hook is called (NULL means nop) 591 * @event: if usage in usage_table, this hook is called (NULL means nop)
592 * @report: this hook is called after parsing a report (NULL means nop)
592 * @report_fixup: called before report descriptor parsing (NULL means nop) 593 * @report_fixup: called before report descriptor parsing (NULL means nop)
593 * @input_mapping: invoked on input registering before mapping an usage 594 * @input_mapping: invoked on input registering before mapping an usage
594 * @input_mapped: invoked on input registering after mapping an usage 595 * @input_mapped: invoked on input registering after mapping an usage
@@ -627,6 +628,7 @@ struct hid_driver {
627 const struct hid_usage_id *usage_table; 628 const struct hid_usage_id *usage_table;
628 int (*event)(struct hid_device *hdev, struct hid_field *field, 629 int (*event)(struct hid_device *hdev, struct hid_field *field,
629 struct hid_usage *usage, __s32 value); 630 struct hid_usage *usage, __s32 value);
631 void (*report)(struct hid_device *hdev, struct hid_report *report);
630 632
631 __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, 633 __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
632 unsigned int *size); 634 unsigned int *size);
@@ -700,6 +702,18 @@ extern int __must_check __hid_register_driver(struct hid_driver *,
700 702
701extern void hid_unregister_driver(struct hid_driver *); 703extern void hid_unregister_driver(struct hid_driver *);
702 704
705/**
706 * module_hid_driver() - Helper macro for registering a HID driver
707 * @__hid_driver: hid_driver struct
708 *
709 * Helper macro for HID drivers which do not do anything special in module
710 * init/exit. This eliminates a lot of boilerplate. Each module may only
711 * use this macro once, and calling it replaces module_init() and module_exit()
712 */
713#define module_hid_driver(__hid_driver) \
714 module_driver(__hid_driver, hid_register_driver, \
715 hid_unregister_driver)
716
703extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 717extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
704extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); 718extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
705extern int hidinput_connect(struct hid_device *hid, unsigned int force); 719extern int hidinput_connect(struct hid_device *hid, unsigned int force);
@@ -872,9 +886,6 @@ static inline int hid_hw_power(struct hid_device *hdev, int level)
872int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, 886int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
873 int interrupt); 887 int interrupt);
874 888
875extern int hid_generic_init(void);
876extern void hid_generic_exit(void);
877
878/* HID quirks API */ 889/* HID quirks API */
879u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); 890u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
880int usbhid_quirks_init(char **quirks_param); 891int usbhid_quirks_init(char **quirks_param);