> {
> > int error;
> >
> > @@ -252,17 +273,24 @@ static int elan_query_device_info(struct elan_tp_data
> > *data)
> > if (error)
> > return error;
> >
> > - error = data->ops->get_version(data->client, false, &data->fw_version);
> > + error = data->ops->get_sm_version(data->client, &data->ic_type,
> > + &data->sm_version);
> > if (error)
> > return error;
> >
> > - error = data->ops->get_checksum(data->client, false,
> > - &data->fw_checksum);
> > + return 0;
> > +}
> > +
> > +static int elan_query_device_info(struct elan_tp_data *data)
> > +{
> > + int error;
> > +
> > + error = data->ops->get_version(data->client, false, &data->fw_version);
> > if (error)
> > return error;
> >
> > - error = data->ops->get_sm_version(data->client, &data->ic_type,
> > - &data->sm_version);
> > + error = data->ops->get_checksum(data->client, false,
> > + &data->fw_checksum);
> > if (error)
> > return error;
> >
> > @@ -419,6 +447,7 @@ static int elan_update_firmware(struct elan_tp_data
> > *data,
> > data->ops->iap_reset(client);
> > } else {
> > /* Reinitialize TP after fw is updated */
> > + elan_query_device_pid_smver(data);
> > elan_initialize(data);
> > elan_query_device_info(data);
> > }
> > @@ -757,6 +786,22 @@ out:
> > return retval;
> > }
> >
> > +static int check_ASUS_special_fw(struct elan_tp_data *data)
> > +{
> > + if (data->ic_type != 0x0E)
> > + return false;
> > +
> > + switch (data->product_id) {
> > + case 0x05:
> > + case 0x06:
> > + case 0x07:
> > + case 0x09:
> > + case 0x013:
> > + return true;
> > + default:
> > + return false;
> > + }
> > +}
> >
> > static DEVICE_ATTR_WO(acquire);
> > static DEVICE_ATTR_RO(min);
> > @@ -1033,6 +1078,10 @@ static int elan_probe(struct i2c_client *client,
> > return error;
> > }
> >
> > + error = elan_query_device_pid_smver(data);
> > + if (error)
> > + return error;
>
> The original code was fetching product ID and IC type after calling the
> transport "initialize" function; I'd prefer if we kept this order.
>
> Could you tell me if the following version of the patch looks OK to you?
>
> Vlad, Chris, Jonathan, could you please tell me if this version of the
> patch fixes your touchpad issue?
>
> Thanks!
>
> --
> Dmitry
>
>
> Input: elan_i2c - properly wake up touchpad on ASUS laptops
>
> From: KT Liao
>
> Some ASUS laptops were shipped with touchpads that require to be woken up
> first, before trying to switch them into absolute reporting mode, otherwise
> touchpad would fail to work while flooding the logs with:
>
> elan_i2c i2c-ELAN1000:00: invalid report id data (1)
>
> Among affected devices are Asus E202SA, N552VW, X456UF, UX305CA, and
> others. We detect such devices by checking the IC type and product ID
> numbers and adjusting order of operations accordingly.
>
> Signed-off-by: KT Liao
> Reported-by: Chris Chiu
> Reported-by: Vlad Glagolev
> Cc: sta...@vger.kernel.org
> Signed-off-by: Dmitry Torokhov
> ---
> drivers/input/mouse/elan_i2c_core.c | 79
> ---
> 1 file changed, 63 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/input/mouse/elan_i2c_core.c
> b/drivers/input/mouse/elan_i2c_core.c
> index 2f58985..d15b338 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -4,7 +4,8 @@
> * Copyright (c) 2013 ELAN Microelectronics Corp.
> *
> * Author: 林政維 (Duson Lin)
> - * Version: 1.6.0
> + * Author: KT Liao
> + * Version: 1.6.2
> *
> * Based on cyapa driver:
> * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
> @@ -40,7 +41,7 @@
> #include "elan_i2c.h"
>
> #define DRIVER_NAME "elan_i2c"
> -#define ELAN_DRIVER_VERSION "1.6.1"
> +#define ELAN_DRIVER_VERSION "1.6.2"
> #define ELAN_VENDOR_ID 0x04f3
> #define ETP_MAX_PRESSUR