* [PATCH 2/2] dt-bindings: net: add enc28j60's irq-gpios node description and binding example
@ 2025-03-09 7:48 Hanyuan Zhao
2025-03-09 15:46 ` Andrew Lunn
2025-03-09 17:55 ` Krzysztof Kozlowski
0 siblings, 2 replies; 3+ messages in thread
From: Hanyuan Zhao @ 2025-03-09 7:48 UTC (permalink / raw)
To: davem, kuba, andrew+netdev, edumazet, pabeni
Cc: netdev, linux-kernel, Hanyuan Zhao
This patch allows the kernel to automatically requests the pin, configures
it as an input, and converts it to an IRQ number, according to a GPIO
phandle specified in device tree. This simplifies the process by
eliminating the need to manually define pinctrl and interrupt nodes.
Additionally, it is necessary for platforms that do not support pin
configuration and properties via the device tree.
Signed-off-by: Hanyuan Zhao <hanyuan-z@qq.com>
---
.../bindings/net/microchip,enc28j60.txt | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/microchip,enc28j60.txt b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
index a8275921a896..e6423635e55b 100644
--- a/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
+++ b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
@@ -8,6 +8,8 @@ the SPI master node.
Required properties:
- compatible: Should be "microchip,enc28j60"
- reg: Specify the SPI chip select the ENC28J60 is wired to
+
+Required interrupt properties with pin control subsystem:
- interrupts: Specify the interrupt index within the interrupt controller (referred
to above in interrupt-parent) and interrupt type. The ENC28J60 natively
generates falling edge interrupts, however, additional board logic
@@ -17,6 +19,14 @@ Required properties:
see also generic and your platform specific pinctrl binding
documentation.
+Required interrupt properties with a single GPIO phandle:
+- irq-gpios: Specify the GPIO pin used as the interrupt line. When this property is
+ set, the kernel automatically requests the pin, configures it as an input,
+ and converts it to an IRQ number. This simplifies the process by
+ eliminating the need to manually define pinctrl and interrupt nodes.
+ Additionally, it is necessary for platforms that do not support pin
+ configuration and properties via the device tree.
+
Optional properties:
- spi-max-frequency: Maximum frequency of the SPI bus when accessing the ENC28J60.
According to the ENC28J80 datasheet, the chip allows a maximum of 20 MHz, however,
@@ -54,3 +64,17 @@ Example (for NXP i.MX28 with pin control stuff for GPIO irq):
fsl,pull-up = <MXS_PULL_DISABLE>;
};
};
+
+Example (if can not configure pin properties via the device tree):
+
+ &spi2 {
+ status = "okay";
+ cs-gpios = <&porta 23 GPIO_ACTIVE_LOW>;
+
+ enc28j60: ethernet@1 {
+ compatible = "microchip,enc28j60";
+ reg = <0>;
+ spi-max-frequency = <12000000>;
+ irq-gpios = <&porta 24 GPIO_ACTIVE_HIGH>;
+ };
+ };
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] dt-bindings: net: add enc28j60's irq-gpios node description and binding example
2025-03-09 7:48 [PATCH 2/2] dt-bindings: net: add enc28j60's irq-gpios node description and binding example Hanyuan Zhao
@ 2025-03-09 15:46 ` Andrew Lunn
2025-03-09 17:55 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-03-09 15:46 UTC (permalink / raw)
To: Hanyuan Zhao
Cc: davem, kuba, andrew+netdev, edumazet, pabeni, netdev,
linux-kernel
On Sun, Mar 09, 2025 at 03:48:38PM +0800, Hanyuan Zhao wrote:
> This patch allows the kernel to automatically requests the pin, configures
> it as an input, and converts it to an IRQ number, according to a GPIO
> phandle specified in device tree. This simplifies the process by
> eliminating the need to manually define pinctrl and interrupt nodes.
> Additionally, it is necessary for platforms that do not support pin
> configuration and properties via the device tree.
>
> Signed-off-by: Hanyuan Zhao <hanyuan-z@qq.com>
> ---
> .../bindings/net/microchip,enc28j60.txt | 24 +++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/microchip,enc28j60.txt b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
> index a8275921a896..e6423635e55b 100644
> --- a/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
> +++ b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
The DT Maintainers have a strong preference that you first convert to
yaml, and then make extension.
> @@ -8,6 +8,8 @@ the SPI master node.
> Required properties:
> - compatible: Should be "microchip,enc28j60"
> - reg: Specify the SPI chip select the ENC28J60 is wired to
> +
> +Required interrupt properties with pin control subsystem:
> - interrupts: Specify the interrupt index within the interrupt controller (referred
> to above in interrupt-parent) and interrupt type. The ENC28J60 natively
> generates falling edge interrupts, however, additional board logic
You should be able to use the interrupts property and just point it
at a GPIO controller that supports interrupts.
We really need a better understanding of:
> Additionally, it is necessary for platforms that do not support pin
> configuration and properties via the device tree.
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] dt-bindings: net: add enc28j60's irq-gpios node description and binding example
2025-03-09 7:48 [PATCH 2/2] dt-bindings: net: add enc28j60's irq-gpios node description and binding example Hanyuan Zhao
2025-03-09 15:46 ` Andrew Lunn
@ 2025-03-09 17:55 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-09 17:55 UTC (permalink / raw)
To: Hanyuan Zhao, davem, kuba, andrew+netdev, edumazet, pabeni
Cc: netdev, linux-kernel
On 09/03/2025 08:48, Hanyuan Zhao wrote:
> This patch allows the kernel to automatically requests the pin, configures
> it as an input, and converts it to an IRQ number, according to a GPIO
> phandle specified in device tree. This simplifies the process by
> eliminating the need to manually define pinctrl and interrupt nodes.
> Additionally, it is necessary for platforms that do not support pin
> configuration and properties via the device tree.
>
> Signed-off-by: Hanyuan Zhao <hanyuan-z@qq.com>
<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC (and consider --no-git-fallback argument, so you will
not CC people just because they made one commit years ago). It might
happen, that command when run on an older kernel, gives you outdated
entries. Therefore please be sure you base your patches on recent Linux
kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline) or work on fork of kernel
(don't, instead use mainline). Just use b4 and everything should be
fine, although remember about `b4 prep --auto-to-cc` if you added new
patches to the patchset.
</form letter>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-09 17:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-09 7:48 [PATCH 2/2] dt-bindings: net: add enc28j60's irq-gpios node description and binding example Hanyuan Zhao
2025-03-09 15:46 ` Andrew Lunn
2025-03-09 17:55 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).