Re: [PATCH v12 08/11] gpiolib: request ACPI GPIO events for external IRQ domains
From: Mika Westerberg
Date: Tue Oct 27 2026 - 01:35:27 EST
On Tue, Oct 27, 2026 at 12:18:55PM +0800, Long Zhao via B4 Relay wrote:
> From: Long Zhao <longzhao@xxxxxxxxxxxxx>
>
> gpiochip_add_irqchip() requests GPIO-signaled ACPI events after
> installing the irqchip. A gpiochip that gets its IRQ domain through
> gpiochip_irqchip_add_domain() never goes through that path, so _AEI
> events, such as the power button on ARM64 ACPI platforms, are not
> requested.
>
> Request them here as well. gpiochip_remove() already calls
> acpi_gpiochip_free_interrupts().
>
> Cc: Mika Westerberg <westeri@xxxxxxxxxx>
One tiny comment below, other than that looks good to me,
Acked-by: Mika Westerberg (Intel) <westeri@xxxxxxxxxx>
> Cc: linux-acpi@xxxxxxxxxxxxxxx
> Signed-off-by: Long Zhao <longzhao@xxxxxxxxxxxxx>
> ---
> drivers/gpio/gpiolib.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index e5fb60111151..63c51d9ee0bf 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2353,7 +2353,15 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gc)
> int gpiochip_irqchip_add_domain(struct gpio_chip *gc,
> struct irq_domain *domain)
> {
> - return gpiochip_irqchip_add_allocated_domain(gc, domain, true);
> + int ret;
> +
> + ret = gpiochip_irqchip_add_allocated_domain(gc, domain, true);
> + if (ret)
> + return ret;
> +
> + acpi_gpiochip_request_interrupts(gc);
> +
Looks better if you drop this empty line.
> + return 0;
> }
> EXPORT_SYMBOL_GPL(gpiochip_irqchip_add_domain);
>
>
> --
> 2.34.1
>