Re: [PATCH 1/2] net: enc28j60: support getting irq number from gpio phandle in the device tree

From: hanyuan
Date: Sun Mar 09 2025 - 22:42:15 EST


Hi Andrew,

> My understanding is that you should not need most of this. The IRQ
> core will handle converting a GPIO to an interrupt, if you just list
> is as an interrupt source in the normal way.

> You say:
>
> > Additionally, it is necessary for platforms that do not support pin
> > configuration and properties via the device tree.
>
> Are you talking about ACPI?

Thanks for your review. Let me explain them.

I understand that specifying the interrupt as:

interrupts = <&gpio2 23 IRQ_TYPE_LEVEL_LOW>;

would also work, and the IRQ subsystem will properly handle the
conversion during the SPI probe. However, my problem is that the
GPIO pin itself needs to be explicitly requested and configured a
an input before it can be used as an IRQ pin.

My embedded platform has limited support, it only provides a
hard-coded pin control driver and does not support configuring
pinctrl properties in the device tree. So, there is no generic
way to request the pin and set its direction via device tree bindings.

I noticed that some existing NIC drivers solve this issue by specifying
`irq-gpios` in the device tree, which ensures that the GPIO is properly
initialized before being converted to an IRQ.

That was my motivation for these patches.

And my changes are not related to ACPI in any way—they are mainly
focused on device tree handling.

Thanks,
Hanyuan Zhao