From: Krzysztof Kozlowski <krzk@kernel.org>
To: Xianwei Zhao <xianwei.zhao@amlogic.com>, Conor Dooley <conor@kernel.org>
Cc: Linus Walleij <linusw@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-amlogic@lists.infradead.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH RFC 1/2] dt-bindings: pinctl: amlogic,pinctrl-a4: Add gpio irq property
Date: Mon, 15 Jun 2026 07:32:40 +0200 [thread overview]
Message-ID: <542ec217-1187-4fb2-8fd3-b90a6143b84d@kernel.org> (raw)
In-Reply-To: <a79e58b5-3a11-4593-847d-ba92527549bf@amlogic.com>
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:
>> Re: [PATCH RFC 1/2] dt-bindings: pinctl: amlogic,pinctrl-a4: Add gpio
>> irq property
>> From:
>> Conor Dooley <conor@kernel.org>
>> Date:
>> 2026/6/12 01:39
>>
>> To:
>> xianwei.zhao@amlogic.com
>> CC:
>> Linus Walleij <linusw@kernel.org>, Rob Herring <robh@kernel.org>,
>> Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley
>> <conor+dt@kernel.org>, Neil Armstrong <neil.armstrong@linaro.org>, Kevin
>> Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>,
>> Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
>> linux-amlogic@lists.infradead.org, linux-gpio@vger.kernel.org,
>> devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
>> linux-arm-kernel@lists.infradead.org
>>
>>
>>
>> On Thu, Jun 11, 2026 at 07:54:33AM +0000, Xianwei Zhao via B4 Relay wrote:
>>> From: Xianwei Zhao<xianwei.zhao@amlogic.com>
>>>
>>> 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.
>> Uhhhhh, what? Why can't you just use the normal interrupts property?
>>
>
> The interrupt cannot be used directly because the GPIO bank only
> 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,
> 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@amlogic.com>
>>> ---
Best regards,
Krzysztof
next prev parent reply other threads:[~2026-06-15 5:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 7:54 [PATCH RFC 0/2] pinctrl: Add support gpiod_to_irq Xianwei Zhao via B4 Relay
2026-06-11 7:54 ` [PATCH RFC 1/2] dt-bindings: pinctl: amlogic,pinctrl-a4: Add gpio irq property Xianwei Zhao via B4 Relay
2026-06-11 17:39 ` Conor Dooley
2026-06-15 2:47 ` Xianwei Zhao
2026-06-15 5:32 ` Krzysztof Kozlowski [this message]
2026-06-16 2:54 ` Xianwei Zhao
2026-06-15 16:52 ` Conor Dooley
2026-06-16 2:56 ` Xianwei Zhao
2026-06-11 7:54 ` [PATCH RFC 2/2] pinctrl: meson: amlogic-a4: support gpiod_to_irq Xianwei Zhao via B4 Relay
2026-06-11 12:51 ` [PATCH RFC 0/2] pinctrl: Add " Linus Walleij
2026-06-15 3:17 ` Xianwei Zhao
2026-06-15 12:59 ` Linus Walleij
2026-06-16 2:45 ` Xianwei Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542ec217-1187-4fb2-8fd3-b90a6143b84d@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=xianwei.zhao@amlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox