Commit c61ac36f authored by Linus Walleij's avatar Linus Walleij Committed by Dmitry Torokhov

Input: cyttsp - reduce reset pulse timings

The data sheet for CY8CTMA340 specifies that the reset pulse shall be at
least 1 ms. Specify 1-2 ms with usleep_range() to cut some slack for the
scheduler.

Curiously the datasheet does not specify how long we have to wait after a
hard reset until the chip is up, but I have found a vendor tree (Samsung
GT-S7710) that has code for this touch screen and there this is set to 5
ms so I use this with the same 1 ms fuzz.
Reviewed-by: default avatarJavier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210408131153.3446138-6-linus.walleij@linaro.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 39841136
...@@ -229,10 +229,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts) ...@@ -229,10 +229,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts)
static void cyttsp_hard_reset(struct cyttsp *ts) static void cyttsp_hard_reset(struct cyttsp *ts)
{ {
if (ts->reset_gpio) { if (ts->reset_gpio) {
/*
* According to the CY8CTMA340 datasheet page 21, the external
* reset pulse width should be >= 1 ms. The datasheet does not
* specify how long we have to wait after reset but a vendor
* tree specifies 5 ms here.
*/
gpiod_set_value_cansleep(ts->reset_gpio, 1); gpiod_set_value_cansleep(ts->reset_gpio, 1);
msleep(CY_DELAY_DFLT); usleep_range(1000, 2000);
gpiod_set_value_cansleep(ts->reset_gpio, 0); gpiod_set_value_cansleep(ts->reset_gpio, 0);
msleep(CY_DELAY_DFLT); usleep_range(5000, 6000);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment