Thread (10 messages) 10 messages, 4 authors, 2020-04-28

Re: [PATCH 2/2] input: egalax_ts: free irq resource before request the line as GPIO

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-04-19 18:10:04

On Tue, Mar 10, 2020 at 07:15:35AM +0000, BOUGH CHEN wrote:
quoted
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Sent: 2020年3月10日 12:27
To: BOUGH CHEN <haibo.chen@nxp.com>
Cc: linux-input@vger.kernel.org; dl-linux-imx <redacted>
Subject: Re: [PATCH 2/2] input: egalax_ts: free irq resource before request
the line as GPIO

On Tue, Feb 11, 2020 at 04:41:12PM +0800, haibo.chen@nxp.com wrote:
quoted
From: Haibo Chen <haibo.chen@nxp.com>

+	egalax_free_irq(ts);
It sounds to me you want simply disable interrupts in suspend. Does not
calling disable_irq() here suffice?
Here why I want to disable interrupts here is because in the newest
gpio system, if the gpio is request as an irq, it can't be request as
a gpio anymore.  In the function egalax_wake_up_device(), we need to
request the irq pin as a gpio for a while, generate a signal to wake
up the device. So before request the pad as gpio, need first free irq
resource.
This seems like a fairly common pattern and I wonder if our GPIO
overlords can help us here.

Linus, Mika, Andy, would it be possible to have an API that would allow
driver to temporarily "take over" GPIO that is used for interrupts and
drive it as output without resorting to freeing and re-acquiring irq?
I.e. something like gpiod_irq_drive_output_start() and
gpiod_irq_drive_output_end()?

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help