Commit 9d7b03f8 authored by Daniel Drake's avatar Daniel Drake Committed by Dmitry Torokhov

Input: elan_i2c - don't require known iap version

The Asus X456UA has an ELAN1000 touchpad with IAP version 0xe.  This is
unknown to elan_get_fwinfo() so driver probe fails and I am left with an
unusable touchpad.

However, the fwinfo is not required for general driver usage, it is only
needed if the user decides to upload new firmware.

Adjust the driver so that we do not abort probe when we encounter
unexpected IAP version, but rather warn user that firmware update feature
of the driver will not work.
Signed-off-by: default avatarDaniel Drake <drake@endlessm.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 002801fc
...@@ -266,11 +266,10 @@ static int elan_query_device_info(struct elan_tp_data *data) ...@@ -266,11 +266,10 @@ static int elan_query_device_info(struct elan_tp_data *data)
error = elan_get_fwinfo(data->iap_version, &data->fw_validpage_count, error = elan_get_fwinfo(data->iap_version, &data->fw_validpage_count,
&data->fw_signature_address); &data->fw_signature_address);
if (error) { if (error)
dev_err(&data->client->dev, dev_warn(&data->client->dev,
"unknown iap version %d\n", data->iap_version); "unexpected iap version %#04x (ic type: %#04x), firmware update will not work\n",
return error; data->iap_version, data->ic_type);
}
return 0; return 0;
} }
...@@ -486,6 +485,9 @@ static ssize_t elan_sysfs_update_fw(struct device *dev, ...@@ -486,6 +485,9 @@ static ssize_t elan_sysfs_update_fw(struct device *dev,
const u8 *fw_signature; const u8 *fw_signature;
static const u8 signature[] = {0xAA, 0x55, 0xCC, 0x33, 0xFF, 0xFF}; static const u8 signature[] = {0xAA, 0x55, 0xCC, 0x33, 0xFF, 0xFF};
if (data->fw_validpage_count == 0)
return -EINVAL;
/* Look for a firmware with the product id appended. */ /* Look for a firmware with the product id appended. */
fw_name = kasprintf(GFP_KERNEL, ETP_FW_NAME, data->product_id); fw_name = kasprintf(GFP_KERNEL, ETP_FW_NAME, data->product_id);
if (!fw_name) { if (!fw_name) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment