Skip to content

Commit d982992

Browse files
jwrdegoededtor
authored andcommitted
Input: goodix - workaround Cherry Trail devices with a bogus ACPI Interrupt() resource
ACPI/x86 devices with a Cherry Trail SoC should have a GpioInt + a regular GPIO ACPI resource in their ACPI tables. Some CHT devices have a bug, where the also is bogus interrupt resource (likely copied from a previous Bay Trail based generation of the device). The i2c-core-acpi code will assign the bogus, non-working, interrupt resource to client->irq. Add a workaround to fix this up. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2043960 Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d176708 commit d982992

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

drivers/input/touchscreen/goodix.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
864864
const struct acpi_gpio_mapping *gpio_mapping = NULL;
865865
struct device *dev = &ts->client->dev;
866866
LIST_HEAD(resources);
867-
int ret;
867+
int irq, ret;
868868

869869
ts->gpio_count = 0;
870870
ts->gpio_int_idx = -1;
@@ -877,6 +877,20 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
877877

878878
acpi_dev_free_resource_list(&resources);
879879

880+
/*
881+
* CHT devices should have a GpioInt + a regular GPIO ACPI resource.
882+
* Some CHT devices have a bug (where the also is bogus Interrupt
883+
* resource copied from a previous BYT based generation). i2c-core-acpi
884+
* will use the non-working Interrupt resource, fix this up.
885+
*/
886+
if (soc_intel_is_cht() && ts->gpio_count == 2 && ts->gpio_int_idx != -1) {
887+
irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
888+
if (irq > 0 && irq != ts->client->irq) {
889+
dev_warn(dev, "Overriding IRQ %d -> %d\n", ts->client->irq, irq);
890+
ts->client->irq = irq;
891+
}
892+
}
893+
880894
if (ts->gpio_count == 2 && ts->gpio_int_idx == 0) {
881895
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
882896
gpio_mapping = acpi_goodix_int_first_gpios;

0 commit comments

Comments
 (0)