All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Input: ili210x - Fix reset timing
@ 2022-05-18 20:49 Marek Vasut
  2022-05-18 21:32 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2022-05-18 20:49 UTC (permalink / raw)
  To: linux-input; +Cc: Marek Vasut, Dmitry Torokhov

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 12ms 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>
---
V2: Use usleep_range() for shorter 12..15ms delay
---
 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..3a48262fb3d35 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);
+		usleep_range(12000, 15000);
 		gpiod_set_value_cansleep(reset_gpio, 0);
-		msleep(100);
+		msleep(160);
 	}
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Input: ili210x - Fix reset timing
  2022-05-18 20:49 [PATCH v2] Input: ili210x - Fix reset timing Marek Vasut
@ 2022-05-18 21:32 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2022-05-18 21:32 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-input

On Wed, May 18, 2022 at 10:49:01PM +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 12ms 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>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-18 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 20:49 [PATCH v2] Input: ili210x - Fix reset timing Marek Vasut
2022-05-18 21:32 ` Dmitry Torokhov

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.