aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-core.c6
-rw-r--r--drivers/usb/input/hid-core.c3
-rw-r--r--include/linux/hid.h8
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8474a7923322..1dd9e4f0df1e 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -819,8 +819,8 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field, s
819 hid_dump_input(usage, value); 819 hid_dump_input(usage, value);
820 if (hid->claimed & HID_CLAIMED_INPUT) 820 if (hid->claimed & HID_CLAIMED_INPUT)
821 hidinput_hid_event(hid, field, usage, value); 821 hidinput_hid_event(hid, field, usage, value);
822 if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt) 822 if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt && hid->hiddev_hid_event)
823 hiddev_hid_event(hid, field, usage, value); 823 hid->hiddev_hid_event(hid, field, usage, value);
824} 824}
825 825
826/* 826/*
@@ -940,3 +940,5 @@ int hid_set_field(struct hid_field *field, unsigned offset, __s32 value)
940} 940}
941EXPORT_SYMBOL_GPL(hid_set_field); 941EXPORT_SYMBOL_GPL(hid_set_field);
942 942
943MODULE_LICENSE(DRIVER_LICENSE);
944
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 0991c4b751a6..4fc828041d0f 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1284,6 +1284,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1284 hid->hidinput_input_event = usb_hidinput_input_event; 1284 hid->hidinput_input_event = usb_hidinput_input_event;
1285 hid->hidinput_open = hidinput_open; 1285 hid->hidinput_open = hidinput_open;
1286 hid->hidinput_close = hidinput_close; 1286 hid->hidinput_close = hidinput_close;
1287#ifdef CONFIG_USB_HIDDEV
1288 hid->hiddev_hid_event = hiddev_hid_event;
1289#endif
1287 1290
1288 return hid; 1291 return hid;
1289 1292
diff --git a/include/linux/hid.h b/include/linux/hid.h
index fc6f74228da3..5a969a137b85 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -433,6 +433,10 @@ struct hid_device { /* device report descriptor */
433 int (*hidinput_open) (struct input_dev *); 433 int (*hidinput_open) (struct input_dev *);
434 void (*hidinput_close) (struct input_dev *); 434 void (*hidinput_close) (struct input_dev *);
435 435
436 /* hiddev event handler */
437 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
438 struct hid_usage *, __s32);
439
436#ifdef CONFIG_USB_HIDINPUT_POWERBOOK 440#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
437 unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; 441 unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
438 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; 442 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
@@ -477,13 +481,9 @@ struct hid_descriptor {
477#define resolv_event(a,b) do { } while (0) 481#define resolv_event(a,b) do { } while (0)
478#endif 482#endif
479 483
480#ifdef CONFIG_HID
481/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ 484/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
482/* We ignore a few input applications that are not widely used */ 485/* We ignore a few input applications that are not widely used */
483#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) 486#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
484#else
485#define IS_INPUT_APPLICATION(a) (0)
486#endif
487 487
488/* HID core API */ 488/* HID core API */
489extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 489extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);