aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/elan_i2c_core.c
diff options
context:
space:
mode:
authorJingle Wu <jingle.wu@emc.com.tw>2020-07-15 22:25:59 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2020-07-17 17:35:58 -0700
commitfc7c882aa9b1643273c4bb77d31163355dcbc0b8 (patch)
tree31346b3244c1a5149ccce84e2696b515e37183f3 /drivers/input/mouse/elan_i2c_core.c
parentInput: elan_i2c - handle firmware not implementing "get pattern" command (diff)
downloadlinux-dev-fc7c882aa9b1643273c4bb77d31163355dcbc0b8.tar.xz
linux-dev-fc7c882aa9b1643273c4bb77d31163355dcbc0b8.zip
Input: elan_i2c - make fetching IC type of older controllers more robust
On older controllers IC type is reported in the 2nd byte of ETP_I2C_OSM_VERSION_CMD, however if controller's firmware is not flashed correctly it may return incorrect data. Fortunately there is also ETP_I2C_IAP_VERSION_P0_CMD command that can be used when controller in either normal or IAP mode, and which is guaranteed to return accurate data, so let's use it. Signed-off-by: Jingle Wu <jingle.wu@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/elan_i2c_core.c')
-rw-r--r--drivers/input/mouse/elan_i2c_core.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 8719da540383..f1dade60f407 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -312,7 +312,6 @@ static int elan_initialize(struct elan_tp_data *data)
static int elan_query_device_info(struct elan_tp_data *data)
{
int error;
- u16 ic_type;
error = data->ops->get_version(data->client, false, &data->fw_version);
if (error)
@@ -336,12 +335,7 @@ static int elan_query_device_info(struct elan_tp_data *data)
if (error)
return error;
- if (data->pattern == 0x01)
- ic_type = data->ic_type;
- else
- ic_type = data->iap_version;
-
- error = elan_get_fwinfo(ic_type, &data->fw_validpage_count,
+ error = elan_get_fwinfo(data->ic_type, &data->fw_validpage_count,
&data->fw_signature_address);
if (error)
dev_warn(&data->client->dev,