All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff LaBundy <jeff@labundy.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, Jeff LaBundy <jeff@labundy.com>
Subject: [PATCH 08/10] input: iqs5xx: Allow more time for ATI to complete
Date: Mon, 18 Jan 2021 14:43:44 -0600	[thread overview]
Message-ID: <1611002626-5889-9-git-send-email-jeff@labundy.com> (raw)
In-Reply-To: <1611002626-5889-1-git-send-email-jeff@labundy.com>

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(-)

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;
 }
-- 
2.7.4


  parent reply	other threads:[~2021-01-18 20:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 20:43 [PATCH 00/10] input: iqs5xx: Minor enhancements and optimizations Jeff LaBundy
2021-01-18 20:43 ` [PATCH 01/10] input: iqs5xx: Minor cosmetic improvements Jeff LaBundy
2021-01-25  4:16   ` Dmitry Torokhov
2021-01-18 20:43 ` [PATCH 02/10] input: iqs5xx: Preserve bootloader errors Jeff LaBundy
2021-01-25  4:16   ` Dmitry Torokhov
2021-01-18 20:43 ` [PATCH 03/10] input: iqs5xx: Accommodate bootloader latency Jeff LaBundy
2021-01-25  4:19   ` Dmitry Torokhov
2021-01-18 20:43 ` [PATCH 04/10] input: iqs5xx: Expose firmware revision to user space Jeff LaBundy
2021-01-25  4:22   ` Dmitry Torokhov
2021-01-26  2:54     ` Jeff LaBundy
2021-01-18 20:43 ` [PATCH 05/10] input: iqs5xx: Re-initialize device upon warm reset Jeff LaBundy
2021-01-25  4:32   ` Dmitry Torokhov
2021-01-18 20:43 ` [PATCH 06/10] input: iqs5xx: Simplify axis setup logic Jeff LaBundy
2021-01-25  4:40   ` Dmitry Torokhov
2021-01-18 20:43 ` [PATCH 07/10] input: iqs5xx: Eliminate unnecessary register read Jeff LaBundy
2021-01-25  4:41   ` Dmitry Torokhov
2021-01-18 20:43 ` Jeff LaBundy [this message]
2021-01-25  4:41   ` [PATCH 08/10] input: iqs5xx: Allow more time for ATI to complete Dmitry Torokhov
2021-01-18 20:43 ` [PATCH 09/10] input: iqs5xx: Make reset GPIO optional Jeff LaBundy
2021-01-25  4:43   ` Dmitry Torokhov
2021-01-26  3:10     ` Jeff LaBundy
2021-01-18 20:43 ` [PATCH 10/10] input: iqs5xx: Allow device to be a wake-up source Jeff LaBundy
2021-01-25  4:44   ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1611002626-5889-9-git-send-email-jeff@labundy.com \
    --to=jeff@labundy.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.