From: "Adrien Vergé" <adrienverge@gmail.com>
To: Oliver Neukum <oneukum@suse.com>
Cc: "Jiri Kosina" <jikos@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Logan Gunthorpe" <logang@deltatee.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Vincent Palatin" <vpalatin@chromium.org>,
"Adrien Vergé" <adrienverge@gmail.com>,
"Macpaul Lin" <macpaul@gmail.com>,
"Adel Gadllah" <adel.gadllah@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: [PATCH v3 2/2] USB: quirks: Apply ALWAYS_POLL to all ELAN devices
Date: Tue, 24 Nov 2015 14:49:08 +0100 [thread overview]
Message-ID: <1448372948-8861-3-git-send-email-adrienverge@gmail.com> (raw)
In-Reply-To: <1448372948-8861-1-git-send-email-adrienverge@gmail.com>
All ELAN hid devices seem to require the ALWAYS_POLL quirk. Let's use
this quirk for all devices from this vendor, rather than maintaining a
list of all its known product IDs.
To achieve that, this patch introduces a new hid_vendor_blacklist[] that
is checked when the product ID is not found in hid_product_blacklist[].
Tested-by: Adrien Vergé <adrienverge@gmail.com>
Signed-off-by: Adrien Vergé <adrienverge@gmail.com>
---
drivers/hid/hid-ids.h | 5 -----
drivers/hid/usbhid/hid-quirks.c | 43 +++++++++++++++++++++++++++--------------
2 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index ac1feea..3c7e0c3 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -316,11 +316,6 @@
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001
#define USB_VENDOR_ID_ELAN 0x04f3
-#define USB_DEVICE_ID_ELAN_TOUCHSCREEN 0x0089
-#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B 0x009b
-#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103 0x0103
-#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_010c 0x010c
-#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F 0x016f
#define USB_VENDOR_ID_ELECOM 0x056e
#define USB_DEVICE_ID_ELECOM_BM084 0x0061
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 94bb137..9550497 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -21,15 +21,29 @@
#include "../hid-ids.h"
+struct hid_blacklist {
+ __u16 idVendor;
+ __u16 idProduct;
+ __u32 quirks;
+};
+
+/*
+ * Alphabetically sorted blacklist for vendor-global quirks. If a device matches
+ * both this blacklist and the product one (below), the more specific one
+ * (product ID) prevails.
+ */
+
+static const struct hid_blacklist hid_vendor_blacklist[] = {
+ { USB_VENDOR_ID_ELAN, 0, HID_QUIRK_ALWAYS_POLL },
+
+ { 0, 0, 0 }
+};
+
/*
* Alphabetically sorted blacklist by quirk type.
*/
-static const struct hid_blacklist {
- __u16 idVendor;
- __u16 idProduct;
- __u32 quirks;
-} hid_blacklist[] = {
+static const struct hid_blacklist hid_product_blacklist[] = {
{ USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
@@ -72,11 +86,6 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL },
{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT },
- { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN, HID_QUIRK_ALWAYS_POLL },
- { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B, HID_QUIRK_ALWAYS_POLL },
- { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103, HID_QUIRK_ALWAYS_POLL },
- { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_010c, HID_QUIRK_ALWAYS_POLL },
- { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F, HID_QUIRK_ALWAYS_POLL },
{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
@@ -337,10 +346,16 @@ static const struct hid_blacklist *usbhid_exists_squirk(const u16 idVendor,
const struct hid_blacklist *bl_entry = NULL;
int n = 0;
- for (; hid_blacklist[n].idVendor; n++)
- if (hid_blacklist[n].idVendor == idVendor &&
- hid_blacklist[n].idProduct == idProduct)
- bl_entry = &hid_blacklist[n];
+ for (; hid_product_blacklist[n].idVendor; n++)
+ if (hid_product_blacklist[n].idVendor == idVendor &&
+ hid_product_blacklist[n].idProduct == idProduct)
+ bl_entry = &hid_product_blacklist[n];
+
+ if (bl_entry == NULL) {
+ for (n = 0; hid_vendor_blacklist[n].idVendor; n++)
+ if (hid_vendor_blacklist[n].idVendor == idVendor)
+ bl_entry = &hid_vendor_blacklist[n];
+ }
if (bl_entry != NULL)
dbg_hid("Found squirk 0x%x for USB HID vendor 0x%hx prod 0x%hx\n",
--
2.4.3
next prev parent reply other threads:[~2015-11-24 13:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-22 4:06 [PATCH] USB: quirks: Fix another ELAN touchscreen Adrien Vergé
2015-11-23 14:52 ` Jiri Kosina
2015-11-23 17:37 ` Adrien Vergé
2015-11-24 7:29 ` Oliver Neukum
2015-11-23 17:43 ` [PATCH v2] " Adrien Vergé
2015-11-24 13:49 ` [PATCH v3 0/2] Fixes for ELAN touchscreens Adrien Vergé
2015-11-24 13:49 ` [PATCH v3 1/2] USB: quirks: Fix another ELAN touchscreen Adrien Vergé
2015-11-24 13:49 ` Adrien Vergé [this message]
2015-11-24 14:11 ` [PATCH v3 2/2] USB: quirks: Apply ALWAYS_POLL to all ELAN devices Benjamin Tissoires
2015-11-24 14:34 ` Adrien Vergé
2015-11-24 15:02 ` [PATCH v4 0/2] Fixes for ELAN touchscreens Adrien Vergé
2015-11-24 15:02 ` [PATCH v4 1/2] USB: quirks: Fix another ELAN touchscreen Adrien Vergé
2015-11-24 15:02 ` [PATCH v4 2/2] USB: quirks: Apply ALWAYS_POLL to all ELAN devices Adrien Vergé
2015-11-24 16:11 ` Benjamin Tissoires
2015-11-24 16:41 ` kbuild test robot
2015-12-01 18:21 ` Greg Kroah-Hartman
2015-12-01 18:56 ` [PATCH v5 0/2] Fixes for ELAN touchscreens Adrien Vergé
2015-12-01 18:56 ` [PATCH v5 1/2] USB: quirks: Fix another ELAN touchscreen Adrien Vergé
2015-12-01 18:56 ` [PATCH v5 2/2] USB: quirks: Apply ALWAYS_POLL to all ELAN devices Adrien Vergé
[not found] ` <1448996208-19713-3-git-send-email-adrienverge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-01 22:09 ` Jiri Kosina
2015-12-01 22:11 ` Greg Kroah-Hartman
2015-12-02 8:53 ` Adrien Vergé
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=1448372948-8861-3-git-send-email-adrienverge@gmail.com \
--to=adrienverge@gmail.com \
--cc=adel.gadllah@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=macpaul@gmail.com \
--cc=oneukum@suse.com \
--cc=vpalatin@chromium.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).