Skip to content

Commit bd8905d

Browse files
committed
platform/x86: x86-android-tablets: Fix keyboard touchscreen on Lenovo Yogabook1 X90
After commit 4014ae2 ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs") the touchscreen in the keyboard half of the Lenovo Yogabook1 X90 stopped working with the following error: Goodix-TS i2c-goodix_ts: error -EBUSY: Failed to get irq GPIO The problem is that when getting the IRQ for instantiated i2c_client-s from a GPIO (rather then using an IRQ directly from the IOAPIC), x86_acpi_irq_helper_get() now properly requests the GPIO, which disallows other drivers from requesting it. Normally this is a good thing, but the goodix touchscreen also uses the IRQ as an output during reset to select which of its 2 possible I2C addresses should be used. Add a new free_gpio flag to struct x86_acpi_irq_data to deal with this and release the GPIO after getting the IRQ in this special case. Fixes: 4014ae2 ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs") Cc: [email protected] Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 76d41fb commit bd8905d

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

drivers/platform/x86/x86-android-tablets/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ int x86_acpi_irq_helper_get(const struct x86_acpi_irq_data *data)
113113
if (irq_type != IRQ_TYPE_NONE && irq_type != irq_get_trigger_type(irq))
114114
irq_set_irq_type(irq, irq_type);
115115

116+
if (data->free_gpio)
117+
devm_gpiod_put(&x86_android_tablet_device->dev, gpiod);
118+
116119
return irq;
117120
case X86_ACPI_IRQ_TYPE_PMIC:
118121
status = acpi_get_handle(NULL, data->chip, &handle);

drivers/platform/x86/x86-android-tablets/lenovo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst
116116
.trigger = ACPI_EDGE_SENSITIVE,
117117
.polarity = ACPI_ACTIVE_LOW,
118118
.con_id = "goodix_ts_irq",
119+
.free_gpio = true,
119120
},
120121
}, {
121122
/* Wacom Digitizer in keyboard half */

drivers/platform/x86/x86-android-tablets/x86-android-tablets.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct x86_acpi_irq_data {
3939
int index;
4040
int trigger; /* ACPI_EDGE_SENSITIVE / ACPI_LEVEL_SENSITIVE */
4141
int polarity; /* ACPI_ACTIVE_HIGH / ACPI_ACTIVE_LOW / ACPI_ACTIVE_BOTH */
42+
bool free_gpio; /* Release GPIO after getting IRQ (for TYPE_GPIOINT) */
4243
const char *con_id;
4344
};
4445

0 commit comments

Comments
 (0)