From: Jiri Kosina <[EMAIL PROTECTED]>
- hiddev is USB-only (agreed with Marcel Holtmann that Bluetooth currently
doesn't need it, and future planned interface (rawhid) will be more flexible
and usable)
- both HID and USB-hid can be now compiled as modules (wasn't possible before
hiddev was fully separated from generic HID layer)
Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]>
Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
Cc: Dmitry Torokhov <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
drivers/hid/hid-core.c | 6 ++++--
drivers/usb/input/hid-core.c | 3 +++
include/linux/hid.h | 8 ++++----
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8474a79..1dd9e4f 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -819,8 +819,8 @@ static void hid_process_event(struct hid
hid_dump_input(usage, value);
if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_hid_event(hid, field, usage, value);
- if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt)
- hiddev_hid_event(hid, field, usage, value);
+ if (hid->claimed & HID_CLAIMED_HIDDEV && interrupt &&
hid->hiddev_hid_event)
+ hid->hiddev_hid_event(hid, field, usage, value);
}
/*
@@ -940,3 +940,5 @@ int hid_set_field(struct hid_field *fiel
}
EXPORT_SYMBOL_GPL(hid_set_field);
+MODULE_LICENSE(DRIVER_LICENSE);
+
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 0991c4b..4fc8280 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_config
hid->hidinput_input_event = usb_hidinput_input_event;
hid->hidinput_open = hidinput_open;
hid->hidinput_close = hidinput_close;
+#ifdef CONFIG_USB_HIDDEV
+ hid->hiddev_hid_event = hiddev_hid_event;
+#endif
return hid;
diff --git a/include/linux/hid.h b/include/linux/hid.h
index fc6f742..5a969a1 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -433,6 +433,10 @@ struct hid_device {
/* device repo
int (*hidinput_open) (struct input_dev *);
void (*hidinput_close) (struct input_dev *);
+ /* hiddev event handler */
+ void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
+ struct hid_usage *, __s32);
+
#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
@@ -477,13 +481,9 @@ struct hid_descriptor {
#define resolv_event(a,b) do { } while (0)
#endif
-#ifdef CONFIG_HID
/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
/* We ignore a few input applications that are not widely used */
#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) ||
(a == 0x00010080) || (a == 0x000c0001))
-#else
-#define IS_INPUT_APPLICATION(a) (0)
-#endif
/* HID core API */
extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct
hid_usage *, __s32);
--
1.4.4.1
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel