diff mbox series

[08/10] input: iqs5xx: Allow more time for ATI to complete

Message ID 1611002626-5889-9-git-send-email-jeff@labundy.com (mailing list archive)
State Accepted
Commit 8e6a8b0c9fe98b905a2ae4f9f91296eb4f82b9ae
Headers show
Series input: iqs5xx: Minor enhancements and optimizations | expand

Commit Message

Jeff LaBundy Jan. 18, 2021, 8:43 p.m. UTC
After the device is initialized, it runs ATI (calibration) during
which it cannot readily respond to I2C communication. To keep the
open and close callbacks from writing to the device too soon, the
driver waits 100 ms before returning from probe.

The vendor reports that ATI may actually take up to 250 ms to run
(including margin), so increase the delay accordingly. Update the
comments to clarify the reason for the delay as well.

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
---
 drivers/input/touchscreen/iqs5xx.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Dmitry Torokhov Jan. 25, 2021, 4:41 a.m. UTC | #1
On Mon, Jan 18, 2021 at 02:43:44PM -0600, Jeff LaBundy wrote:
> After the device is initialized, it runs ATI (calibration) during
> which it cannot readily respond to I2C communication. To keep the
> open and close callbacks from writing to the device too soon, the
> driver waits 100 ms before returning from probe.
> 
> The vendor reports that ATI may actually take up to 250 ms to run
> (including margin), so increase the delay accordingly. Update the
> comments to clarify the reason for the delay as well.
> 
> Signed-off-by: Jeff LaBundy <jeff@labundy.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
index 50b9344..babd1f1 100644
--- a/drivers/input/touchscreen/iqs5xx.c
+++ b/drivers/input/touchscreen/iqs5xx.c
@@ -648,13 +648,12 @@  static int iqs5xx_dev_init(struct i2c_client *client)
 	iqs5xx->bl_status = dev_id_info->bl_status;
 
 	/*
-	 * Closure of the first communication window that appears following the
-	 * release of reset appears to kick off an initialization period during
-	 * which further communication is met with clock stretching. The return
-	 * from this function is delayed so that further communication attempts
-	 * avoid this period.
+	 * The following delay allows ATI to complete before the open and close
+	 * callbacks are free to elicit I2C communication. Any attempts to read
+	 * from or write to the device during this time may face extended clock
+	 * stretching and prompt the I2C controller to report an error.
 	 */
-	msleep(100);
+	msleep(250);
 
 	return 0;
 }