From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Benjamin Rood <benjaminjrood@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan MacDonald <dmacdonald@curbellmedical.com>
Subject: Re: 0001-Input-pixcir_i2c_ts-lengthen-reset-pulse-to-touchscr
Date: Thu, 11 Aug 2022 16:07:46 -0700 [thread overview]
Message-ID: <YvWLwpQemH1Rm95r@google.com> (raw)
In-Reply-To: <Mailbird-54ba6c13-8fd5-42db-9ad8-fc347c3039f4@gmail.com>
Hi Benjamin,
On Thu, Aug 11, 2022 at 02:33:13PM -0400, Benjamin Rood wrote:
> From bd53d80e1966320f8d6f2775337043cbac2d1b6e Mon Sep 17 00:00:00 2001
> From: Benjamin Rood <benjaminjrood@gmail.com>
> Date: Thu, 11 Aug 2022 14:18:16 -0400
> Subject: [PATCH] Input: pixcir_i2c_ts - lengthen reset pulse to touchscreen
> controller
>
> This patch adjust the reset pulse in the pixcir_i2c_ts driver to address
> the following issues:
>
> 1. Not driving the reset signal HIGH for a long enough period, resulting
> in a "shark fin" reset signal.
> 2. Not waiting long enough after assering the reset signal to issue the
> first I2C transaction, which results in a NACK because the touchscreen
> controller was not ready to communicate. This typically results in the
> touchscreen controller not enumerating as an input device.
>
> The changes included in this patch address the above two issues by:
>
> 1. Configuring the delay after driving the reset signal HIGH to use
> usleep_range(500, 1000) to allow the reset signal to reach a full logic
> HIGH voltage for a maximum period of 1ms. This is overkill as the
> datasheet specs 80ns as the minimum duration of the reset pulse, so by
> overshooting the timing by quite a lot, it gives the driving chip enough
> time to drive a logic HIGH to assert the reset.
I guess 1 msec is not that bad...
> 2. Configuring the delay after de-asserting the reset signal to be a
> duration of 1s before issuing the first I2C transaction. This allows
> the touchscreen controller to fully boot which avoids a NACK an a
> missing input device.
but 1 sec is insanely long, especially for driver that is not marked for
async probe. I wonder, since (I assume) the time to get out of reset
state is not specified in the datasheet, if we could not retry I2C xfers
with a small delays between them instead of waiting for whole second.
How long does it actually take for the controller to exit the reset
state on your system?
>
> Kudos also should be given to my colleage Dan MacDonald
> <dmacdonald@curbellmedical.com> for helping to discover and fix these
> issues.
>
> Signed-off-by: Benjamin Rood <benjaminjrood@gmail.com>
> ---
> drivers/input/touchscreen/pixcir_i2c_ts.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
> index dc148b4bed74..324e41886dea 100644
> --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
> +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
> @@ -222,10 +222,10 @@ static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata)
> {
> if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) {
> gpiod_set_value_cansleep(tsdata->gpio_reset, 1);
> - ndelay(100); /* datasheet section 1.2.3 says 80ns min. */
> + usleep_range(500, 1000); /* datasheet section 1.2.3 says 80ns min. */
> gpiod_set_value_cansleep(tsdata->gpio_reset, 0);
> /* wait for controller ready. 100ms guess. */
> - msleep(100);
> + msleep(1000);
Please note that the patch is whitespace-damaged. Did you paste it into
gmail UI?
> }
> }
>
> --
> 2.25.1
Thanks.
--
Dmitry
next parent reply other threads:[~2022-08-11 23:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Mailbird-54ba6c13-8fd5-42db-9ad8-fc347c3039f4@gmail.com>
2022-08-11 23:07 ` Dmitry Torokhov [this message]
2022-08-16 21:15 ` [PATCH v2] Input: pixcir_i2c_ts - lengthen reset pulse to touchscreen controller Benjamin Rood
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=YvWLwpQemH1Rm95r@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=benjaminjrood@gmail.com \
--cc=dmacdonald@curbellmedical.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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.