All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: BOUGH CHEN <haibo.chen@nxp.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andy@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"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: Mon, 20 Apr 2020 00:27:18 +0300	[thread overview]
Message-ID: <CAHp75VcXSuechQ0vXatDgVRqQDzred0y9AvGytWvgQtxa8N9vQ@mail.gmail.com> (raw)
In-Reply-To: <20200419181000.GL166864@dtor-ws>

On Sun, Apr 19, 2020 at 9:10 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> 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()?

Shouldn't it be handled by pinctrl states? sleep state / default state / etc?


-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-04-19 21:27 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
2020-04-19 21:27         ` Andy Shevchenko [this message]
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=CAHp75VcXSuechQ0vXatDgVRqQDzred0y9AvGytWvgQtxa8N9vQ@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.