public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: BOUGH CHEN <haibo.chen@nxp.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andy@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH 2/2] input: egalax_ts: free irq resource before request the line as GPIO
Date: Sun, 19 Apr 2020 11:10:00 -0700	[thread overview]
Message-ID: <20200419181000.GL166864@dtor-ws> (raw)
In-Reply-To: <VI1PR04MB504032C19CA8D76AE845AE6A90FF0@VI1PR04MB5040.eurprd04.prod.outlook.com>

On Tue, Mar 10, 2020 at 07:15:35AM +0000, BOUGH CHEN wrote:
> 
> > 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 <linux-imx@nxp.com>
> > 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:
> > > 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

  reply	other threads:[~2020-04-19 18:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  8:41 [PATCH 1/2] input: egalax_ts: switch to i2c interface before wake up haibo.chen
2020-02-11  8:41 ` [PATCH 2/2] input: egalax_ts: free irq resource before request the line as GPIO haibo.chen
2020-03-10  4:26   ` Dmitry Torokhov
2020-03-10  7:15     ` BOUGH CHEN
2020-04-19 18:10       ` Dmitry Torokhov [this message]
2020-04-19 21:27         ` Andy Shevchenko
2020-04-28 11:21         ` Linus Walleij
2020-03-10  1:58 ` [PATCH 1/2] input: egalax_ts: switch to i2c interface before wake up BOUGH CHEN
2020-03-10  4:22 ` Dmitry Torokhov
2020-03-10  7:01   ` BOUGH CHEN

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=20200419181000.GL166864@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andy@kernel.org \
    --cc=haibo.chen@nxp.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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