From: Andrew Lunn <andrew@lunn.ch>
To: hanyuan-z <hanyuan-z@qq.com>
Cc: davem <davem@davemloft.net>, kuba <kuba@kernel.org>,
andrew+netdev <andrew+netdev@lunn.ch>,
edumazet <edumazet@google.com>, pabeni <pabeni@redhat.com>,
netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] net: enc28j60: support getting irq number from gpiophandle in the device tree
Date: Mon, 10 Mar 2025 13:06:34 +0100 [thread overview]
Message-ID: <41ba1d79-b7d7-4c58-b151-d4304a1c8ca7@lunn.ch> (raw)
In-Reply-To: <tencent_BE0060E3A7AF384BAF4DA37FD2121B8E1D07@qq.com>
On Mon, Mar 10, 2025 at 10:20:01AM +0800, hanyuan-z wrote:
> Hi Andrew, <br/><br/>> My understanding is that you should not need most of this. The IRQ<br/>> core will handle converting a GPIO to an interrupt, if you just list<br/>> is as an interrupt source in the normal way.<br/><br/>> You say:<br/>><br/>> > Additionally, it is necessary for platforms that do not support pin<br/>> > configuration and properties via the device tree.<br/>><br/>> Are you talking about ACPI?<br/><br/>Thanks for your review. Let me explain them.<br/><br/>I understand that specifying the interrupt as:<br/><br/> interrupts = <&gpio2 23 IRQ_TYPE_LEVEL_LOW>;<br/><br/>would also work, and the IRQ subsystem will properly handle the<br/>conversion during the SPI probe. However, my problem is that the<br/>GPIO pin itself needs to be explicitly requested and configured a<br/>an input before it can be used as an IRQ pin.<br/><br/>My embedded platform has limited support, it only provides a<br/>hard-coded pin control driver and does not support configuring<br/>pinctrl properties in the device tree. So, there is no generic<br/>way to request the pin and set its direction via device tree bindings.<br/><br/>I noticed that some existing NIC drivers solve this issue by specifying<br/>`irq-gpios` in the device tree, which ensures that the GPIO is properly<br/>initialized before being converted to an IRQ.<br/><br/>That was my motivation for these patches.<br/><br/>And my changes are not related to ACPI in any way—they are mainly<br/>focused on device tree handling.<br/><br/>Thanks, <br/>Hanyuan Zhao <br/>
Please use plain text for emails.
Andrew
prev parent reply other threads:[~2025-03-10 12:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-09 7:47 [PATCH 1/2] net: enc28j60: support getting irq number from gpio phandle " Hanyuan Zhao
2025-03-09 15:41 ` Andrew Lunn
[not found] ` <tencent_BE0060E3A7AF384BAF4DA37FD2121B8E1D07@qq.com>
2025-03-10 12:06 ` Andrew Lunn [this message]
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=41ba1d79-b7d7-4c58-b151-d4304a1c8ca7@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hanyuan-z@qq.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®