diff mbox series

Input: ili210x - Fix reset timing

Message ID 20220518163430.41192-1-marex@denx.de
State Superseded
Headers show
Series Input: ili210x - Fix reset timing | expand

Commit Message

Marek Vasut May 18, 2022, 4:34 p.m. UTC
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(-)

Comments

Greg KH May 18, 2022, 4:49 p.m. UTC | #1
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);
>  		gpiod_set_value_cansleep(reset_gpio, 0);
> -		msleep(100);
> +		msleep(160);
>  	}
>  
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> -- 
> 2.35.1
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>
diff mbox series

Patch

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);
 		gpiod_set_value_cansleep(reset_gpio, 0);
-		msleep(100);
+		msleep(160);
 	}
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);