Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: tsc2004/5 - fix reset handling on probe

When the driver has been converted to use gpiod API it was requesting
and asserting the reset on probe, but never deasserted it. However
because of incorrect annotations in device tree marking reset line as
active high whereas in reality it is active low, the end result was
that the chip was never reset on probe. With polarity of the reset line
now corrected this became a problem.

Fix this by calling tsc200x_reset() from tsc200x_probe() to properly
complete the reset sequence and move requesting the reset GPIO and VIO
supply closer to the point where we need to start talking to the
hardware.

Fixes: d257f2980feb ("Input: tsc2005 - convert to gpiod")
Link: https://lore.kernel.org/r/20240711172719.1248373-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+15 -13
+15 -13
drivers/input/touchscreen/tsc200x-core.c
··· 486 486 &esd_timeout); 487 487 ts->esd_timeout = error ? 0 : esd_timeout; 488 488 489 - ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); 490 - if (IS_ERR(ts->reset_gpio)) { 491 - error = PTR_ERR(ts->reset_gpio); 492 - dev_err(dev, "error acquiring reset gpio: %d\n", error); 493 - return error; 494 - } 495 - 496 - error = devm_regulator_get_enable(dev, "vio"); 497 - if (error) { 498 - dev_err(dev, "error acquiring vio regulator: %d\n", error); 499 - return error; 500 - } 501 - 502 489 mutex_init(&ts->mutex); 503 490 504 491 spin_lock_init(&ts->lock); ··· 525 538 0, MAX_12BIT, TSC200X_DEF_P_FUZZ, 0); 526 539 527 540 touchscreen_parse_properties(input_dev, false, &ts->prop); 541 + 542 + ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); 543 + error = PTR_ERR_OR_ZERO(ts->reset_gpio); 544 + if (error) { 545 + dev_err(dev, "error acquiring reset gpio: %d\n", error); 546 + return error; 547 + } 548 + 549 + error = devm_regulator_get_enable(dev, "vio"); 550 + if (error) { 551 + dev_err(dev, "error acquiring vio regulator: %d\n", error); 552 + return error; 553 + } 554 + 555 + tsc200x_reset(ts); 528 556 529 557 /* Ensure the touchscreen is off */ 530 558 tsc200x_stop_scan(ts);