mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
bdb829e1dd
commit
50c9d75b6f
2 changed files with 80 additions and 1 deletions
|
@ -456,6 +456,7 @@ struct hid_device { /* device report descriptor */
|
|||
enum hid_type type; /* device type (mouse, kbd, ...) */
|
||||
unsigned country; /* HID country */
|
||||
struct hid_report_enum report_enum[HID_REPORT_TYPES];
|
||||
struct work_struct led_work; /* delayed LED worker */
|
||||
|
||||
struct semaphore driver_lock; /* protects the current driver, except during input */
|
||||
struct semaphore driver_input_lock; /* protects the current driver */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue