public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] Input: ili210x - Fix reset timing
Date: Wed, 18 May 2022 22:52:54 +0200	[thread overview]
Message-ID: <f0556115-e51e-ca87-c3f1-64e0d33c4f0f@denx.de> (raw)
In-Reply-To: <YoVEftKRoTndAn9R@google.com>

On 5/18/22 21:09, Dmitry Torokhov wrote:
> On Wed, May 18, 2022 at 06:34:30PM +0200, Marek Vasut wrote:
>> According to Ilitek "231x & ILI251x Programming Guide" Version: 2.30
>> "2.1. Power Sequence", "T4 Chip Reset and discharge time" is minimum
>> 10ms and "T2 Chip initial time" is maximum 150ms. Adjust the reset
>> timings such that T4 is 15ms and T2 is 160ms to fit those figures.
>>
>> This prevents sporadic touch controller start up failures when some
>> systems with at least ILI251x controller boot, without this patch
>> the systems sometimes fail to communicate with the touch controller.
>>
>> Fixes: 201f3c803544c ("Input: ili210x - add reset GPIO support")
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> ---
>>   drivers/input/touchscreen/ili210x.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
>> index 2bd407d86bae5..131cb648a82ae 100644
>> --- a/drivers/input/touchscreen/ili210x.c
>> +++ b/drivers/input/touchscreen/ili210x.c
>> @@ -951,9 +951,9 @@ static int ili210x_i2c_probe(struct i2c_client *client,
>>   		if (error)
>>   			return error;
>>   
>> -		usleep_range(50, 100);
>> +		msleep(15);
> 
> WARNING: msleep < 20ms can sleep for up to 20ms; see
> Documentation/timers/timers-howto.rst
> #38: FILE: drivers/input/touchscreen/ili210x.c:954:
> +               msleep(15);

Sigh, yes, fixed in V2 to be 12..15ms .

> Should this be usleep_range(10000, 15000) like in
> ili251x_hardware_reset()? Actually, should we adopt
> ili251x_hardware_reset() to be used there?

I'll send a separate patch for that, it is indeed a good idea, but I 
think we should keep the fix as simple as possible for backporting ?

      reply	other threads:[~2022-05-18 20:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 16:34 [PATCH] Input: ili210x - Fix reset timing Marek Vasut
2022-05-18 16:49 ` Greg KH
2022-05-18 19:09 ` Dmitry Torokhov
2022-05-18 20:52   ` Marek Vasut [this message]

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=f0556115-e51e-ca87-c3f1-64e0d33c4f0f@denx.de \
    --to=marex@denx.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox