]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl-amd: enable IRQ for WACF2200 touchscreen on Lenovo Yoga 7 14AGP11
authorHardik Prakash <hardikprakash.official@gmail.com>
Tue, 12 May 2026 07:31:38 +0000 (13:01 +0530)
committerLinus Walleij <linusw@kernel.org>
Wed, 13 May 2026 07:34:55 +0000 (09:34 +0200)
On Lenovo Yoga 7 14AGP11 (83TD), the WACF2200 touchscreen controller
is wired via I2C2 (AMDI0010:02) with its interrupt on GPIO pin 157
(confirmed via ACPI _CRS GpioInt decode). After amd_gpio_irq_init()
clears all GPIO interrupts at boot, pin 157 is never re-enabled,
preventing the touchscreen from signalling the driver.

Windows keeps GPIO 157 INTERRUPT_ENABLE (bit 11) and INTERRUPT_MASK
(bit 12) set after initialisation. Add a DMI quirk to restore these
bits after amd_gpio_irq_init() on this hardware.

Assisted-by: Claude:claude-sonnet-4-6
Assisted-by: GPT-Codex:gpt-5.2-codex
Signed-off-by: Hardik Prakash <hardikprakash.official@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/pinctrl-amd.c

index e3128b0045d22e8cba4775a1ef3726fdf448ca96..64315b0edf2a6824ec796099a4b613f23b1b3e7a 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
 #include <linux/pinctrl/pinconf.h>
+#include <linux/dmi.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinmux.h>
 #include <linux/string_choices.h>
 static struct amd_gpio *pinctrl_dev;
 #endif
 
+static const struct dmi_system_id amd_gpio_quirk_yoga7_14agp11[] = {
+       {
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "83TD"),
+                       DMI_MATCH(DMI_BOARD_NAME, "LNVNB161216"),
+               },
+       },
+       { }
+};
+
+static void amd_gpio_apply_quirks(struct amd_gpio *gpio_dev)
+{
+       const unsigned int pin = 157; /* WACF2200 GpioInt per ACPI _CRS */
+       unsigned long flags;
+       u32 reg;
+
+       if (!dmi_check_system(amd_gpio_quirk_yoga7_14agp11))
+               return;
+       if (pin >= gpio_dev->gc.ngpio)
+               return;
+
+       raw_spin_lock_irqsave(&gpio_dev->lock, flags);
+       reg = readl(gpio_dev->base + pin * 4);
+       reg |= BIT(INTERRUPT_ENABLE_OFF) | BIT(INTERRUPT_MASK_OFF);
+       writel(reg, gpio_dev->base + pin * 4);
+       raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
+
+       dev_info(&gpio_dev->pdev->dev,
+                "Enabled IRQ for GPIO %u (Yoga 7 14AGP11 touchscreen)\n",
+                pin);
+}
+
 static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset)
 {
        unsigned long flags;
@@ -1219,6 +1253,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
 
        /* Disable and mask interrupts */
        amd_gpio_irq_init(gpio_dev);
+       amd_gpio_apply_quirks(gpio_dev);
 
        girq = &gpio_dev->gc.irq;
        gpio_irq_chip_set_chip(girq, &amd_gpio_irqchip);