From df077237cf55928f5ac4b2770488a0aa4d3cd095 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 22 May 2018 17:30:07 -0700 Subject: Input: elantech - detect new ICs and setup Host Notify for them New ICs are using a different scheme for the alternate bus parameter. Given that they are new and are only using either PS2 only or PS2 + SMBus Host Notify, we force those new ICs to use the SMBus solution for enhanced reporting. This allows the touchpad found on the Lenovo T480s to report 5 fingers every 8 ms, instead of having a limit of 2 every 8 ms. Signed-off-by: Benjamin Tissoires Acked-by: KT Liao Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/elantech.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/input/mouse/elantech.c') diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 510e7c0622d3..07e40a58e66c 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -1793,11 +1793,11 @@ static int elantech_setup_smbus(struct psmouse *psmouse, if (elantech_smbus == ELANTECH_SMBUS_NOT_SET) { /* - * FIXME: - * constraint the I2C capable devices by using FW version, - * board version, or by using DMI matching + * New ICs are enabled by default. + * Old ICs are up to the user to decide. */ - return -ENXIO; + if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version)) + return -ENXIO; } psmouse_info(psmouse, "Trying to set up SMBus access\n"); @@ -1818,6 +1818,9 @@ static int elantech_setup_smbus(struct psmouse *psmouse, static bool elantech_use_host_notify(struct psmouse *psmouse, struct elantech_device_info *info) { + if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version)) + return true; + switch (info->bus) { case ETP_BUS_PS2_ONLY: /* expected case */ -- cgit