Re: [PATCH RFC 1/2] dt-bindings: pinctl: amlogic,pinctrl-a4: Add gpio irq property
From: Xianwei Zhao
Date: Mon Jun 15 2026 - 22:55:07 EST
Hi Krzysztof,
Thanks for your detailed review. After considering the feedback, I think this approach is not suitable, so I will drop this patch.
On 2026/6/15 13:32, Krzysztof Kozlowski wrote:
On 15/06/2026 04:47, Xianwei Zhao wrote:
Hi Conor,
Thanks for your review.
On 2026/6/12 01:39, Conor Dooley wrote:
Subject:The interrupt cannot be used directly because the GPIO bank only
Re: [PATCH RFC 1/2] dt-bindings: pinctl: amlogic,pinctrl-a4: Add gpio
irq property
From:
Conor Dooley<conor@xxxxxxxxxx>
Date:
2026/6/12 01:39
To:
xianwei.zhao@xxxxxxxxxxx
CC:
Linus Walleij<linusw@xxxxxxxxxx>, Rob Herring<robh@xxxxxxxxxx>,
Krzysztof Kozlowski<krzk+dt@xxxxxxxxxx>, Conor Dooley
<conor+dt@xxxxxxxxxx>, Neil Armstrong<neil.armstrong@xxxxxxxxxx>, Kevin
Hilman<khilman@xxxxxxxxxxxx>, Jerome Brunet<jbrunet@xxxxxxxxxxxx>,
Martin Blumenstingl<martin.blumenstingl@xxxxxxxxxxxxxx>,
linux-amlogic@xxxxxxxxxxxxxxxxxxx,linux-gpio@xxxxxxxxxxxxxxx,
devicetree@xxxxxxxxxxxxxxx,linux-kernel@xxxxxxxxxxxxxxx,
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
On Thu, Jun 11, 2026 at 07:54:33AM +0000, Xianwei Zhao via B4 Relay wrote:
From: Xianwei Zhao<xianwei.zhao@xxxxxxxxxxx>Uhhhhh, what? Why can't you just use the normal interrupts property?
Add the hw-irq property for each GPIO bank and enable interrupt-parent
for pinctrl so that gpiod_to_irq() can translate GPIO lines to IRQs.
provides an IRQ base, which does not have a one-to-one mapping with the
actual hardware interrupts.
On Amlogic SoCs, GPIO interrupts are handled through a mux. Multiple
GPIO pins are mapped to a limited number of real interrupt sources. The
implementation can be found here:
https://github.com/torvalds/linux/blob/master/drivers/irqchip/irq-meson-gpio.c
To use a GPIO interrupt, an unused hardware interrupt must first be
allocated, and then the corresponding mux register must be configured.
This allocation and mapping are already implemented in the existing driver.
In that driver, the mapping is performed dynamically rather than simply
calculating:
irq = irq_start + gpio_offset
If the interrupt is used directly, only the GPIO index can be obtained.
If it is performed dynamically, then it is not suitable for DT.
You still did not explain what hardware aspect exactly is described by
"hw-irq".
The real interrupt number cannot be derived by simply adding an offset,Best regards,
because the hardware interrupt must be allocated first. Pre-allocating
all interrupts during initialization would prevent later GPIOs from
obtaining available interrupt sources.
Perhaps other names would be more appropriate here, such as "irq_start".
Signed-off-by: Xianwei Zhao<xianwei.zhao@xxxxxxxxxxx>
---
Krzysztof