aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-06-19 08:09:14 -0400
committerJiri Kosina <jkosina@suse.cz>2007-07-09 08:13:34 -0400
commitea9a4a8b0e5a34eca6613e39d21be879d92ecff5 (patch)
treef9e816b5a7719e0528b2c0426aeac6d32d7b422f /include/linux/hid.h
parentb8e98f1c47b743e56f8ebe21006199cefd577ce5 (diff)
HID: separate quirks for report descriptor fixup
Lately there have been quite a lot of bug reports against broken devices which require us to fix their report descriptor in the runtime, before it is passed to the HID parser. Those devices have eaten quite an amount of our quirks space, which isn't particularly necessary - the quirks are not needed after the report descriptor is parsed, and they just consume bits. Therefore this patch separates the quirks for report descriptor fixup, and moves their handling into separate code. The quirks are then forgotten as soon as the report descriptor has been parsed. Module parameter 'rdesc_quirks' is introduced to be able to modify these quirks in runtime in a similar way to 'quirks' parameter for ordinary HID quirks. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index e41067951dd9..4daf5eea78a1 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -263,21 +263,26 @@ struct hid_item {
263#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 263#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
264#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 264#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
265#define HID_QUIRK_MIGHTYMOUSE 0x00000400 265#define HID_QUIRK_MIGHTYMOUSE 0x00000400
266#define HID_QUIRK_CYMOTION 0x00000800 266#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800
267#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 267#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000
268#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 268#define HID_QUIRK_INVERT_HWHEEL 0x00002000
269#define HID_QUIRK_INVERT_HWHEEL 0x00004000 269#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000
270#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 270#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000
271#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 271#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
272#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 272#define HID_QUIRK_IGNORE_MOUSE 0x00020000
273#define HID_QUIRK_IGNORE_MOUSE 0x00040000 273#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000
274#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 274#define HID_QUIRK_DUPLICATE_USAGES 0x00080000
275#define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 275#define HID_QUIRK_RESET_LEDS 0x00100000
276#define HID_QUIRK_DUPLICATE_USAGES 0x00200000 276#define HID_QUIRK_HIDINPUT 0x00200000
277#define HID_QUIRK_RESET_LEDS 0x00400000 277
278#define HID_QUIRK_SWAPPED_MIN_MAX 0x00800000 278/*
279#define HID_QUIRK_HIDINPUT 0x01000000 279 * Separate quirks for runtime report descriptor fixup
280#define HID_QUIRK_PETALYNX_DESCRIPTOR 0x02000000 280 */
281
282#define HID_QUIRK_RDESC_CYMOTION 0x00000001
283#define HID_QUIRK_RDESC_LOGITECH 0x00000002
284#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
285#define HID_QUIRK_RDESC_PETALYNX 0x00000008
281 286
282/* 287/*
283 * This is the global environment of the parser. This information is 288 * This is the global environment of the parser. This information is
@@ -508,6 +513,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
508int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); 513int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks);
509int usbhid_quirks_init(char **quirks_param); 514int usbhid_quirks_init(char **quirks_param);
510void usbhid_quirks_exit(void); 515void usbhid_quirks_exit(void);
516void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **);
511 517
512#ifdef CONFIG_HID_FF 518#ifdef CONFIG_HID_FF
513int hid_ff_init(struct hid_device *hid); 519int hid_ff_init(struct hid_device *hid);