mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hanyuan <hanyuan-z@qq.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] net: enc28j60: support getting irq number from gpio phandle in the device tree
Date: Mon, 10 Mar 2025 10:40:29 +0800	[thread overview]
Message-ID: <tencent_83CBDD726353E21FBD648E831600C078F205@qq.com> (raw)

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


             reply	other threads:[~2025-03-10  2:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10  2:40 hanyuan [this message]
2025-03-10 12:18 ` Andrew Lunn
2025-03-10 12:25   ` hanyuan
  -- strict thread matches above, loose matches on Subject: below --
2025-03-09  7:47 Hanyuan Zhao
2025-03-09 15:41 ` Andrew Lunn

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=tencent_83CBDD726353E21FBD648E831600C078F205@qq.com \
    --to=hanyuan-z@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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®