linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elan_i2c - Clean INT stats in FW updating for old Elan touchpad
@ 2017-05-24  9:43 KT Liao
  2017-05-25 17:09 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: KT Liao @ 2017-05-24  9:43 UTC (permalink / raw)
  To: linux-kernel, linux-input, dmitry.torokhov; +Cc: phoenix, kt.liao

Some old touchapd FWs have interrupt issue after FW updating.
Use reading 34 bytes before IC reset command to clean INT stauts
The modification has been tested in some chromebook system
It should not affect general touchpad in Linux system.

Signed-off-by: KT Liao <kt.liao@emc.com.tw>
---
 drivers/input/mouse/elan_i2c_i2c.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c
index 3be75c6e..842f852 100644
--- a/drivers/input/mouse/elan_i2c_i2c.c
+++ b/drivers/input/mouse/elan_i2c_i2c.c
@@ -612,7 +612,14 @@ static int elan_i2c_finish_fw_update(struct i2c_client *client,
 	long ret;
 	int error;
 	int len;
-	u8 buffer[ETP_I2C_INF_LENGTH];
+	u8 buffer[ETP_I2C_REPORT_LEN];
+
+	len = i2c_master_recv(client, buffer, ETP_I2C_REPORT_LEN);
+	if (len != ETP_I2C_REPORT_LEN) {
+		error = len < 0 ? len : -EIO;
+		dev_warn(dev, "failed to read I2C data after FW WDT reset: %d (%d)\n",
+			error, len);
+	}
 
 	reinit_completion(completion);
 	enable_irq(client->irq);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: elan_i2c - Clean INT stats in FW updating for old Elan touchpad
  2017-05-24  9:43 [PATCH] Input: elan_i2c - Clean INT stats in FW updating for old Elan touchpad KT Liao
@ 2017-05-25 17:09 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2017-05-25 17:09 UTC (permalink / raw)
  To: KT Liao; +Cc: linux-kernel, linux-input, phoenix

On Wed, May 24, 2017 at 05:43:39PM +0800, KT Liao wrote:
> Some old touchapd FWs have interrupt issue after FW updating.
> Use reading 34 bytes before IC reset command to clean INT stauts
> The modification has been tested in some chromebook system
> It should not affect general touchpad in Linux system.
> 
> Signed-off-by: KT Liao <kt.liao@emc.com.tw>

Applied, thank you.

> ---
>  drivers/input/mouse/elan_i2c_i2c.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/elan_i2c_i2c.c b/drivers/input/mouse/elan_i2c_i2c.c
> index 3be75c6e..842f852 100644
> --- a/drivers/input/mouse/elan_i2c_i2c.c
> +++ b/drivers/input/mouse/elan_i2c_i2c.c
> @@ -612,7 +612,14 @@ static int elan_i2c_finish_fw_update(struct i2c_client *client,
>  	long ret;
>  	int error;
>  	int len;
> -	u8 buffer[ETP_I2C_INF_LENGTH];
> +	u8 buffer[ETP_I2C_REPORT_LEN];
> +
> +	len = i2c_master_recv(client, buffer, ETP_I2C_REPORT_LEN);
> +	if (len != ETP_I2C_REPORT_LEN) {
> +		error = len < 0 ? len : -EIO;
> +		dev_warn(dev, "failed to read I2C data after FW WDT reset: %d (%d)\n",
> +			error, len);
> +	}
>  
>  	reinit_completion(completion);
>  	enable_irq(client->irq);
> -- 
> 2.7.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-25 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24  9:43 [PATCH] Input: elan_i2c - Clean INT stats in FW updating for old Elan touchpad KT Liao
2017-05-25 17:09 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).