linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: goodix - Accept ACPI resources with gpio_count == 3 && gpio_int_idx == 0
@ 2023-12-23 14:16 Hans de Goede
  2024-01-19  8:55 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2023-12-23 14:16 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Hans de Goede, Bastien Nocera, linux-input

Some devices list 3 Gpio resources in the ACPI resource list for
the touchscreen:

1. GpioInt resource pointing to the GPIO used for the interrupt
2. GpioIo resource pointing to the reset GPIO
3. GpioIo resource pointing to the GPIO used for the interrupt

Note how the third extra GpioIo resource really is a duplicate
of the GpioInt provided info.

Ignore this extra GPIO, treating this setup the same as gpio_count == 2 &&
gpio_int_idx == 0 fixes the touchscreen not working on the Thunderbook
Colossus W803 rugged tablet and likely also on the CyberBook_T116K.

Reported-by: Maarten van der Schrieck
Closes: https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver/-/issues/22
Suggested-by: Maarten van der Schrieck
Tested-by: Maarten van der Schrieck
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note Maarten has requested for their email to not be made public.
---
 drivers/input/touchscreen/goodix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index af32fbe57b63..b068ff8afbc9 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -884,7 +884,8 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
 		}
 	}
 
-	if (ts->gpio_count == 2 && ts->gpio_int_idx == 0) {
+	/* Some devices with gpio_int_idx 0 list a third unused GPIO */
+	if ((ts->gpio_count == 2 || ts->gpio_count == 3) && ts->gpio_int_idx == 0) {
 		ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
 		gpio_mapping = acpi_goodix_int_first_gpios;
 	} else if (ts->gpio_count == 2 && ts->gpio_int_idx == 1) {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: goodix - Accept ACPI resources with gpio_count == 3 && gpio_int_idx == 0
  2023-12-23 14:16 [PATCH] Input: goodix - Accept ACPI resources with gpio_count == 3 && gpio_int_idx == 0 Hans de Goede
@ 2024-01-19  8:55 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2024-01-19  8:55 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Bastien Nocera, linux-input

On Sat, Dec 23, 2023 at 03:16:50PM +0100, Hans de Goede wrote:
> Some devices list 3 Gpio resources in the ACPI resource list for
> the touchscreen:
> 
> 1. GpioInt resource pointing to the GPIO used for the interrupt
> 2. GpioIo resource pointing to the reset GPIO
> 3. GpioIo resource pointing to the GPIO used for the interrupt
> 
> Note how the third extra GpioIo resource really is a duplicate
> of the GpioInt provided info.
> 
> Ignore this extra GPIO, treating this setup the same as gpio_count == 2 &&
> gpio_int_idx == 0 fixes the touchscreen not working on the Thunderbook
> Colossus W803 rugged tablet and likely also on the CyberBook_T116K.
> 
> Reported-by: Maarten van der Schrieck
> Closes: https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver/-/issues/22
> Suggested-by: Maarten van der Schrieck
> Tested-by: Maarten van der Schrieck
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-19  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-23 14:16 [PATCH] Input: goodix - Accept ACPI resources with gpio_count == 3 && gpio_int_idx == 0 Hans de Goede
2024-01-19  8:55 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).