mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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&nbsp;Andrew,&nbsp;<br/><br/>&gt;&nbsp;My&nbsp;understanding&nbsp;is&nbsp;that&nbsp;you&nbsp;should&nbsp;not&nbsp;need&nbsp;most&nbsp;of&nbsp;this.&nbsp;The&nbsp;IRQ<br/>&gt;&nbsp;core&nbsp;will&nbsp;handle&nbsp;converting&nbsp;a&nbsp;GPIO&nbsp;to&nbsp;an&nbsp;interrupt,&nbsp;if&nbsp;you&nbsp;just&nbsp;list<br/>&gt;&nbsp;is&nbsp;as&nbsp;an&nbsp;interrupt&nbsp;source&nbsp;in&nbsp;the&nbsp;normal&nbsp;way.<br/><br/>&gt;&nbsp;You&nbsp;say:<br/>&gt;<br/>&gt;&nbsp;&gt;&nbsp;Additionally,&nbsp;it&nbsp;is&nbsp;necessary&nbsp;for&nbsp;platforms&nbsp;that&nbsp;do&nbsp;not&nbsp;support&nbsp;pin<br/>&gt;&nbsp;&gt;&nbsp;configuration&nbsp;and&nbsp;properties&nbsp;via&nbsp;the&nbsp;device&nbsp;tree.<br/>&gt;<br/>&gt;&nbsp;Are&nbsp;you&nbsp;talking&nbsp;about&nbsp;ACPI?<br/><br/>Thanks&nbsp;for&nbsp;your&nbsp;review.&nbsp;Let&nbsp;me&nbsp;explain&nbsp;them.<br/><br/>I&nbsp;understand&nbsp;that&nbsp;specifying&nbsp;the&nbsp;interrupt&nbsp;as:<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;interrupts&nbsp;=&nbsp;&lt;&amp;gpio2&nbsp;23&nbsp;IRQ_TYPE_LEVEL_LOW&gt;;<br/><br/>would&nbsp;also&nbsp;work,&nbsp;and&nbsp;the&nbsp;IRQ&nbsp;subsystem&nbsp;will&nbsp;properly&nbsp;handle&nbsp;the<br/>conversion&nbsp;during&nbsp;the&nbsp;SPI&nbsp;probe.&nbsp;However,&nbsp;my&nbsp;problem&nbsp;is&nbsp;that&nbsp;the<br/>GPIO&nbsp;pin&nbsp;itself&nbsp;needs&nbsp;to&nbsp;be&nbsp;explicitly&nbsp;requested&nbsp;and&nbsp;configured&nbsp;a<br/>an&nbsp;input&nbsp;before&nbsp;it&nbsp;can&nbsp;be&nbsp;used&nbsp;as&nbsp;an&nbsp;IRQ&nbsp;pin.<br/><br/>My&nbsp;embedded&nbsp;platform&nbsp;has&nbsp;limited&nbsp;support,&nbsp;it&nbsp;only&nbsp;provides&nbsp;a<br/>hard-coded&nbsp;pin&nbsp;control&nbsp;driver&nbsp;and&nbsp;does&nbsp;not&nbsp;support&nbsp;configuring<br/>pinctrl&nbsp;properties&nbsp;in&nbsp;the&nbsp;device&nbsp;tree.&nbsp;So,&nbsp;there&nbsp;is&nbsp;no&nbsp;generic<br/>way&nbsp;to&nbsp;request&nbsp;the&nbsp;pin&nbsp;and&nbsp;set&nbsp;its&nbsp;direction&nbsp;via&nbsp;device&nbsp;tree&nbsp;bindings.<br/><br/>I&nbsp;noticed&nbsp;that&nbsp;some&nbsp;existing&nbsp;NIC&nbsp;drivers&nbsp;solve&nbsp;this&nbsp;issue&nbsp;by&nbsp;specifying<br/>`irq-gpios`&nbsp;in&nbsp;the&nbsp;device&nbsp;tree,&nbsp;which&nbsp;ensures&nbsp;that&nbsp;the&nbsp;GPIO&nbsp;is&nbsp;properly<br/>initialized&nbsp;before&nbsp;being&nbsp;converted&nbsp;to&nbsp;an&nbsp;IRQ.<br/><br/>That&nbsp;was&nbsp;my&nbsp;motivation&nbsp;for&nbsp;these&nbsp;patches.<br/><br/>And&nbsp;my&nbsp;changes&nbsp;are&nbsp;not&nbsp;related&nbsp;to&nbsp;ACPI&nbsp;in&nbsp;any&nbsp;way—they&nbsp;are&nbsp;mainly<br/>focused&nbsp;on&nbsp;device&nbsp;tree&nbsp;handling.<br/><br/>Thanks,&nbsp;&nbsp;<br/>Hanyuan&nbsp;Zhao&nbsp;&nbsp;<br/>

Please use plain text for emails.

	Andrew

      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®