]> git.baikalelectronics.ru Git - kernel.git/commit
HID: input: generic hidinput_input_event handler
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 15 Jul 2013 17:10:12 +0000 (19:10 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 31 Jul 2013 09:02:02 +0000 (11:02 +0200)
commit3728ea94c46eea231bf2f3f7c3093775623e0d54
tree87f3ef456925f5bb0b65222a09b47a47fbc1d9c5
parent78a9f59274cb3475603c2e93d65d7075b1ecc9d9
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>
drivers/hid/hid-input.c
include/linux/hid.h