[v2][PATCH 0/5][SRU][B/OEM-B/OEM-OSP1/D] Enable new Elan touchpads which are not in current whitelist

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[v2][PATCH 0/5][SRU][B/OEM-B/OEM-OSP1/D] Enable new Elan touchpads which are not in current whitelist

Aaron Ma
BugLink: https://bugs.launchpad.net/bugs/1853246

[Impact]
New touchpads are ignored by hid driver because of IDs are missed in the
whitelist.

[Fix]
Only 2 Elan touchpad IDs are allowed to be loaded in hid driver.
Change to the blacklist of elan touchpads supported by elan_i2c, so
others can be enabled by hid.

[Test]
Verified on hardware. Tests results are good.

[Regression Potential]
Low.
keep current IDs of elan_i2c, loads those touchpads ID those weren't
supported.

Those patches are already in 5.3+ kernel,
only bionic and disco kernel need them.

backports are due to the filename and minor content changes.

v2 changes:
Since commit 0c043d70d04 which is included by 5.3 is already
in bionic and disco kernel, so backport this commit change
in filename changes.


Jeffrey Hugo (3):
  HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630
  Input: elan_i2c - export the device id whitelist
  HID: quirks: Refactor ELAN 400 and 401 handling

 drivers/hid/hid-core.c              | 19 +++++---
 drivers/input/mouse/elan_i2c_core.c | 50 +------------------
 include/linux/input/elan-i2c-ids.h  | 76 +++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 57 deletions(-)
 create mode 100644 include/linux/input/elan-i2c-ids.h

--
2.24.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[B/OEM-B][PATCH 1/3] HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630

Aaron Ma
From: Jeffrey Hugo <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1853246

