Skip to content

Commit 12e0201

Browse files
KT Liaogregkh
authored andcommitted
Input: elan_i2c - clear INT before resetting controller
[ Upstream commit 4b3c7db ] Some old touchpad FWs need to have interrupt cleared before issuing reset command after updating firmware. We clear interrupt by attempting to read full report from the controller, and discarding any data read. Signed-off-by: KT Liao <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 78aa52d commit 12e0201

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/input/mouse/elan_i2c_i2c.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,14 @@ static int elan_i2c_finish_fw_update(struct i2c_client *client,
557557
long ret;
558558
int error;
559559
int len;
560-
u8 buffer[ETP_I2C_INF_LENGTH];
560+
u8 buffer[ETP_I2C_REPORT_LEN];
561+
562+
len = i2c_master_recv(client, buffer, ETP_I2C_REPORT_LEN);
563+
if (len != ETP_I2C_REPORT_LEN) {
564+
error = len < 0 ? len : -EIO;
565+
dev_warn(dev, "failed to read I2C data after FW WDT reset: %d (%d)\n",
566+
error, len);
567+
}
561568

562569
reinit_completion(completion);
563570
enable_irq(client->irq);

0 commit comments

Comments
 (0)