Message ID | 20150919171047.GA7081@dtor-ws (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, Sep 19, 2015 at 11:10 AM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote: > I do not like the fact that the fact that the version of IAP is unknown > is not known to the driver until we try to flash the firmware. I'd > rather we check it upfront and warn user. > > How about the version of the patch below? That looks fine and I also confirmed that the new patch is working as described. Thanks Daniel -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Sep 21, 2015 at 08:28:17AM -0600, Daniel Drake wrote: > On Sat, Sep 19, 2015 at 11:10 AM, Dmitry Torokhov > <dmitry.torokhov@gmail.com> wrote: > > I do not like the fact that the fact that the version of IAP is unknown > > is not known to the driver until we try to flash the firmware. I'd > > rather we check it upfront and warn user. > > > > How about the version of the patch below? > > That looks fine and I also confirmed that the new patch is working as described. Great, I am applying this then.
On Mon, Sep 21, 2015 at 09:17:40AM -0700, Dmitry Torokhov wrote: > On Mon, Sep 21, 2015 at 08:28:17AM -0600, Daniel Drake wrote: > > On Sat, Sep 19, 2015 at 11:10 AM, Dmitry Torokhov > > <dmitry.torokhov@gmail.com> wrote: > > > I do not like the fact that the fact that the version of IAP is unknown > > > is not known to the driver until we try to flash the firmware. I'd > > > rather we check it upfront and warn user. > > > > > > How about the version of the patch below? > > > > That looks fine and I also confirmed that the new patch is working as described. > > Great, I am applying this then. Duson, by the way, what is the FW parameters for iap 0x0e? Could you send me a patch? Thanks!
Hi Dmitry, Sure, not only 0x0E but also others, I will send you a patch. Thank you, Duson -----Original Message----- From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] Sent: Tuesday, September 22, 2015 12:21 AM To: Daniel Drake Cc: DusonLin; João Paulo Rechi Vita; linux-input@vger.kernel.org Subject: Re: [PATCH v2] elan_i2c - Don't require known iap version On Mon, Sep 21, 2015 at 09:17:40AM -0700, Dmitry Torokhov wrote: > On Mon, Sep 21, 2015 at 08:28:17AM -0600, Daniel Drake wrote: > > On Sat, Sep 19, 2015 at 11:10 AM, Dmitry Torokhov > > <dmitry.torokhov@gmail.com> wrote: > > > I do not like the fact that the fact that the version of IAP is > > > unknown is not known to the driver until we try to flash the > > > firmware. I'd rather we check it upfront and warn user. > > > > > > How about the version of the patch below? > > > > That looks fine and I also confirmed that the new patch is working as described. > > Great, I am applying this then. Duson, by the way, what is the FW parameters for iap 0x0e? Could you send me a patch? Thanks! -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index fa94530..7cad819 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -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, &data->fw_signature_address); - if (error) { - dev_err(&data->client->dev, - "unknown iap version %d\n", data->iap_version); - return error; - } + if (error) + dev_warn(&data->client->dev, + "unexpected iap version %#04x (ic type: %#04x), firmware update will not work\n", + data->iap_version, data->ic_type); return 0; } @@ -486,6 +485,9 @@ static ssize_t elan_sysfs_update_fw(struct device *dev, const u8 *fw_signature; 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. */ fw_name = kasprintf(GFP_KERNEL, ETP_FW_NAME, data->product_id); if (!fw_name) {