[PATCH 3/7] Input: s6sy761 - add reset GPIO support

From: Lukas Timmermann

Date: Sun Oct 11 2026 - 08:48:25 EST


Some boards wire up the controller's reset line. Hold the controller
in reset while its supplies come up and release it 10 ms later, as the
vendor driver does, and assert it again on power down. The GPIO is
optional, so boards without it are unaffected.

Signed-off-by: Lukas Timmermann <foss@timmermann.space>
---
drivers/input/touchscreen/s6sy761_core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/input/touchscreen/s6sy761_core.c b/drivers/input/touchscreen/s6sy761_core.c
index 0e455060dbc0..8541cd9aa930 100644
--- a/drivers/input/touchscreen/s6sy761_core.c
+++ b/drivers/input/touchscreen/s6sy761_core.c
@@ -7,6 +7,7 @@

#include <linux/unaligned.h>
#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
@@ -100,6 +101,7 @@ struct s6sy761_data {
struct mutex xfer_lock;
int irq;
struct regulator_bulk_data regulators[2];
+ struct gpio_desc *reset_gpio;
struct input_dev *input;
struct touchscreen_properties prop;

@@ -297,6 +299,9 @@ static int s6sy761_power_on(struct s6sy761_data *sdata)
if (ret)
return ret;

+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(sdata->reset_gpio, 0);
+
msleep(140);

/* double check whether the touch is functional */
@@ -370,6 +375,7 @@ static void s6sy761_power_off(void *data)
struct s6sy761_data *sdata = data;

disable_irq(sdata->irq);
+ gpiod_set_value_cansleep(sdata->reset_gpio, 1);
regulator_bulk_disable(ARRAY_SIZE(sdata->regulators),
sdata->regulators);
}
@@ -406,6 +412,12 @@ int s6sy761_probe(struct device *dev, const struct s6sy761_bus_ops *bus_ops, int
if (err)
return err;

+ sdata->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+ GPIOD_OUT_HIGH);
+ if (IS_ERR(sdata->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(sdata->reset_gpio),
+ "failed to get reset GPIO\n");
+
err = devm_add_action_or_reset(dev, s6sy761_power_off, sdata);
if (err)
return err;

--
2.56.0