From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Daniel Mack <zonque@gmail.com>
Subject: Re: [PATCH 0/4] gpio: pxa: integrate with pincontrol
Date: Mon, 14 Dec 2015 22:10:55 +0100 [thread overview]
Message-ID: <87io40ivmo.fsf@belgarion.home> (raw)
In-Reply-To: <CACRpkdawaM5dMqoyeb=UqzaCeEdfSD-dQ+AMxwe5L9FQQsWKyw@mail.gmail.com> (Linus Walleij's message of "Mon, 14 Dec 2015 14:42:23 +0100")
Linus Walleij <linus.walleij@linaro.org> writes:
> On Thu, Dec 10, 2015 at 6:31 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> Linus Walleij <linus.walleij@linaro.org> writes:
>>
>>>> - the GPDR (gpio direction register) shared access bothers me a bit
>>>
>>> How is it shared and between what users?
>>
>> It's shared between the pin controller and the gpio controller.
>
> OK then it may be one of these cases where we should jit the pin controller
> and the GPIO controller together in the same file (under drivers/pinctrl)
> to simplify the mess. We can do that in the NEXT merge window because
> right now I don't want any more crisscross between gpio and pin control
> as there are refactorings I'm piling up.
Well, maybe, but I don't know how to do it, due to the number of possibilities,
given that :
- gpio-pxa.c should work for pxa27x device-tree
(this would be possible with a pinctrl+gpio fusion)
- gpio-pxa.c should work for pxa3xx device-tree
(I don't know how to do this, pxa3xx uses pinctrl-single AFAIK)
- gpio-pxa.c should work for pxa168 + mmp* device-tree
(same as for pxa3xx)
- gpio-pxa.c might should with pxa27x platform_data
(this doesn't work yet fully, the wake-up pin give me headaches)
- gpio-pxa.c should work with pxa25x platform_data
(I don't see either how a merged pinctrl+gpio driver could address this)
All of this to say it looks a bit complicated to me to have a gpio+pinctrl in
the same file, but I might be missing something obvious.
> Another option is e.g. accessing the registers through regmap-mmio but
> it feels a bit like overkill for this...
Yes, overkill maybe, but maybe an idea. The nice thing about regmap is the debug
capabilities, the less good is the permanent need of locks ...
>> The odd thing with the pxa architecture is that the GPDR bit selects between 2
>> different alternate functions, even when the pin is not a GPIO. Strange design,
>> isn't it ?
>
> Probably just unfortunate naming.
>
> In my presentation "building GPIO and pin control from the ground up" I
> try to explain a bit how hardware engineers design these things...
> http://dflund.se/~triad/papers/pincontrol.pdf
Nice, I had already read it :)
>> As a consequence, both the gpio driver and pinctrl have to modify it, for
>> different purposes :
>> - pinctrl will modify it to select a specific alternate function
>> - gpio driver will modify it when the pin is a GPIO, to modify its direction.
>
> OK. Solutions per above, I guess it currently just optimistically hope
> we do not fiddle the same bit in parallell from the two drivers (which
> is maybe even possible to prove to be true).
Ok. I will think about it again in the next days.
Cheers.
--
Robert
prev parent reply other threads:[~2015-12-14 21:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-28 21:37 [PATCH 0/4] gpio: pxa: integrate with pincontrol Robert Jarzmik
2015-11-28 21:37 ` [PATCH 1/4] gpio: pxa: convert to one gpiochip Robert Jarzmik
2015-12-10 15:04 ` Linus Walleij
2015-12-10 17:28 ` Robert Jarzmik
2015-11-28 21:37 ` [PATCH 2/4] gpio: pxa: convert to devm_ioremap Robert Jarzmik
2015-12-10 15:05 ` Linus Walleij
2015-11-28 21:37 ` [PATCH 3/4] gpio: pxa: change the interrupt management Robert Jarzmik
2015-11-28 23:23 ` kbuild test robot
2015-11-29 10:03 ` Robert Jarzmik
2015-12-10 15:06 ` Linus Walleij
2015-11-28 21:37 ` [PATCH 4/4] gpio: pxa: add pin control gpio direction and request Robert Jarzmik
2015-12-10 17:33 ` Robert Jarzmik
2015-12-09 22:58 ` [PATCH 0/4] gpio: pxa: integrate with pincontrol Linus Walleij
2015-12-10 7:28 ` Robert Jarzmik
2015-12-10 15:02 ` Linus Walleij
2015-12-10 17:31 ` Robert Jarzmik
2015-12-14 13:42 ` Linus Walleij
2015-12-14 21:10 ` Robert Jarzmik [this message]
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=87io40ivmo.fsf@belgarion.home \
--to=robert.jarzmik@free.fr \
--cc=gnurou@gmail.com \
--cc=haojian.zhuang@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zonque@gmail.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).