* [PATCH] Input: cyttsp5 - ensure minimum reset pulse width
@ 2025-02-04 19:01 Hugo Villeneuve
2025-02-05 10:15 ` Alistair
2025-02-05 15:33 ` Dmitry Torokhov
0 siblings, 2 replies; 4+ messages in thread
From: Hugo Villeneuve @ 2025-02-04 19:01 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov, Alistair Francis, Maxime Ripard,
Mylène Josserand
Cc: hugo, Hugo Villeneuve, stable, linux-input, linux-kernel
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
The current reset pulse width is measured to be 5us on a
Renesas RZ/G2L SOM. The manufacturer's minimum reset pulse width is
specified as 10us.
Extend reset pulse width to make sure it is long enough on all platforms.
Also reword confusing comments about reset pin assertion.
Fixes: 5b0c03e24a06 ("Input: Add driver for Cypress Generation 5 touchscreen")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
drivers/input/touchscreen/cyttsp5.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
index eafe5a9b8964..bb09e84d0e92 100644
--- a/drivers/input/touchscreen/cyttsp5.c
+++ b/drivers/input/touchscreen/cyttsp5.c
@@ -870,13 +870,16 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
ts->input->phys = ts->phys;
input_set_drvdata(ts->input, ts);
- /* Reset the gpio to be in a reset state */
+ /* Assert gpio to be in a reset state */
ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ts->reset_gpio)) {
error = PTR_ERR(ts->reset_gpio);
dev_err(dev, "Failed to request reset gpio, error %d\n", error);
return error;
}
+
+ fsleep(1000); /* Ensure long-enough reset pulse (minimum 10us). */
+
gpiod_set_value_cansleep(ts->reset_gpio, 0);
/* Need a delay to have device up */
base-commit: 0de63bb7d91975e73338300a57c54b93d3cc151c
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Input: cyttsp5 - ensure minimum reset pulse width
2025-02-04 19:01 [PATCH] Input: cyttsp5 - ensure minimum reset pulse width Hugo Villeneuve
@ 2025-02-05 10:15 ` Alistair
2025-02-05 15:33 ` Dmitry Torokhov
1 sibling, 0 replies; 4+ messages in thread
From: Alistair @ 2025-02-05 10:15 UTC (permalink / raw)
To: Hugo Villeneuve, Linus Walleij, Dmitry Torokhov, Maxime Ripard,
Mylène Josserand
Cc: Hugo Villeneuve, stable, linux-input, Linux Kernel Mailing List
On Wed, 5 Feb 2025, at 5:01 AM, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> The current reset pulse width is measured to be 5us on a
> Renesas RZ/G2L SOM. The manufacturer's minimum reset pulse width is
> specified as 10us.
>
> Extend reset pulse width to make sure it is long enough on all platforms.
>
> Also reword confusing comments about reset pin assertion.
>
> Fixes: 5b0c03e24a06 ("Input: Add driver for Cypress Generation 5 touchscreen")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Acked-by: Alistair Francis <alistair@alistair23.me>
> ---
> drivers/input/touchscreen/cyttsp5.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
> index eafe5a9b8964..bb09e84d0e92 100644
> --- a/drivers/input/touchscreen/cyttsp5.c
> +++ b/drivers/input/touchscreen/cyttsp5.c
> @@ -870,13 +870,16 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> ts->input->phys = ts->phys;
> input_set_drvdata(ts->input, ts);
>
> - /* Reset the gpio to be in a reset state */
> + /* Assert gpio to be in a reset state */
> ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> if (IS_ERR(ts->reset_gpio)) {
> error = PTR_ERR(ts->reset_gpio);
> dev_err(dev, "Failed to request reset gpio, error %d\n", error);
> return error;
> }
> +
> + fsleep(1000); /* Ensure long-enough reset pulse (minimum 10us). */
> +
> gpiod_set_value_cansleep(ts->reset_gpio, 0);
>
> /* Need a delay to have device up */
>
> base-commit: 0de63bb7d91975e73338300a57c54b93d3cc151c
> --
> 2.39.5
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Input: cyttsp5 - ensure minimum reset pulse width
2025-02-04 19:01 [PATCH] Input: cyttsp5 - ensure minimum reset pulse width Hugo Villeneuve
2025-02-05 10:15 ` Alistair
@ 2025-02-05 15:33 ` Dmitry Torokhov
2025-02-05 15:50 ` Hugo Villeneuve
1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2025-02-05 15:33 UTC (permalink / raw)
To: Hugo Villeneuve
Cc: Linus Walleij, Alistair Francis, Maxime Ripard,
Mylène Josserand, Hugo Villeneuve, stable, linux-input,
linux-kernel
On Tue, Feb 04, 2025 at 02:01:00PM -0500, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> The current reset pulse width is measured to be 5us on a
> Renesas RZ/G2L SOM. The manufacturer's minimum reset pulse width is
> specified as 10us.
>
> Extend reset pulse width to make sure it is long enough on all platforms.
>
> Also reword confusing comments about reset pin assertion.
>
> Fixes: 5b0c03e24a06 ("Input: Add driver for Cypress Generation 5 touchscreen")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> ---
> drivers/input/touchscreen/cyttsp5.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
> index eafe5a9b8964..bb09e84d0e92 100644
> --- a/drivers/input/touchscreen/cyttsp5.c
> +++ b/drivers/input/touchscreen/cyttsp5.c
> @@ -870,13 +870,16 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> ts->input->phys = ts->phys;
> input_set_drvdata(ts->input, ts);
>
> - /* Reset the gpio to be in a reset state */
> + /* Assert gpio to be in a reset state */
> ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> if (IS_ERR(ts->reset_gpio)) {
> error = PTR_ERR(ts->reset_gpio);
> dev_err(dev, "Failed to request reset gpio, error %d\n", error);
> return error;
> }
> +
> + fsleep(1000); /* Ensure long-enough reset pulse (minimum 10us). */
> +
If the manufacturer specified that 10us is enough why do we want to wait
100 times longer?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Input: cyttsp5 - ensure minimum reset pulse width
2025-02-05 15:33 ` Dmitry Torokhov
@ 2025-02-05 15:50 ` Hugo Villeneuve
0 siblings, 0 replies; 4+ messages in thread
From: Hugo Villeneuve @ 2025-02-05 15:50 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linus Walleij, Alistair Francis, Maxime Ripard,
Mylène Josserand, Hugo Villeneuve, stable, linux-input,
linux-kernel
On Wed, 5 Feb 2025 07:33:36 -0800
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Tue, Feb 04, 2025 at 02:01:00PM -0500, Hugo Villeneuve wrote:
> > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> >
> > The current reset pulse width is measured to be 5us on a
> > Renesas RZ/G2L SOM. The manufacturer's minimum reset pulse width is
> > specified as 10us.
> >
> > Extend reset pulse width to make sure it is long enough on all platforms.
> >
> > Also reword confusing comments about reset pin assertion.
> >
> > Fixes: 5b0c03e24a06 ("Input: Add driver for Cypress Generation 5 touchscreen")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > ---
> > drivers/input/touchscreen/cyttsp5.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
> > index eafe5a9b8964..bb09e84d0e92 100644
> > --- a/drivers/input/touchscreen/cyttsp5.c
> > +++ b/drivers/input/touchscreen/cyttsp5.c
> > @@ -870,13 +870,16 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> > ts->input->phys = ts->phys;
> > input_set_drvdata(ts->input, ts);
> >
> > - /* Reset the gpio to be in a reset state */
> > + /* Assert gpio to be in a reset state */
> > ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> > if (IS_ERR(ts->reset_gpio)) {
> > error = PTR_ERR(ts->reset_gpio);
> > dev_err(dev, "Failed to request reset gpio, error %d\n", error);
> > return error;
> > }
> > +
> > + fsleep(1000); /* Ensure long-enough reset pulse (minimum 10us). */
> > +
>
> If the manufacturer specified that 10us is enough why do we want to wait
> 100 times longer?
Hi,
10us would do fine. I simply put 1ms because it is then much easier to
see the reset pulse on an oscilloscope when correlating it
with other signals.
Hugo.
--
Hugo Villeneuve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-05 15:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 19:01 [PATCH] Input: cyttsp5 - ensure minimum reset pulse width Hugo Villeneuve
2025-02-05 10:15 ` Alistair
2025-02-05 15:33 ` Dmitry Torokhov
2025-02-05 15:50 ` Hugo Villeneuve
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).