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.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 770120add15a..37076b116ed0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * Copyright (c) 1999 Andreas Gal 7 * Copyright (c) 1999 Andreas Gal
8 * Copyright (c) 2000-2001 Vojtech Pavlik 8 * Copyright (c) 2000-2001 Vojtech Pavlik
9 * Copyright (c) 2006 Jiri Kosina 9 * Copyright (c) 2006-2007 Jiri Kosina
10 */ 10 */
11 11
12/* 12/*
@@ -247,6 +247,11 @@ struct hid_item {
247 * HID device quirks. 247 * HID device quirks.
248 */ 248 */
249 249
250/*
251 * Increase this if you need to configure more HID quirks at module load time
252 */
253#define MAX_USBHID_BOOT_QUIRKS 4
254
250#define HID_QUIRK_INVERT 0x00000001 255#define HID_QUIRK_INVERT 0x00000001
251#define HID_QUIRK_NOTOUCH 0x00000002 256#define HID_QUIRK_NOTOUCH 0x00000002
252#define HID_QUIRK_IGNORE 0x00000004 257#define HID_QUIRK_IGNORE 0x00000004
@@ -264,6 +269,12 @@ struct hid_item {
264#define HID_QUIRK_INVERT_HWHEEL 0x00004000 269#define HID_QUIRK_INVERT_HWHEEL 0x00004000
265#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 270#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
266#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 271#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000
272#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000
273#define HID_QUIRK_IGNORE_MOUSE 0x00040000
274#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000
275#define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000
276#define HID_QUIRK_DUPLICATE_USAGES 0x00200000
277#define HID_QUIRK_RESET_LEDS 0x00400000
267 278
268/* 279/*
269 * This is the global environment of the parser. This information is 280 * This is the global environment of the parser. This information is
@@ -289,7 +300,7 @@ struct hid_global {
289 */ 300 */
290 301
291#define HID_MAX_DESCRIPTOR_SIZE 4096 302#define HID_MAX_DESCRIPTOR_SIZE 4096
292#define HID_MAX_USAGES 1024 303#define HID_MAX_USAGES 8192
293#define HID_DEFAULT_NUM_COLLECTIONS 16 304#define HID_DEFAULT_NUM_COLLECTIONS 16
294 305
295struct hid_local { 306struct hid_local {
@@ -430,15 +441,14 @@ struct hid_device { /* device report descriptor */
430 441
431 /* device-specific function pointers */ 442 /* device-specific function pointers */
432 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); 443 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
433 int (*hidinput_open) (struct input_dev *); 444 int (*hid_open) (struct hid_device *);
434 void (*hidinput_close) (struct input_dev *); 445 void (*hid_close) (struct hid_device *);
435 446
436 /* hiddev event handler */ 447 /* hiddev event handler */
437 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 448 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
438 struct hid_usage *, __s32); 449 struct hid_usage *, __s32);
439 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 450 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
440#ifdef CONFIG_USB_HIDINPUT_POWERBOOK 451#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
441 unsigned int pb_fnmode;
442 unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; 452 unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
443 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; 453 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
444#endif 454#endif
@@ -472,16 +482,6 @@ struct hid_descriptor {
472 struct hid_class_descriptor desc[1]; 482 struct hid_class_descriptor desc[1];
473} __attribute__ ((packed)); 483} __attribute__ ((packed));
474 484
475#ifdef DEBUG
476#include "hid-debug.h"
477#else
478#define hid_dump_input(a,b) do { } while (0)
479#define hid_dump_device(c) do { } while (0)
480#define hid_dump_field(a,b) do { } while (0)
481#define resolv_usage(a) do { } while (0)
482#define resolv_event(a,b) do { } while (0)
483#endif
484
485/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ 485/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
486/* We ignore a few input applications that are not widely used */ 486/* We ignore a few input applications that are not widely used */
487#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) 487#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
@@ -500,10 +500,17 @@ void hid_output_report(struct hid_report *report, __u8 *data);
500void hid_free_device(struct hid_device *device); 500void hid_free_device(struct hid_device *device);
501struct hid_device *hid_parse_report(__u8 *start, unsigned size); 501struct hid_device *hid_parse_report(__u8 *start, unsigned size);
502 502
503/* HID quirks API */
504u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
505int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks);
506int usbhid_quirks_init(char **quirks_param);
507void usbhid_quirks_exit(void);
508
503#ifdef CONFIG_HID_FF 509#ifdef CONFIG_HID_FF
504int hid_ff_init(struct hid_device *hid); 510int hid_ff_init(struct hid_device *hid);
505 511
506int hid_lgff_init(struct hid_device *hid); 512int hid_lgff_init(struct hid_device *hid);
513int hid_plff_init(struct hid_device *hid);
507int hid_tmff_init(struct hid_device *hid); 514int hid_tmff_init(struct hid_device *hid);
508int hid_zpff_init(struct hid_device *hid); 515int hid_zpff_init(struct hid_device *hid);
509#ifdef CONFIG_HID_PID 516#ifdef CONFIG_HID_PID