From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Peter TB Brett <peter@peter-b.co.uk>,
Javier Martinez Canillas <javier@dowhile0.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux-OMAP <linux-omap@vger.kernel.org>
Subject: Re: Accessing GPIOs from userspace using recent kernels
Date: Fri, 23 May 2014 08:11:40 -0700 [thread overview]
Message-ID: <20140523151140.GF2321@atomide.com> (raw)
In-Reply-To: <CACRpkdYTa+_zAsbwU+XYSWnsN4i4Xkfm28S1=vcC5=oz0TH3Gg@mail.gmail.com>
* Linus Walleij <linus.walleij@linaro.org> [140523 04:36]:
> On Fri, May 16, 2014 at 12:15 PM, Peter TB Brett <peter@peter-b.co.uk> wrote:
> > The current call chain seems to be: gpiod_export() --> gpiod_request() -->
> > omap_gpio_request(). Looking at other GPIO drivers, it seems like
> > omap_gpio_request() should eventually call pinctrl_request_gpio(). Would be
> > useful if someone who knows about OMAP4/gpio/pinctrl could take a look at
> > this.
If we do this, we also need a solution to prevent automatic remuxing
of GPIO pins from happending. For wake-up events, some drivers need
to remux a rx pin to GPIO input for the duration of idle, and then
back to device rx pin. This is needed on some other platforms too
AFAIK.
For the drivers needing GPIO wake-up events, request_gpio is done in
the driver after drivers/base/pinctrl.c has already muxed the device
pin to rx. At minimum we would get warnings about reserved pins if
we tried to automatically mux them to GPIO.
We may be able to use some GPIO specific property to prevent
automatic remuxing as we discussed in the #armlinux few days ago.
Related to automatic remuxing of GPIO pins, there are also other
needs for pinctrl and GPIO interaction. We need to remux GPIO output
pins to input + pull + safe_mode to prevent the GPIO pins losing
value briefly during off-idle. That's the gpio errata 1.158 at as
shown at least at [1]. Because the GPIO to pinctrl mapping is
sparse and SoC specific, there's currently now obvious way to do
that. And we would need few new GPIO functions to tell pinctrl
subsystem about the change.
Regards,
Tony
[1] https://www.gitorious.org/rowboat/kernel/commit/86b15f21298b749a9d8216ff1839d33ad542464e?format=patch
next prev parent reply other threads:[~2014-05-23 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3385f19f3e1427613732f6d5c9f8513d@net2air.co>
[not found] ` <CABxcv=mFV3nJf1eqNhTbh1KWwe8Z6Z62JtFn5KZbHnGprk1_bg@mail.gmail.com>
[not found] ` <7bd3dbc0c3217f43eefc8d228995690f@net2air.co>
[not found] ` <CABxcv=nTV23Un91fSUmkixsF5uywoisCOi1qhPqVvZb+RvikDA@mail.gmail.com>
[not found] ` <ea43ccacfe4caf1f51f9e5a5c8bbdd5e@net2air.co>
2014-05-23 11:35 ` Accessing GPIOs from userspace using recent kernels Linus Walleij
2014-05-23 15:11 ` Tony Lindgren [this message]
2014-05-30 19:35 ` Javier Martinez Canillas
2014-05-30 20:25 ` Tony Lindgren
2014-05-31 0:40 ` Javier Martinez Canillas
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=20140523151140.GF2321@atomide.com \
--to=tony@atomide.com \
--cc=javier@dowhile0.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=peter@peter-b.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).