aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-07-15 13:10:12 -0400
committerJiri Kosina <jkosina@suse.cz>2013-07-31 05:02:02 -0400
commit50c9d75b6f01a337aab728511bc1d2a0a3d7b800 (patch)
tree87f3ef456925f5bb0b65222a09b47a47fbc1d9c5 /include
parentbdb829e1dd710029a075b5f86d4053e7715beb06 (diff)
HID: input: generic hidinput_input_event handler
The hidinput_input_event() callback converts input events written from userspace into HID reports and sends them to the device. We currently implement this in every HID transport driver, even though most of them do the same. This provides a generic hidinput_input_event() implementation which is mostly copied from usbhid. It uses a delayed worker to allow multiple LED events to be collected into a single output event. We use the custom ->request() transport driver callback to allow drivers to adjust the outgoing report and handle the request asynchronously. If no custom ->request() callback is available, we fall back to the generic raw output report handler (which is synchronous). Drivers can still provide custom hidinput_input_event() handlers (see logitech-dj) if the generic implementation doesn't fit their needs. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hid.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index b8058c5c5594..ea4b828cb9cd 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -456,6 +456,7 @@ struct hid_device { /* device report descriptor */
456 enum hid_type type; /* device type (mouse, kbd, ...) */ 456 enum hid_type type; /* device type (mouse, kbd, ...) */
457 unsigned country; /* HID country */ 457 unsigned country; /* HID country */
458 struct hid_report_enum report_enum[HID_REPORT_TYPES]; 458 struct hid_report_enum report_enum[HID_REPORT_TYPES];
459 struct work_struct led_work; /* delayed LED worker */
459 460
460 struct semaphore driver_lock; /* protects the current driver, except during input */ 461 struct semaphore driver_lock; /* protects the current driver, except during input */
461 struct semaphore driver_input_lock; /* protects the current driver */ 462 struct semaphore driver_input_lock; /* protects the current driver */