diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2020-07-20 14:56:54 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2020-07-20 17:35:31 -0700 |
commit | 3d712af637e19a1c139c2b586c08b2a56bdff8c8 (patch) | |
tree | c078780114e32202d16aa3aa066b91a7f6e84bfc /drivers/input/mouse/elan_i2c_core.c | |
parent | 8d73ec7411e084de8266bc3cb031d85a222458be (diff) |
Input: elan_i2c - do not constantly re-query pattern ID
We do not need to constantly re-query pattern ID, we can instead query it
once and then pass to methods that need it.
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.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 5c933e16abc1..3230aaf63dab 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -236,8 +236,13 @@ static int elan_query_product(struct elan_tp_data *data) if (error) return error; - error = data->ops->get_sm_version(data->client, &data->ic_type, - &data->sm_version, &data->clickpad); + error = data->ops->get_pattern(data->client, &data->pattern); + if (error) + return error; + + error = data->ops->get_sm_version(data->client, data->pattern, + &data->ic_type, &data->sm_version, + &data->clickpad); if (error) return error; @@ -334,7 +339,8 @@ static int elan_query_device_info(struct elan_tp_data *data) { int error; - error = data->ops->get_version(data->client, false, &data->fw_version); + error = data->ops->get_version(data->client, data->pattern, false, + &data->fw_version); if (error) return error; @@ -343,7 +349,8 @@ static int elan_query_device_info(struct elan_tp_data *data) if (error) return error; - error = data->ops->get_version(data->client, true, &data->iap_version); + error = data->ops->get_version(data->client, data->pattern, + true, &data->iap_version); if (error) return error; @@ -352,10 +359,6 @@ static int elan_query_device_info(struct elan_tp_data *data) if (error) return error; - error = data->ops->get_pattern(data->client, &data->pattern); - if (error) - return error; - error = elan_get_fwinfo(data->ic_type, data->iap_version, &data->fw_validpage_count, &data->fw_signature_address, |