Skip to content

Commit eb43335

Browse files
ndyerdtor
authored andcommitted
Input: atmel_mxt_ts - use mxt_acquire_irq in mxt_soft_reset
If using IRQF_TRIGGER_FALLING, then there is a race here: if the reset completes before we enable the IRQ, then CHG is already low and touch will be broken. This has been seen on Chromebook Pixel 2. A workaround is to reconfig T18 COMMSCONFIG to enable the RETRIGEN bit using mxt-app: mxt-app -W -T18 44 mxt-app --backup Tested-by: Tom Rini <[email protected]> Signed-off-by: Nick Dyer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 6984ab1 commit eb43335

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
10931093
return 0;
10941094
}
10951095

1096+
static int mxt_acquire_irq(struct mxt_data *data)
1097+
{
1098+
int error;
1099+
1100+
enable_irq(data->irq);
1101+
1102+
error = mxt_process_messages_until_invalid(data);
1103+
if (error)
1104+
return error;
1105+
1106+
return 0;
1107+
}
1108+
10961109
static int mxt_soft_reset(struct mxt_data *data)
10971110
{
10981111
struct device *dev = &data->client->dev;
@@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data)
11111124
/* Ignore CHG line for 100ms after reset */
11121125
msleep(100);
11131126

1114-
enable_irq(data->irq);
1127+
mxt_acquire_irq(data);
11151128

11161129
ret = mxt_wait_for_completion(data, &data->reset_completion,
11171130
MXT_RESET_TIMEOUT);
@@ -1466,19 +1479,6 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg)
14661479
return ret;
14671480
}
14681481

1469-
static int mxt_acquire_irq(struct mxt_data *data)
1470-
{
1471-
int error;
1472-
1473-
enable_irq(data->irq);
1474-
1475-
error = mxt_process_messages_until_invalid(data);
1476-
if (error)
1477-
return error;
1478-
1479-
return 0;
1480-
}
1481-
14821482
static int mxt_get_info(struct mxt_data *data)
14831483
{
14841484
struct i2c_client *client = data->client;

0 commit comments

Comments
 (0)