From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B356522D4E6; Mon, 10 Mar 2025 12:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741608410; cv=none; b=IfI53JOlgrYmEwyotXsaaosEkLeqDoZ9dq4EQn8zQxdEBoYmRKdFy6PblPsXuH8ns4OJmYjdhxO6ILgdEjnb+1HaYXLG+Qql/vMU0gQ31aO7/hNU5E6Gvoe5fNtI5xrDr3bIuirWpdf0EwdVTi5VPBWQs6xMO1JBH7h367YoMEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741608410; c=relaxed/simple; bh=oTcn8IMMp7J1wt266fCA1Jle5k8bB37spAnXUecjtG0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UCkNURjUb9o8T8kId1/1NgMdy/ToS38PvkOVZ/R36Cjcdn3ymx6V0nXblyN3D6EB6Rk0j0K+2szZpYy6hP65LhHjqlFSSchnGdc9dPCeieK+L37xTq81dQRTdIWlpMJgiIaQDKVn1cBE+RuQ1khgtEfJM1UZ7z6knTzEXzWLeag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=PMerF2i+; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="PMerF2i+" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=a9Hd9pLgYLGyaK3mL9Xf/nhr5CbuLlp8ERW+lfTDT6s=; b=PM erF2i+giPdoPrSpDdLb8GXvSJp1A3FSGfAszlQbglscUlhQinUoCzf9bnny1gNEFEH4s+xqufBpBP 9NNeYJbG5x/yp5jN1sA9VOFV06mmaJxhKF9rtzeWsG7elV4T5MVP8e3uUJFjSLK4tc4fMHny7jx2b HXNw+t0/t+LgE6o=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1trbty-00400s-78; Mon, 10 Mar 2025 13:06:34 +0100 Date: Mon, 10 Mar 2025 13:06:34 +0100 From: Andrew Lunn To: hanyuan-z Cc: davem , kuba , andrew+netdev , edumazet , pabeni , netdev , linux-kernel Subject: Re: [PATCH 1/2] net: enc28j60: support getting irq number from gpiophandle in the device tree Message-ID: <41ba1d79-b7d7-4c58-b151-d4304a1c8ca7@lunn.ch> References: <2b09bea7-2a61-4697-a9c1-6a42cf8570c4@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: On Mon, Mar 10, 2025 at 10:20:01AM +0800, hanyuan-z wrote: > Hi Andrew, 

> My understanding is&nb= sp;that you should not need most of this= =2E The IRQ
> core will handle convert= ing a GPIO to an interrupt, if you = just list
> is as an interrupt source&= nbsp;in the normal way.

> You say:
>
> > Additionally, it is necessary&= nbsp;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&n= bsp;specifying the interrupt as:

   =  interrupts =3D <&gpio2 23 IRQ_TYPE_LEVEL_L= OW>;

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

My embedded platform has l= imited support, it only provides a
hard-coded&= nbsp;pin control driver and does not support&= nbsp;configuring
pinctrl properties in the device&n= bsp;tree. So, there is no generic
way to&= nbsp;request the pin and set its direction&nb= sp;via device tree bindings.

I noticed th= at some existing NIC drivers solve this = issue by specifying
`irq-gpios` in the device&= nbsp;tree, which ensures that the GPIO is&nbs= p;properly
initialized before being converted to&nb= sp;an IRQ.

That was my motivation for&nbs= p;these patches.

And my changes are not&n= bsp;related to ACPI in any way=E2=80=94they a= re mainly
focused on device tree handling.

Thanks,  
Hanyuan Zhao  
Please use plain text for emails. Andrew