Linux Input/HID development
 help / color / mirror / Atom feed
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 1/3] HID: Add HID_CLAIMED_OTHER for non-generic drivers
Date: Sun, 15 Jul 2012 20:21:47 +0200	[thread overview]
Message-ID: <1342376509-7228-2-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1342376509-7228-1-git-send-email-dh.herrmann@googlemail.com>

All normal devices that correctly conform to the HID specs are handled by
the hid-input driver. However, for non-standard drivers we often don't
want hid-input to handle them but rather use specific hid drivers. But
hid_connect() requires at least one generic driver to claim the devices.
As hid_hw_start() calls hid_connect() we currently use an ugly workaround
by adding HID_CLAIMED_INPUT to hid->claimed and clear it after
hid_hw_start() again (see hid-picolcd.c for examples).

This adds the HID_CLAIMED_OTHER flag which can be set by device drivers to
tell the hid-core that they handle the device without the need of any
generic driver like hidinput, hiddev or hidraw.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 drivers/hid/hid-core.c | 2 ++
 include/linux/hid.h    | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 9cdc74e..2039f32 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1391,6 +1391,8 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
 	if (hdev->claimed & HID_CLAIMED_HIDRAW)
 		len += sprintf(buf + len, "%shidraw%d", len ? "," : "",
 				((struct hidraw *)hdev->hidraw)->minor);
+	if (hdev->claimed & HID_CLAIMED_OTHER)
+		len += sprintf(buf + len, "%sother", len ? "," : "");
 
 	type = "Device";
 	for (i = 0; i < hdev->maxcollection; i++) {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 449fa38..26b336a 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -452,6 +452,7 @@ struct hid_output_fifo {
 #define HID_CLAIMED_INPUT	1
 #define HID_CLAIMED_HIDDEV	2
 #define HID_CLAIMED_HIDRAW	4
+#define HID_CLAIMED_OTHER	8
 
 #define HID_STAT_ADDED		1
 #define HID_STAT_PARSED		2
-- 
1.7.11.2


  reply	other threads:[~2012-07-15 18:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-15 18:21 [PATCH 0/3] HID: Add HID_CLAIMED_OTHER device flag David Herrmann
2012-07-15 18:21 ` David Herrmann [this message]
2012-07-15 18:21 ` [PATCH 2/3] HID: picolcd: explicitly claim hid devices with HID_CLAIMED_OTHER David Herrmann
2012-07-15 18:21 ` [PATCH 3/3] HID: wiimote: " David Herrmann
  -- strict thread matches above, loose matches on Subject: below --
2012-07-16 18:45 [PATCH 1/3] HID: Add HID_CLAIMED_OTHER for non-generic drivers Henrik Rydberg
2012-07-16 19:08 ` David Herrmann
2012-07-16 19:35   ` Henrik Rydberg
2012-07-16 19:47     ` David Herrmann
2012-07-16 20:59       ` Henrik Rydberg
2012-07-16 21:06         ` David Herrmann
2012-07-16 21:14           ` Henrik Rydberg

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=1342376509-7228-2-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