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 2/3] HID: picolcd: explicitly claim hid devices with HID_CLAIMED_OTHER
Date: Sun, 15 Jul 2012 20:21:48 +0200	[thread overview]
Message-ID: <1342376509-7228-3-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1342376509-7228-1-git-send-email-dh.herrmann@googlemail.com>

Instead of using an ugly workaround to make hid_hw_start() correctly
initialize the device, we now explicitely set HID_CLAIMED_OTHER before
initializing the hid device. This tells the hid-core to accept the device
even if no generic hid driver gets loaded.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 drivers/hid/hid-picolcd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index 45c3433..36a11a8 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -2613,11 +2613,10 @@ static int picolcd_probe(struct hid_device *hdev,
 		goto err_cleanup_data;
 	}
 
-	/* We don't use hidinput but hid_hw_start() fails if nothing is
-	 * claimed. So spoof claimed input. */
-	hdev->claimed = HID_CLAIMED_INPUT;
+	/* Tell hid-core that we handle the device without the need of any
+	 * generic hid-driver by setting the HID_CLAIMED_OTHER flag. */
+	hdev->claimed |= HID_CLAIMED_OTHER;
 	error = hid_hw_start(hdev, 0);
-	hdev->claimed = 0;
 	if (error) {
 		hid_err(hdev, "hardware start failed\n");
 		goto err_cleanup_data;
-- 
1.7.11.2


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

Thread overview: 4+ 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 ` [PATCH 1/3] HID: Add HID_CLAIMED_OTHER for non-generic drivers David Herrmann
2012-07-15 18:21 ` David Herrmann [this message]
2012-07-15 18:21 ` [PATCH 3/3] HID: wiimote: explicitly claim hid devices with HID_CLAIMED_OTHER David Herrmann

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-3-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