Skip to content

Commit 56b25a0

Browse files
ldesrochesehristev
authored andcommitted
Input: atmel_mxt_ts: add a second try if initialization fails
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> [eugen.hristev@microchip.com: adapted original patch to 4.14> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
1 parent 8889a6b commit 56b25a0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,8 +3210,14 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
32103210
disable_irq(client->irq);
32113211

32123212
error = mxt_initialize(data);
3213-
if (error)
3214-
return error;
3213+
if (error) {
3214+
/* Wait and try a second time */
3215+
msleep(MXT_RESET_TIME);
3216+
dev_warn(&client->dev, "Try a second time to init maxtouch\n");
3217+
error = mxt_initialize(data);
3218+
if (error)
3219+
return error;
3220+
}
32153221

32163222
error = sysfs_create_group(&client->dev.kobj, &mxt_attr_group);
32173223
if (error) {

0 commit comments

Comments
 (0)