mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
HID: uhid: forward open/close events to user-space
HID core notifies us with *_open/*_close callbacks when there is an actual user of our device. We forward these to user-space so they can react on this. This allows user-space to skip I/O unless they receive an OPEN event. When they receive a CLOSE event they can stop I/O again to save energy. Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
ec4b7dea45
commit
e7191474a5
2 changed files with 8 additions and 1 deletions
|
|
@ -97,11 +97,16 @@ static void uhid_hid_stop(struct hid_device *hid)
|
|||
|
||||
static int uhid_hid_open(struct hid_device *hid)
|
||||
{
|
||||
return 0;
|
||||
struct uhid_device *uhid = hid->driver_data;
|
||||
|
||||
return uhid_queue_event(uhid, UHID_OPEN);
|
||||
}
|
||||
|
||||
static void uhid_hid_close(struct hid_device *hid)
|
||||
{
|
||||
struct uhid_device *uhid = hid->driver_data;
|
||||
|
||||
uhid_queue_event(uhid, UHID_CLOSE);
|
||||
}
|
||||
|
||||
static int uhid_hid_input(struct input_dev *input, unsigned int type,
|
||||
|
|
|
|||
Loading…
Reference in a new issue