From: David Herrmann <dh.herrmann@googlemail.com>
To: linux-input@vger.kernel.org
Cc: jkosina@suse.cz, David Herrmann <dh.herrmann@googlemail.com>
Subject: [PATCH 09/16] HID: uhid: add UHID_START and UHID_STOP events
Date: Sun, 10 Jun 2012 15:16:21 +0200 [thread overview]
Message-ID: <1339334188-21766-10-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1339334188-21766-1-git-send-email-dh.herrmann@googlemail.com>
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>
---
drivers/hid/uhid.c | 8 +++++++-
include/linux/uhid.h | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 0d011db..2e7f3a0 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -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)
diff --git a/include/linux/uhid.h b/include/linux/uhid.h
index 6eb42be..f8ce6f7 100644
--- a/include/linux/uhid.h
+++ b/include/linux/uhid.h
@@ -25,6 +25,8 @@
enum uhid_event_type {
UHID_CREATE,
UHID_DESTROY,
+ UHID_START,
+ UHID_STOP,
UHID_INPUT,
};
--
1.7.10.4
next prev parent reply other threads:[~2012-06-10 13:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-10 13:16 [PATCH 00/16] HID: uhid: User-space HID I/O driver David Herrmann
2012-06-10 13:16 ` [PATCH 01/16] HID: uhid: introduce user-space I/O driver support for HID David Herrmann
2012-06-10 13:16 ` [PATCH 02/16] HID: uhid: add internal message buffer David Herrmann
2012-06-10 13:16 ` [PATCH 03/16] HID: uhid: allow poll()'ing on uhid devices David Herrmann
2012-06-10 13:16 ` [PATCH 04/16] HID: uhid: implement read() " David Herrmann
2012-06-10 13:16 ` [PATCH 05/16] HID: uhid: implement write() " David Herrmann
2012-06-10 13:16 ` [PATCH 06/16] HID: uhid: add UHID_CREATE and UHID_DESTROY events David Herrmann
2012-06-10 13:16 ` [PATCH 07/16] HID: uhid: allow feeding input data into uhid devices David Herrmann
2012-06-10 13:16 ` [PATCH 08/16] HID: uhid: forward hid report-descriptor to hid core David Herrmann
2012-06-10 13:16 ` David Herrmann [this message]
2012-06-10 13:16 ` [PATCH 10/16] HID: uhid: forward open/close events to user-space David Herrmann
2012-06-10 13:16 ` [PATCH 11/16] HID: uhid: forward output request " David Herrmann
2012-06-10 13:16 ` [PATCH 12/16] HID: uhid: forward raw output reports " David Herrmann
2012-06-10 13:16 ` [PATCH 13/16] HID: uhid: implement feature requests David Herrmann
2012-06-10 13:16 ` [PATCH 14/16] HID: uhid: add documentation David Herrmann
2012-06-10 13:16 ` [PATCH 15/16] HID: uhid: add example program David Herrmann
2012-06-10 13:16 ` [PATCH 16/16] MAINTAINERS: add UHID entry David Herrmann
2012-06-11 14:46 ` [PATCH 00/16] HID: uhid: User-space HID I/O driver Joao Paulo Rechi Vita
2012-06-11 17:56 ` David Herrmann
[not found] ` <CAAngNMa3GMqrgZUrx=XqaRWfK2MaFMewK6OEQU_=4oPj1FOMNw@mail.gmail.com>
2012-06-14 22:05 ` Joao Paulo Rechi Vita
2012-06-16 12:44 ` David Herrmann
2012-06-18 11:46 ` Jiri Kosina
2012-07-02 21:05 ` Joao Paulo Rechi Vita
2012-07-02 21:19 ` David Herrmann
2012-07-03 2:15 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339334188-21766-10-git-send-email-dh.herrmann@googlemail.com \
--to=dh.herrmann@googlemail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).