Similar to commit edfc3722cfef ("HID: quirks: Fix keyboard + touchpad on
Toshiba Click Mini not working"), the Lenovo Miix 630 has a combo
keyboard/touchpad device with vid:pid of 04F3:0400, which is shared with
Elan touchpads.  The combo on the Miix 630 has an ACPI id of QTEC0001,
which is not claimed by the elan_i2c driver, so key on that similar to
what was done for the Toshiba Click Mini.

Signed-off-by: Jeffrey Hugo <[hidden email]>
Signed-off-by: Jiri Kosina <[hidden email]>
(backported from commit 2bafa1e9625400bec4c840a168d70ba52607a58d)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/hid/hid-core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 0f42a71891ac..0ebfffa068bf 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2657,7 +2657,6 @@ static const struct hid_device_id hid_ignore_list[] = {
  { HID_USB_DEVICE(USB_VENDOR_ID_DEALEXTREAME, USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701) },
  { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) },
  { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
- { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0400) },
  { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
  { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
  { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
@@ -2940,6 +2939,10 @@ bool hid_ignore(struct hid_device *hdev)
  if (hdev->product == 0x0401 &&
     strncmp(hdev->name, "ELAN0800", 8) != 0)
  return true;
+ /* Same with product id 0x0400 */
+ if (hdev->product == 0x0400 &&
+    strncmp(hdev->name, "QTEC0001", 8) != 0)
+ return true;
  break;
  }
 
--
2.24.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[v2][B/OEM-B][PATCH 2/3] Input: elan_i2c - export the device id whitelist

Aaron Ma
In reply to this post by Aaron Ma
From: Jeffrey Hugo <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1853246

Elan_i2c and hid-quirks work in conjunction to decide which devices each
driver will handle.  Elan_i2c has a whitelist of devices that should be
consumed by hid-quirks so that there is one master list of devices to
handoff between the drivers.  Put the ids in a header file so that
hid-quirks can consume it instead of duplicating the list.

Signed-off-by: Jeffrey Hugo <[hidden email]>
Acked-by: Benjamin Tissoires <[hidden email]>
Signed-off-by: Dmitry Torokhov <[hidden email]>

keep commit (0c043d70d04).
(backported from commit 0828c1001399d5c5fcab547ef7b0a29c78d4bdf6)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/input/mouse/elan_i2c_core.c | 50 +------------------
 include/linux/input/elan-i2c-ids.h  | 76 +++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 49 deletions(-)
 create mode 100644 include/linux/input/elan-i2c-ids.h

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 52e25f2a1d99..55eed2709e5e 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -36,6 +36,7 @@
 #include <linux/jiffies.h>
 #include <linux/completion.h>
 #include <linux/of.h>
+#include <linux/input/elan-i2c-ids.h>
 #include <linux/regulator/consumer.h>
 #include <asm/unaligned.h>
 
@@ -1252,55 +1253,6 @@ static const struct i2c_device_id elan_id[] = {
 MODULE_DEVICE_TABLE(i2c, elan_id);
 
 #ifdef CONFIG_ACPI
-static const struct acpi_device_id elan_acpi_id[] = {
- { "ELAN0000", 0 },
- { "ELAN0100", 0 },
- { "ELAN0600", 0 },
- { "ELAN0601", 0 },
- { "ELAN0602", 0 },
- { "ELAN0603", 0 },
- { "ELAN0604", 0 },
- { "ELAN0605", 0 },
- { "ELAN0606", 0 },
- { "ELAN0607", 0 },
- { "ELAN0608", 0 },
- { "ELAN0609", 0 },
- { "ELAN060B", 0 },
- { "ELAN060C", 0 },
- { "ELAN060F", 0 },
- { "ELAN0610", 0 },
- { "ELAN0611", 0 },
- { "ELAN0612", 0 },
- { "ELAN0615", 0 },
- { "ELAN0616", 0 },
- { "ELAN0617", 0 },
- { "ELAN0618", 0 },
- { "ELAN0619", 0 },
- { "ELAN061A", 0 },
-/* { "ELAN061B", 0 }, not working on the Lenovo Legion Y7000 */
- { "ELAN061C", 0 },
- { "ELAN061D", 0 },
- { "ELAN061E", 0 },
- { "ELAN061F", 0 },
- { "ELAN0620", 0 },
- { "ELAN0621", 0 },
- { "ELAN0622", 0 },
- { "ELAN0623", 0 },
- { "ELAN0624", 0 },
- { "ELAN0625", 0 },
- { "ELAN0626", 0 },
- { "ELAN0627", 0 },
- { "ELAN0628", 0 },
- { "ELAN0629", 0 },
- { "ELAN062A", 0 },
- { "ELAN062B", 0 },
- { "ELAN062C", 0 },
- { "ELAN062D", 0 },
- { "ELAN0631", 0 },
- { "ELAN0632", 0 },
- { "ELAN1000", 0 },
- { }
-};
 MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
 #endif
 
diff --git a/include/linux/input/elan-i2c-ids.h b/include/linux/input/elan-i2c-ids.h
new file mode 100644
index 000000000000..1ecb6b45812c
--- /dev/null
+++ b/include/linux/input/elan-i2c-ids.h
@@ -0,0 +1,76 @@
+/*
+ * Elan I2C/SMBus Touchpad device whitelist
+ *
+ * Copyright (c) 2013 ELAN Microelectronics Corp.
+ *
+ * Author: æ維 (Duson Lin) <[hidden email]>
+ * Author: KT Liao <[hidden email]>
+ * Version: 1.6.3
+ *
+ * Based on cyapa driver:
+ * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
+ * copyright (c) 2011-2012 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ */
+
+#ifndef __ELAN_I2C_IDS_H
+#define __ELAN_I2C_IDS_H
+
+#include <linux/mod_devicetable.h>
+
+static const struct acpi_device_id elan_acpi_id[] = {
+ { "ELAN0000", 0 },
+ { "ELAN0100", 0 },
+ { "ELAN0600", 0 },
+ { "ELAN0601", 0 },
+ { "ELAN0602", 0 },
+ { "ELAN0603", 0 },
+ { "ELAN0604", 0 },
+ { "ELAN0605", 0 },
+ { "ELAN0606", 0 },
+ { "ELAN0607", 0 },
+ { "ELAN0608", 0 },
+ { "ELAN0609", 0 },
+ { "ELAN060B", 0 },
+ { "ELAN060C", 0 },
+ { "ELAN060F", 0 },
+ { "ELAN0610", 0 },
+ { "ELAN0611", 0 },
+ { "ELAN0612", 0 },
+ { "ELAN0615", 0 },
+ { "ELAN0616", 0 },
+ { "ELAN0617", 0 },
+ { "ELAN0618", 0 },
+ { "ELAN0619", 0 },
+ { "ELAN061A", 0 },
+/* { "ELAN061B", 0 }, not working on the Lenovo Legion Y7000 */
+ { "ELAN061C", 0 },
+ { "ELAN061D", 0 },
+ { "ELAN061E", 0 },
+ { "ELAN061F", 0 },
+ { "ELAN0620", 0 },
+ { "ELAN0621", 0 },
+ { "ELAN0622", 0 },
+ { "ELAN0623", 0 },
+ { "ELAN0624", 0 },
+ { "ELAN0625", 0 },
+ { "ELAN0626", 0 },
+ { "ELAN0627", 0 },
+ { "ELAN0628", 0 },
+ { "ELAN0629", 0 },
+ { "ELAN062A", 0 },
+ { "ELAN062B", 0 },
+ { "ELAN062C", 0 },
+ { "ELAN062D", 0 },
+ { "ELAN0631", 0 },
+ { "ELAN0632", 0 },
+ { "ELAN1000", 0 },
+ { }
+};
+
+#endif /* __ELAN_I2C_IDS_H */
--
2.24.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[B/OEM-B][PATCH 3/3] HID: quirks: Refactor ELAN 400 and 401 handling

Aaron Ma
In reply to this post by Aaron Ma
From: Jeffrey Hugo <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1853246

There needs to be coordination between hid-quirks and the elan_i2c driver
about which devices are handled by what drivers.  Currently, both use
whitelists, which results in valid devices being unhandled by default,
when they should not be rejected by hid-quirks.  This is quickly becoming
an issue.

Since elan_i2c has a maintained whitelist of what devices it will handle,
which is now in a header file that hid-quirks can access, use that to
implement a blacklist in hid-quirks so that only the devices that need to
be handled by elan_i2c get rejected by hid-quirks, and everything else is
handled by default.

Suggested-by: Benjamin Tissoires <[hidden email]>
Signed-off-by: Jeffrey Hugo <[hidden email]>
Acked-by: Benjamin Tissoires <[hidden email]>
Signed-off-by: Dmitry Torokhov <[hidden email]>
(backported from commit d69f62bed792fc0564198f2406151b0ea008b299)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/hid/hid-core.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 0ebfffa068bf..d5a5e012c51a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -35,6 +35,7 @@
 #include <linux/hiddev.h>
 #include <linux/hid-debug.h>
 #include <linux/hidraw.h>
+#include <linux/input/elan-i2c-ids.h>
 
 #include "hid-ids.h"
 
@@ -2867,6 +2868,8 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
 
 bool hid_ignore(struct hid_device *hdev)
 {
+ int i;
+
  if (hdev->quirks & HID_QUIRK_NO_IGNORE)
  return false;
  if (hdev->quirks & HID_QUIRK_IGNORE)
@@ -2931,18 +2934,15 @@ bool hid_ignore(struct hid_device *hdev)
  break;
  case USB_VENDOR_ID_ELAN:
  /*
- * Many Elan devices have a product id of 0x0401 and are handled
- * by the elan_i2c input driver. But the ACPI HID ELAN0800 dev
- * is not (and cannot be) handled by that driver ->
- * Ignore all 0x0401 devs except for the ELAN0800 dev.
+ * Blacklist of everything that gets handled by the elan_i2c
+ * input driver.  This avoids disabling valid touchpads and
+ * other ELAN devices.
  */
- if (hdev->product == 0x0401 &&
-    strncmp(hdev->name, "ELAN0800", 8) != 0)
- return true;
- /* Same with product id 0x0400 */
- if (hdev->product == 0x0400 &&
-    strncmp(hdev->name, "QTEC0001", 8) != 0)
- return true;
+ if ((hdev->product == 0x0401 || hdev->product == 0x0400))
+ for (i = 0; strlen(elan_acpi_id[i].id); ++i)
+ if (!strncmp(hdev->name, elan_acpi_id[i].id,
+     strlen(elan_acpi_id[i].id)))
+ return true;
  break;
  }
 
--
2.24.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[v2][D/OEM-OSP-1][PATCH 4/5] Input: elan_i2c - export the device id whitelist

Aaron Ma
In reply to this post by Aaron Ma
From: Jeffrey Hugo <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1853246

Elan_i2c and hid-quirks work in conjunction to decide which devices each
driver will handle.  Elan_i2c has a whitelist of devices that should be
consumed by hid-quirks so that there is one master list of devices to
handoff between the drivers.  Put the ids in a header file so that
hid-quirks can consume it instead of duplicating the list.

Signed-off-by: Jeffrey Hugo <[hidden email]>
Acked-by: Benjamin Tissoires <[hidden email]>
Signed-off-by: Dmitry Torokhov <[hidden email]>

keep commit (0c043d70d04).
(backported from commit 0828c1001399d5c5fcab547ef7b0a29c78d4bdf6)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/input/mouse/elan_i2c_core.c | 50 +------------------
 include/linux/input/elan-i2c-ids.h  | 76 +++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 49 deletions(-)
 create mode 100644 include/linux/input/elan-i2c-ids.h

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index ae012639ae1d..4592c9c2d0aa 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -37,6 +37,7 @@
 #include <linux/completion.h>
 #include <linux/of.h>
 #include <linux/property.h>
+#include <linux/input/elan-i2c-ids.h>
 #include <linux/regulator/consumer.h>
 #include <asm/unaligned.h>
 
@@ -1333,55 +1334,6 @@ static const struct i2c_device_id elan_id[] = {
 MODULE_DEVICE_TABLE(i2c, elan_id);
 
 #ifdef CONFIG_ACPI
-static const struct acpi_device_id elan_acpi_id[] = {
- { "ELAN0000", 0 },
- { "ELAN0100", 0 },
- { "ELAN0600", 0 },
- { "ELAN0601", 0 },
- { "ELAN0602", 0 },
- { "ELAN0603", 0 },
- { "ELAN0604", 0 },
- { "ELAN0605", 0 },
- { "ELAN0606", 0 },
- { "ELAN0607", 0 },
- { "ELAN0608", 0 },
- { "ELAN0609", 0 },
- { "ELAN060B", 0 },
- { "ELAN060C", 0 },
- { "ELAN060F", 0 },
- { "ELAN0610", 0 },
- { "ELAN0611", 0 },
- { "ELAN0612", 0 },
- { "ELAN0615", 0 },
- { "ELAN0616", 0 },
- { "ELAN0617", 0 },
- { "ELAN0618", 0 },
- { "ELAN0619", 0 },
- { "ELAN061A", 0 },
-/* { "ELAN061B", 0 }, not working on the Lenovo Legion Y7000 */
- { "ELAN061C", 0 },
- { "ELAN061D", 0 },
- { "ELAN061E", 0 },
- { "ELAN061F", 0 },
- { "ELAN0620", 0 },
- { "ELAN0621", 0 },
- { "ELAN0622", 0 },
- { "ELAN0623", 0 },
- { "ELAN0624", 0 },
- { "ELAN0625", 0 },
- { "ELAN0626", 0 },
- { "ELAN0627", 0 },
- { "ELAN0628", 0 },
- { "ELAN0629", 0 },
- { "ELAN062A", 0 },
- { "ELAN062B", 0 },
- { "ELAN062C", 0 },
- { "ELAN062D", 0 },
- { "ELAN0631", 0 },
- { "ELAN0632", 0 },
- { "ELAN1000", 0 },
- { }
-};
 MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
 #endif
 
diff --git a/include/linux/input/elan-i2c-ids.h b/include/linux/input/elan-i2c-ids.h
new file mode 100644
index 000000000000..1ecb6b45812c
--- /dev/null
+++ b/include/linux/input/elan-i2c-ids.h
@@ -0,0 +1,76 @@
+/*
+ * Elan I2C/SMBus Touchpad device whitelist
+ *
+ * Copyright (c) 2013 ELAN Microelectronics Corp.
+ *
+ * Author: æ維 (Duson Lin) <[hidden email]>
+ * Author: KT Liao <[hidden email]>
+ * Version: 1.6.3
+ *
+ * Based on cyapa driver:
+ * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
+ * copyright (c) 2011-2012 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * Trademarks are the property of their respective owners.
+ */
+
+#ifndef __ELAN_I2C_IDS_H
+#define __ELAN_I2C_IDS_H
+
+#include <linux/mod_devicetable.h>
+
+static const struct acpi_device_id elan_acpi_id[] = {
+ { "ELAN0000", 0 },
+ { "ELAN0100", 0 },
+ { "ELAN0600", 0 },
+ { "ELAN0601", 0 },
+ { "ELAN0602", 0 },
+ { "ELAN0603", 0 },
+ { "ELAN0604", 0 },
+ { "ELAN0605", 0 },
+ { "ELAN0606", 0 },
+ { "ELAN0607", 0 },
+ { "ELAN0608", 0 },
+ { "ELAN0609", 0 },
+ { "ELAN060B", 0 },
+ { "ELAN060C", 0 },
+ { "ELAN060F", 0 },
+ { "ELAN0610", 0 },
+ { "ELAN0611", 0 },
+ { "ELAN0612", 0 },
+ { "ELAN0615", 0 },
+ { "ELAN0616", 0 },
+ { "ELAN0617", 0 },
+ { "ELAN0618", 0 },
+ { "ELAN0619", 0 },
+ { "ELAN061A", 0 },
+/* { "ELAN061B", 0 }, not working on the Lenovo Legion Y7000 */
+ { "ELAN061C", 0 },
+ { "ELAN061D", 0 },
+ { "ELAN061E", 0 },
+ { "ELAN061F", 0 },
+ { "ELAN0620", 0 },
+ { "ELAN0621", 0 },
+ { "ELAN0622", 0 },
+ { "ELAN0623", 0 },
+ { "ELAN0624", 0 },
+ { "ELAN0625", 0 },
+ { "ELAN0626", 0 },
+ { "ELAN0627", 0 },
+ { "ELAN0628", 0 },
+ { "ELAN0629", 0 },
+ { "ELAN062A", 0 },
+ { "ELAN062B", 0 },
+ { "ELAN062C", 0 },
+ { "ELAN062D", 0 },
+ { "ELAN0631", 0 },
+ { "ELAN0632", 0 },
+ { "ELAN1000", 0 },
+ { }
+};
+
+#endif /* __ELAN_I2C_IDS_H */
--
2.24.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[D/OEM-OSP-1][PATCH 5/5] HID: quirks: Refactor ELAN 400 and 401 handling

Aaron Ma
In reply to this post by Aaron Ma
From: Jeffrey Hugo <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1853246

There needs to be coordination between hid-quirks and the elan_i2c driver
about which devices are handled by what drivers.  Currently, both use
whitelists, which results in valid devices being unhandled by default,
when they should not be rejected by hid-quirks.  This is quickly becoming
an issue.

Since elan_i2c has a maintained whitelist of what devices it will handle,
which is now in a header file that hid-quirks can access, use that to
implement a blacklist in hid-quirks so that only the devices that need to
be handled by elan_i2c get rejected by hid-quirks, and everything else is
handled by default.

Suggested-by: Benjamin Tissoires <[hidden email]>
Signed-off-by: Jeffrey Hugo <[hidden email]>
Acked-by: Benjamin Tissoires <[hidden email]>
Signed-off-by: Dmitry Torokhov <[hidden email]>
(cherry picked from commit d69f62bed792fc0564198f2406151b0ea008b299)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/hid/hid-quirks.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index a407fd2399ff..26cffe1758b5 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -19,6 +19,7 @@
 #include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
+#include <linux/input/elan-i2c-ids.h>
 
 #include "hid-ids.h"
 
@@ -957,6 +958,8 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
 
 bool hid_ignore(struct hid_device *hdev)
 {
+ int i;
+
  if (hdev->quirks & HID_QUIRK_NO_IGNORE)
  return false;
  if (hdev->quirks & HID_QUIRK_IGNORE)
@@ -1021,18 +1024,15 @@ bool hid_ignore(struct hid_device *hdev)
  break;
  case USB_VENDOR_ID_ELAN:
  /*
- * Many Elan devices have a product id of 0x0401 and are handled
- * by the elan_i2c input driver. But the ACPI HID ELAN0800 dev
- * is not (and cannot be) handled by that driver ->
- * Ignore all 0x0401 devs except for the ELAN0800 dev.
+ * Blacklist of everything that gets handled by the elan_i2c
+ * input driver.  This avoids disabling valid touchpads and
+ * other ELAN devices.
  */
- if (hdev->product == 0x0401 &&
-    strncmp(hdev->name, "ELAN0800", 8) != 0)
- return true;
- /* Same with product id 0x0400 */
- if (hdev->product == 0x0400 &&
-    strncmp(hdev->name, "QTEC0001", 8) != 0)
- return true;
+ if ((hdev->product == 0x0401 || hdev->product == 0x0400))
+ for (i = 0; strlen(elan_acpi_id[i].id); ++i)
+ if (!strncmp(hdev->name, elan_acpi_id[i].id,
+     strlen(elan_acpi_id[i].id)))
+ return true;
  break;
  }
 
--
2.24.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [v2][PATCH 0/5][SRU][B/OEM-B/OEM-OSP1/D] Enable new Elan touchpads which are not in current whitelist

You-Sheng Yang
In reply to this post by Aaron Ma
Acked-By: You-Sheng Yang <[hidden email]>

On 2019-11-21 14:40, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1853246
>
> [Impact]
> New touchpads are ignored by hid driver because of IDs are missed in the
> whitelist.
>
> [Fix]
> Only 2 Elan touchpad IDs are allowed to be loaded in hid driver.
> Change to the blacklist of elan touchpads supported by elan_i2c, so
> others can be enabled by hid.
>
> [Test]
> Verified on hardware. Tests results are good.
>
> [Regression Potential]
> Low.
> keep current IDs of elan_i2c, loads those touchpads ID those weren't
> supported.
>
> Those patches are already in 5.3+ kernel,
> only bionic and disco kernel need them.
>
> backports are due to the filename and minor content changes.
>
> v2 changes:
> Since commit 0c043d70d04 which is included by 5.3 is already
> in bionic and disco kernel, so backport this commit change
> in filename changes.
>
>
> Jeffrey Hugo (3):
>   HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630
>   Input: elan_i2c - export the device id whitelist
>   HID: quirks: Refactor ELAN 400 and 401 handling
>
>  drivers/hid/hid-core.c              | 19 +++++---
>  drivers/input/mouse/elan_i2c_core.c | 50 +------------------
>  include/linux/input/elan-i2c-ids.h  | 76 +++++++++++++++++++++++++++++
>  3 files changed, 88 insertions(+), 57 deletions(-)
>  create mode 100644 include/linux/input/elan-i2c-ids.h
>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

ACK: [v2][PATCH 0/5][SRU][B/OEM-B/OEM-OSP1/D] Enable new Elan touchpads which are not in current whitelist

Stefan Bader-2
In reply to this post by Aaron Ma
On 21.11.19 07:40, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1853246
>
> [Impact]
> New touchpads are ignored by hid driver because of IDs are missed in the
> whitelist.
>
> [Fix]
> Only 2 Elan touchpad IDs are allowed to be loaded in hid driver.
> Change to the blacklist of elan touchpads supported by elan_i2c, so
> others can be enabled by hid.
>
> [Test]
> Verified on hardware. Tests results are good.
>
> [Regression Potential]
> Low.
> keep current IDs of elan_i2c, loads those touchpads ID those weren't
> supported.
>
> Those patches are already in 5.3+ kernel,
> only bionic and disco kernel need them.
>
> backports are due to the filename and minor content changes.
>
> v2 changes:
> Since commit 0c043d70d04 which is included by 5.3 is already
> in bionic and disco kernel, so backport this commit change
> in filename changes.
>
>
> Jeffrey Hugo (3):
>   HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630
>   Input: elan_i2c - export the device id whitelist
>   HID: quirks: Refactor ELAN 400 and 401 handling
>
>  drivers/hid/hid-core.c              | 19 +++++---
>  drivers/input/mouse/elan_i2c_core.c | 50 +------------------
>  include/linux/input/elan-i2c-ids.h  | 76 +++++++++++++++++++++++++++++
>  3 files changed, 88 insertions(+), 57 deletions(-)
>  create mode 100644 include/linux/input/elan-i2c-ids.h
>
Acked-by: Stefan Bader <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED[B/D]: [v2][PATCH 0/5][SRU][B/OEM-B/OEM-OSP1/D] Enable new Elan touchpads which are not in current whitelist

Kleber Souza
In reply to this post by Aaron Ma
On 2019-11-21 07:40, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1853246
>
> [Impact]
> New touchpads are ignored by hid driver because of IDs are missed in the
> whitelist.
>
> [Fix]
> Only 2 Elan touchpad IDs are allowed to be loaded in hid driver.
> Change to the blacklist of elan touchpads supported by elan_i2c, so
> others can be enabled by hid.
>
> [Test]
> Verified on hardware. Tests results are good.
>
> [Regression Potential]
> Low.
> keep current IDs of elan_i2c, loads those touchpads ID those weren't
> supported.
>
> Those patches are already in 5.3+ kernel,
> only bionic and disco kernel need them.
>
> backports are due to the filename and minor content changes.
>
> v2 changes:
> Since commit 0c043d70d04 which is included by 5.3 is already
> in bionic and disco kernel, so backport this commit change
> in filename changes.
>
>
> Jeffrey Hugo (3):
>   HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630
>   Input: elan_i2c - export the device id whitelist
>   HID: quirks: Refactor ELAN 400 and 401 handling
>
>  drivers/hid/hid-core.c              | 19 +++++---
>  drivers/input/mouse/elan_i2c_core.c | 50 +------------------
>  include/linux/input/elan-i2c-ids.h  | 76 +++++++++++++++++++++++++++++
>  3 files changed, 88 insertions(+), 57 deletions(-)
>  create mode 100644 include/linux/input/elan-i2c-ids.h
>

Applied to bionic and disco master-next branches.

Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team