HID: Export hid_register_field
PATCH 1/3 HID: Export hid_register_field
The Apple Magic Mouse (and probably other devices) publish reports that are not called out in their HID report descriptors -- they only send them when enabled through other writes to the devices. Exporting hid_register_report is not sufficient as the given report is empty.
As the hid parser does not know the new fields, the driver has to register them manually. This allows the driver to manually register the different fields.
Signed-off-by Benjamin Tissoires <[email protected]>
--- drivers/hid/hid-core.c | 3 ++- include/linux/hid.h | 1 + 2 files changed, 3 insertions(+), 1 deletions(-)
drivers/hid/hid-core.c +2 -1
@@ -83,7 +83,7 @@ EXPORT_SYMBOL_GPL(hid_register_report);* Register a new field for this report. */ -static struct hid_field *hid_register_field (struct hid_report *report,unsigned usages,unsigned values) +struct hid_field *hid_register_field (struct hid_report *report,unsigned usages,unsigned values) {struct hid_field *field;
@@ -103,6 +103,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsignedreturn field; } +EXPORT_SYMBOL_GPL (hid_register_field);/* * Open a collection. The type/usage is pushed on the stack.
include/linux/hid.h +1 -0
@@ -691,6 +691,7 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned intvoid hid_output_report (struct hid_report *report,__u8 *data);struct hid_device *hid_allocate_device (void );struct hid_report *hid_register_report (struct hid_device *device,unsigned type,unsigned id); +struct hid_field *hid_register_field (struct hid_report *report,unsigned usages,unsigned values);int hid_parse_report (struct hid_device *hid,__u8 *start,unsigned size);int hid_check_keys_pressed (struct hid_device *hid);int hid_connect (struct hid_device *hid,unsigned int connect_mask);
-- 1.6.6.1