Skip to content

Commit 8fb81d2

Browse files
OresteSalerno-TomTomdtor
authored andcommitted
Input: cyttsp - perform hard reset of the chip during probe
Since we removed support for calling an init() callback from the platform data, introduce a function which initializes the chip by performing a hard reset, using the reset gpio defined in the device properties. Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 707b61b commit 8fb81d2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/input/touchscreen/cyttsp_core.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts)
240240
return retval;
241241
}
242242

243+
static void cyttsp_hard_reset(struct cyttsp *ts)
244+
{
245+
if (ts->reset_gpio) {
246+
gpiod_set_value_cansleep(ts->reset_gpio, 1);
247+
msleep(CY_DELAY_DFLT);
248+
gpiod_set_value_cansleep(ts->reset_gpio, 0);
249+
msleep(CY_DELAY_DFLT);
250+
}
251+
}
252+
243253
static int cyttsp_soft_reset(struct cyttsp *ts)
244254
{
245255
unsigned long timeout;
@@ -666,6 +676,8 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
666676

667677
disable_irq(ts->irq);
668678

679+
cyttsp_hard_reset(ts);
680+
669681
error = cyttsp_power_on(ts);
670682
if (error)
671683
return ERR_PTR(error);

0 commit comments

Comments
 (0)