linux-047-atmel-mxt-retry-init.patch 887 B

123456789101112131415161718192021222324252627
  1. diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
  2. index 2979cf3..b1de293 100644
  3. --- a/drivers/input/touchscreen/atmel_mxt_ts.c
  4. +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
  5. @@ -4065,6 +4065,7 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
  6. {
  7. struct mxt_data *data;
  8. int error;
  9. + int mxt_initialize_loops = 3; /* loopcount for mxt_initialize */
  10. /*
  11. * Ignore devices that do not have device properties attached to
  12. @@ -4147,6 +4148,14 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
  13. }
  14. error = mxt_initialize(data);
  15. + while (error && mxt_initialize_loops) {
  16. + dev_info(&client->dev, "Retry mxt_initialize %d !!!\n", mxt_initialize_loops);
  17. + msleep(100);
  18. + error = mxt_initialize(data);
  19. + --mxt_initialize_loops;
  20. + }
  21. +
  22. +
  23. if (error)
  24. return error;