From 990fd241b70a66562a0472a4bfede1860f37072f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 8 Dec 2023 12:14:39 +0000 Subject: [PATCH] input: goodix: Support output-only reset lines Although the motivation behind initialising the reset GPIO as an input is sound, it prevents the driver from being used with an output-only GPIO controller. Fall back to trying to create it as an output. See: https://forums.raspberrypi.com/viewtopic.php?t=361103 Signed-off-by: Phil Elwell --- drivers/input/touchscreen/goodix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 0c5fd9789edf41..66c2d41fb58af4 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -1060,6 +1060,8 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts) /* Get the reset line GPIO pin number */ gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags); + if (IS_ERR(gpiod)) + gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_OUT_LOW); if (IS_ERR(gpiod)) { error = PTR_ERR(gpiod); if (error != -EPROBE_DEFER)