Skip to content

Commit

Permalink
Input: atmel_mxt_ts: add a second try if initialization fails
Browse files Browse the repository at this point in the history
For an unknown reason, the maxtouch can not ack the i2c request when we
want to communicate. Trying to establish the communication finally works
after about 200 ms. So when probing the driver if the first time
initilization fails then wait and try a second time.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
[nicolas.ferre@microchip.com: change lost while moving to github driver
re-integrate it here]
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
  • Loading branch information
ldesroches authored and noglitch committed Jun 12, 2017
1 parent 374cc83 commit a1994ec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -3727,8 +3727,14 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
}

error = mxt_initialize(data);
if (error)
goto err_free_irq;
if (error) {
/* Wait and try a second time */
msleep(MXT_RESET_TIME);
dev_warn(&client->dev, "Try a second time to init maxtouch\n");
error = mxt_initialize(data);
if (error)
goto err_free_irq;
}

return 0;

Expand Down

0 comments on commit a1994ec

Please sign in to comment.