From patchwork Fri Apr 16 16:19:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 93170 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3GGRGhn011423 for ; Fri, 16 Apr 2010 16:27:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758221Ab0DPQ1R (ORCPT ); Fri, 16 Apr 2010 12:27:17 -0400 Received: from slow3-v.mail.gandi.net ([217.70.178.89]:41224 "EHLO slow3-v.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757123Ab0DPQ1Q (ORCPT ); Fri, 16 Apr 2010 12:27:16 -0400 X-WhiteListed: mail was accepted with no delay X-WhiteListed: mail was accepted with no delay Received: from relay4-v.mail.gandi.net (relay4-v.mail.gandi.net [217.70.178.78]) by slow3-v.mail.gandi.net (Postfix) with ESMTP id 1D5C8380AC for ; Fri, 16 Apr 2010 18:27:15 +0200 (CEST) X-Originating-IP: 217.70.178.42 Received: from mfilter2-d.gandi.net (mfilter2-d.gandi.net [217.70.178.42]) by relay4-v.mail.gandi.net (Postfix) with ESMTP id D2E08BA39; Fri, 16 Apr 2010 18:26:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter2-d.gandi.net Received: from relay4-v.mail.gandi.net ([217.70.178.78]) by mfilter2-d.gandi.net (mfilter2-d.gandi.net [217.70.178.42]) (amavisd-new, port 10024) with ESMTP id 3y-pGqO5PWWT; Fri, 16 Apr 2010 18:26:47 +0200 (CEST) X-Originating-IP: 209.132.186.29 Received: from [10.200.96.86] (nat-pool-fab-u.redhat.com [209.132.186.29]) (Authenticated sender: hadess@hadess.net) by relay4-v.mail.gandi.net (Postfix) with ESMTPSA id 080F7BA17; Fri, 16 Apr 2010 18:26:43 +0200 (CEST) Subject: [PATCH] Add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE From: Bastien Nocera To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Jiri Kosina Date: Fri, 16 Apr 2010 17:19:50 +0100 Message-ID: <1271434790.2045.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.29.91 (2.29.91-1.fc13) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 16 Apr 2010 16:27:21 +0000 (UTC) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b57e5f7..6ae1ea2 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1172,6 +1172,8 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) unsigned int i; int len; + if (hdev->quirks & HID_QUIRK_HIDDEV_FORCE) + connect_mask |= (HID_CONNECT_HIDDEV_FORCE | HID_CONNECT_HIDDEV); if (hdev->bus != BUS_USB) connect_mask &= ~HID_CONNECT_HIDDEV; if (hid_hiddev(hdev)) @@ -1761,7 +1763,7 @@ int hid_add_device(struct hid_device *hdev) /* we need to kill them here, otherwise they will stay allocated to * wait for coming driver */ - if (hid_ignore(hdev)) + if (!(hdev->quirks & HID_QUIRK_NO_IGNORE) && hid_ignore(hdev)) return -ENODEV; /* XXX hack, any other cleaner solution after the driver core diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 56d06cd..cf73e39 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1140,6 +1140,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * hid->vendor = le16_to_cpu(dev->descriptor.idVendor); hid->product = le16_to_cpu(dev->descriptor.idProduct); hid->name[0] = 0; + hid->quirks = usbhid_lookup_quirk(hid->vendor, hid->product); if (intf->cur_altsetting->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) hid->type = HID_TYPE_USBMOUSE; diff --git a/include/linux/hid.h b/include/linux/hid.h index b1344ec..f1f2b6f 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -308,11 +308,13 @@ struct hid_item { #define HID_QUIRK_NOTOUCH 0x00000002 #define HID_QUIRK_IGNORE 0x00000004 #define HID_QUIRK_NOGET 0x00000008 +#define HID_QUIRK_HIDDEV_FORCE 0x00000010 #define HID_QUIRK_BADPAD 0x00000020 #define HID_QUIRK_MULTI_INPUT 0x00000040 #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 +#define HID_QUIRK_NO_IGNORE 0x40000000 /* * This is the global environment of the parser. This information is