Skip to content

Commit

Permalink
HID: uhid: add UHID_START and UHID_STOP events
Browse files Browse the repository at this point in the history
We send UHID_START and UHID_STOP events to user-space when the HID core
starts/stops the device. This notifies user-space about driver readiness
and data-I/O can start now.

This directly forwards the callbacks from hid-core to user-space.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
David Herrmann authored and Jiri Kosina committed Jun 18, 2012
1 parent 037c061 commit ec4b7de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/hid/uhid.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,17 @@ static int uhid_queue_event(struct uhid_device *uhid, __u32 event)

static int uhid_hid_start(struct hid_device *hid)
{
return 0;
struct uhid_device *uhid = hid->driver_data;

return uhid_queue_event(uhid, UHID_START);
}

static void uhid_hid_stop(struct hid_device *hid)
{
struct uhid_device *uhid = hid->driver_data;

hid->claimed = 0;
uhid_queue_event(uhid, UHID_STOP);
}

static int uhid_hid_open(struct hid_device *hid)
Expand Down
2 changes: 2 additions & 0 deletions include/linux/uhid.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
enum uhid_event_type {
UHID_CREATE,
UHID_DESTROY,
UHID_START,
UHID_STOP,
UHID_INPUT,
};

Expand Down

0 comments on commit ec4b7de

Please sign in to comment.