The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [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

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