From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: Re: Requesting as a GPIO a pin already used through pinctrl
Date: Sat, 24 Sep 2016 00:05:49 +0300 [thread overview]
Message-ID: <20160923210549.GY8719@lukather> (raw)
In-Reply-To: <CACRpkdY_YVhHuMwx=mwPVyHNpLveg7Gikc0uznUhsKBCYJwzzw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]
On Fri, Sep 23, 2016 at 03:22:53PM +0200, Linus Walleij wrote:
> > However, it does have an unexpected side-effect. On our DT, for the
> > GPIOs, we also set up a pinctrl node (which seem to be along the lines
> > of the doc recommandations, section "Drivers needing both pin control
> > and GPIOs").
> >
> > However, when pinctrl_select_default is called by the core, which in
> > turns ends up calling pinmux_enable_setting, which builds the owner
> > name using the dev_name. However, when we call gpiod_request, it ends
> > up in pinmux_request_gpio, which build the owner string using the
> > pinctrl device name and the pin number.
> >
> > This results in a mismatch of owners, and the gpiod_request fails,
> > while the device really is the same.
>
> Yeah, needing both GPIO and pinctrl on the same pin kind of
> implies that the subsystems are poking at the same hardware and
> that is !=strict.
My understanding was that GPIO and pinctrl were pretty much
orthogonal, a pinctrl property would set up the muxing, and mark the
pin as in use, while the GPIO property would just say what we use the
pin for. In a way, that was similar to what any other controller would
behave. You would mark the pins as exclusive, mux them, and leave the
controller deal with its pin.
Anyway, I'll remove those properties from our DTs, and add the .strict
flag.
> I have had some half-finished thoughts here, for example to add
> more callbacks from GPIO to pinctrl for things like open drain
> and biasing, so that GPIO would be a "pure" front-end with a pinctrl
> back-end. It ends up duplicating a lot of stuff from pinctrl in GPIO,
> but since people will inevitably want to do things like biasing
> from the GPIO chardev I might have to bite the bullet and do it
> that way.
>
> Other ideas welcome.
If we don't have access to the calling device structure, I'm not sure
how we could fix that properly.
On your more mid-term view of things and where the chardev interface
should be going, I definitely second at least having things like
biasing, strength, and all the configuration really, exposed. There's
a lot of people that actually want to enable biasing and we don't
really have a good solution for that.
One way would be to use the DT overlays, but that seems more of a hack
than anything else.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-09-23 21:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-16 13:58 Requesting as a GPIO a pin already used through pinctrl Maxime Ripard
2016-09-18 11:30 ` Linus Walleij
2016-09-21 19:51 ` Maxime Ripard
2016-09-21 20:34 ` Michael Welling
2016-09-22 10:48 ` Maxime Ripard
2016-09-22 15:46 ` Michael Welling
2016-09-23 13:22 ` Linus Walleij
2016-09-23 15:24 ` Vladimir Zapolskiy
2016-09-23 21:34 ` Maxime Ripard
2016-09-30 16:26 ` Linus Walleij
2016-09-23 21:05 ` Maxime Ripard [this message]
2016-10-26 15:49 ` Maxime Ripard
2016-10-27 12:12 ` Linus Walleij
2016-11-02 21:31 ` Maxime Ripard
2016-11-06 10:11 ` Linus Walleij
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=20160923210549.GY8719@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=boris.brezillon@free-electrons.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=nicolas.ferre@atmel.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;
as well as URLs for NNTP newsgroup(s).