Message ID | 20201104070804.32044-1-jingle.wu@emc.com.tw |
---|---|
State | New |
Headers | show |
Series | Input: elan_i2c - Modify the correct input of the iap page type command. | expand |
Hi Jingle, On Wed, Nov 04, 2020 at 03:08:04PM +0800, jingle.wu wrote: > The iap page type command of the parameter is page_size. You need to supply your "Signed-off-by: " for me to apply this patch. Thanks! > --- > drivers/input/mouse/elan_i2c.h | 2 +- > drivers/input/mouse/elan_i2c_core.c | 3 ++- > drivers/input/mouse/elan_i2c_i2c.c | 10 +++++----- > drivers/input/mouse/elan_i2c_smbus.c | 2 +- > 4 files changed, 9 insertions(+), 8 deletions(-) > > diff --git a/drivers/input/mouse/elan_i2c.h b/drivers/input/mouse/elan_i2c.h > index c75b00c45d75..36e3cd908671 100644 > --- a/drivers/input/mouse/elan_i2c.h > +++ b/drivers/input/mouse/elan_i2c.h > @@ -78,7 +78,7 @@ struct elan_transport_ops { > int (*iap_reset)(struct i2c_client *client); > > int (*prepare_fw_update)(struct i2c_client *client, u16 ic_type, > - u8 iap_version); > + u8 iap_version, u16 fw_page_size); > int (*write_fw_block)(struct i2c_client *client, u16 fw_page_size, > const u8 *page, u16 checksum, int idx); > int (*finish_fw_update)(struct i2c_client *client, > diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c > index c599e21a8478..61ed3f5ca219 100644 > --- a/drivers/input/mouse/elan_i2c_core.c > +++ b/drivers/input/mouse/elan_i2c_core.c > @@ -497,7 +497,8 @@ static int __elan_update_firmware(struct elan_tp_data *data, > u16 sw_checksum = 0, fw_checksum = 0; > > error = data->ops->prepare_fw_update(client, data->ic_type, > - data->iap_version); > + data->iap_version, > + data->fw_page_size); > if (error) > return error; > > diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c > index 5a496d4ffa49..13dc097eb6c6 100644 > --- a/drivers/input/mouse/elan_i2c_i2c.c > +++ b/drivers/input/mouse/elan_i2c_i2c.c > @@ -517,7 +517,7 @@ static int elan_i2c_set_flash_key(struct i2c_client *client) > return 0; > } > > -static int elan_read_write_iap_type(struct i2c_client *client) > +static int elan_read_write_iap_type(struct i2c_client *client, u16 fw_page_size) > { > int error; > u16 constant; > @@ -526,7 +526,7 @@ static int elan_read_write_iap_type(struct i2c_client *client) > > do { > error = elan_i2c_write_cmd(client, ETP_I2C_IAP_TYPE_CMD, > - ETP_I2C_IAP_TYPE_REG); > + fw_page_size / 2); > if (error) { > dev_err(&client->dev, > "cannot write iap type: %d\n", error); > @@ -543,7 +543,7 @@ static int elan_read_write_iap_type(struct i2c_client *client) > constant = le16_to_cpup((__le16 *)val); > dev_dbg(&client->dev, "iap type reg: 0x%04x\n", constant); > > - if (constant == ETP_I2C_IAP_TYPE_REG) > + if (constant == fw_page_size / 2) > return 0; > > } while (--retry > 0); > @@ -553,7 +553,7 @@ static int elan_read_write_iap_type(struct i2c_client *client) > } > > static int elan_i2c_prepare_fw_update(struct i2c_client *client, u16 ic_type, > - u8 iap_version) > + u8 iap_version, u16 fw_page_size) > { > struct device *dev = &client->dev; > int error; > @@ -594,7 +594,7 @@ static int elan_i2c_prepare_fw_update(struct i2c_client *client, u16 ic_type, > } > > if (ic_type >= 0x0D && iap_version >= 1) { > - error = elan_read_write_iap_type(client); > + error = elan_read_write_iap_type(client, fw_page_size); > if (error) > return error; > } > diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c > index 8ff823751f3b..1820f1cfc1dc 100644 > --- a/drivers/input/mouse/elan_i2c_smbus.c > +++ b/drivers/input/mouse/elan_i2c_smbus.c > @@ -340,7 +340,7 @@ static int elan_smbus_set_flash_key(struct i2c_client *client) > } > > static int elan_smbus_prepare_fw_update(struct i2c_client *client, u16 ic_type, > - u8 iap_version) > + u8 iap_version, u16 fw_page_size) > { > struct device *dev = &client->dev; > int len; > -- > 2.17.1 > -- Dmitry
diff --git a/drivers/input/mouse/elan_i2c.h b/drivers/input/mouse/elan_i2c.h index c75b00c45d75..36e3cd908671 100644 --- a/drivers/input/mouse/elan_i2c.h +++ b/drivers/input/mouse/elan_i2c.h @@ -78,7 +78,7 @@ struct elan_transport_ops { int (*iap_reset)(struct i2c_client *client); int (*prepare_fw_update)(struct i2c_client *client, u16 ic_type, - u8 iap_version); + u8 iap_version, u16 fw_page_size); int (*write_fw_block)(struct i2c_client *client, u16 fw_page_size, const u8 *page, u16 checksum, int idx); int (*finish_fw_update)(struct i2c_client *client, diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index c599e21a8478..61ed3f5ca219 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -497,7 +497,8 @@ static int __elan_update_firmware(struct elan_tp_data *data, u16 sw_checksum = 0, fw_checksum = 0; error = data->ops->prepare_fw_update(client, data->ic_type, - data->iap_version); + data->iap_version, + data->fw_page_size); if (error) return error; diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c index 5a496d4ffa49..13dc097eb6c6 100644 --- a/drivers/input/mouse/elan_i2c_i2c.c +++ b/drivers/input/mouse/elan_i2c_i2c.c @@ -517,7 +517,7 @@ static int elan_i2c_set_flash_key(struct i2c_client *client) return 0; } -static int elan_read_write_iap_type(struct i2c_client *client) +static int elan_read_write_iap_type(struct i2c_client *client, u16 fw_page_size) { int error; u16 constant; @@ -526,7 +526,7 @@ static int elan_read_write_iap_type(struct i2c_client *client) do { error = elan_i2c_write_cmd(client, ETP_I2C_IAP_TYPE_CMD, - ETP_I2C_IAP_TYPE_REG); + fw_page_size / 2); if (error) { dev_err(&client->dev, "cannot write iap type: %d\n", error); @@ -543,7 +543,7 @@ static int elan_read_write_iap_type(struct i2c_client *client) constant = le16_to_cpup((__le16 *)val); dev_dbg(&client->dev, "iap type reg: 0x%04x\n", constant); - if (constant == ETP_I2C_IAP_TYPE_REG) + if (constant == fw_page_size / 2) return 0; } while (--retry > 0); @@ -553,7 +553,7 @@ static int elan_read_write_iap_type(struct i2c_client *client) } static int elan_i2c_prepare_fw_update(struct i2c_client *client, u16 ic_type, - u8 iap_version) + u8 iap_version, u16 fw_page_size) { struct device *dev = &client->dev; int error; @@ -594,7 +594,7 @@ static int elan_i2c_prepare_fw_update(struct i2c_client *client, u16 ic_type, } if (ic_type >= 0x0D && iap_version >= 1) { - error = elan_read_write_iap_type(client); + error = elan_read_write_iap_type(client, fw_page_size); if (error) return error; } diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c index 8ff823751f3b..1820f1cfc1dc 100644 --- a/drivers/input/mouse/elan_i2c_smbus.c +++ b/drivers/input/mouse/elan_i2c_smbus.c @@ -340,7 +340,7 @@ static int elan_smbus_set_flash_key(struct i2c_client *client) } static int elan_smbus_prepare_fw_update(struct i2c_client *client, u16 ic_type, - u8 iap_version) + u8 iap_version, u16 fw_page_size) { struct device *dev = &client->dev; int len;