diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-06-10 15:16:22 +0200 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-12-05 23:04:11 +0700 |
commit | a226db93d0ea78ccca1357ebf3b445e9863cffa3 (patch) | |
tree | e373fbeef9cf65c0730107590bcc52902ba5e5ee /drivers/hid | |
parent | 3e1bfb9bba890387c798f97d8ffae6a0f1003322 (diff) | |
download | kernel_samsung_aries-a226db93d0ea78ccca1357ebf3b445e9863cffa3.zip kernel_samsung_aries-a226db93d0ea78ccca1357ebf3b445e9863cffa3.tar.gz kernel_samsung_aries-a226db93d0ea78ccca1357ebf3b445e9863cffa3.tar.bz2 |
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 <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/uhid.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 2e7f3a0..0226ba3f 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -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, |