From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
Benoit Parrot <bparrot-l0cyMroinI0@public.gmane.org>,
Alexandre Courbot
<acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 4/5] gpio: of: Add support to have multiple gpios in gpio-hog
Date: Wed, 9 Mar 2016 10:17:29 -0700 [thread overview]
Message-ID: <56E05AA9.8000503@wwwdotorg.org> (raw)
In-Reply-To: <56E02335.6020901-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On 03/09/2016 06:20 AM, Laxman Dewangan wrote:
>
> On Wednesday 09 March 2016 11:58 AM, Markus Pargmann wrote:
>> * PGP Signed by an unknown key
>>
>> Hi,
>>
>> On Tue, Mar 08, 2016 at 05:32:07PM +0530, Laxman Dewangan wrote:
>>> The child node for gpio hogs under gpio controller's node
>>> provide the mechanism to automatic GPIO request and
>>> configuration as part of the gpio-controller's driver
>>> probe function.
>>>
>>> Currently, property "gpio" takes one gpios for such
>>> configuration. Add support to have multiple GPIOs in
>>> this property so that multiple GPIOs of gpio-controller
>>> can be configured by this mechanism with one child node.
>> So if I read this correctly you want to have multiple GPIOs with the
>> same line name? Why don't you use multiple child nodes with individual
>> line names?
>>
> There is cases on which particular functional configuration needs sets
> of GPIO to set. On this case, making sub node for each GPIOs creates
> lots of sub-nodes and add complexity on readability, usability and
> maintainability.
> Example: for my board, I wanted to set GPIO H2 to input and H0 and H1 to
> be output high.
> Instead of three nodes, I can have two here:
> gpio@0,6000d000 {
> wlan_input {
> gpio-hog;
> gpios = <TEGRA_GPIO(H, 2) 0>;
> input;
> };
>
> wlan_output {
> gpio-hog;
> gpios = <TEGRA_GPIO(H, 0) 0 TEGRA_GPIO(H, 1) 0>;
> output-high;
> };
> };
>
> So here I am grouping the multiple output GPIO together.
>
> This looks much similar if we have many GPIOs for one type of
> configurations.
>
> Even it looks better if we have something:
> gpio@0,6000d000 {
> wlan_control {
> gpio-hog;
> gpios-input = <TEGRA_GPIO(H, 2) 0>;
> gpios-output-high = <TEGRA_GPIO(H, 0) 0
> TEGRA_GPIO(H, 1) 0>;
> };
> };
The problem with that is the description used when acquiring the GPIO is
just "wlan_input", "wlan_output", or "wlan_control". There's nothing to
indicate what those individual pins do (perhaps one is a reset signal,
one is a regulator enable, etc.?) By requiring separate nodes for each
GPIO, then the node name can provide a meaningful semantic
name/description for each GPIO, which provides much more information.
If the approach in this patch is acceptable though, I think you want to
update the description of "gpios" (in the GPIO hog definition section)
in Documentation/devicetree/bindings/gpio/gpio.txt to mention that
multiple GPIO entries are legal. Right now it says that property much
contain exactly #gpio-cells, not a multiple of #gpio-cells.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Markus Pargmann <mpa@pengutronix.de>,
linus.walleij@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com,
mark.rutland@arm.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
treding@nvidia.com, Benoit Parrot <bparrot@ti.com>,
Alexandre Courbot <acourbot@nvidia.com>
Subject: Re: [PATCH 4/5] gpio: of: Add support to have multiple gpios in gpio-hog
Date: Wed, 9 Mar 2016 10:17:29 -0700 [thread overview]
Message-ID: <56E05AA9.8000503@wwwdotorg.org> (raw)
In-Reply-To: <56E02335.6020901@nvidia.com>
On 03/09/2016 06:20 AM, Laxman Dewangan wrote:
>
> On Wednesday 09 March 2016 11:58 AM, Markus Pargmann wrote:
>> * PGP Signed by an unknown key
>>
>> Hi,
>>
>> On Tue, Mar 08, 2016 at 05:32:07PM +0530, Laxman Dewangan wrote:
>>> The child node for gpio hogs under gpio controller's node
>>> provide the mechanism to automatic GPIO request and
>>> configuration as part of the gpio-controller's driver
>>> probe function.
>>>
>>> Currently, property "gpio" takes one gpios for such
>>> configuration. Add support to have multiple GPIOs in
>>> this property so that multiple GPIOs of gpio-controller
>>> can be configured by this mechanism with one child node.
>> So if I read this correctly you want to have multiple GPIOs with the
>> same line name? Why don't you use multiple child nodes with individual
>> line names?
>>
> There is cases on which particular functional configuration needs sets
> of GPIO to set. On this case, making sub node for each GPIOs creates
> lots of sub-nodes and add complexity on readability, usability and
> maintainability.
> Example: for my board, I wanted to set GPIO H2 to input and H0 and H1 to
> be output high.
> Instead of three nodes, I can have two here:
> gpio@0,6000d000 {
> wlan_input {
> gpio-hog;
> gpios = <TEGRA_GPIO(H, 2) 0>;
> input;
> };
>
> wlan_output {
> gpio-hog;
> gpios = <TEGRA_GPIO(H, 0) 0 TEGRA_GPIO(H, 1) 0>;
> output-high;
> };
> };
>
> So here I am grouping the multiple output GPIO together.
>
> This looks much similar if we have many GPIOs for one type of
> configurations.
>
> Even it looks better if we have something:
> gpio@0,6000d000 {
> wlan_control {
> gpio-hog;
> gpios-input = <TEGRA_GPIO(H, 2) 0>;
> gpios-output-high = <TEGRA_GPIO(H, 0) 0
> TEGRA_GPIO(H, 1) 0>;
> };
> };
The problem with that is the description used when acquiring the GPIO is
just "wlan_input", "wlan_output", or "wlan_control". There's nothing to
indicate what those individual pins do (perhaps one is a reset signal,
one is a regulator enable, etc.?) By requiring separate nodes for each
GPIO, then the node name can provide a meaningful semantic
name/description for each GPIO, which provides much more information.
If the approach in this patch is acceptable though, I think you want to
update the description of "gpios" (in the GPIO hog definition section)
in Documentation/devicetree/bindings/gpio/gpio.txt to mention that
multiple GPIO entries are legal. Right now it says that property much
contain exactly #gpio-cells, not a multiple of #gpio-cells.
next prev parent reply other threads:[~2016-03-09 17:17 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 12:02 [PATCH 0/5] gpio: of: Add error handling and support for multiple gpio in gpio-hog Laxman Dewangan
2016-03-08 12:02 ` Laxman Dewangan
2016-03-08 12:02 ` [PATCH 1/5] gpio: of: Scan available child node for gpio-hog Laxman Dewangan
2016-03-08 12:02 ` Laxman Dewangan
2016-03-08 14:18 ` Thierry Reding
2016-03-08 14:18 ` Thierry Reding
2016-03-08 12:02 ` [PATCH 2/5] gpio: gpiolib: Print error number if gpio hog failed Laxman Dewangan
2016-03-08 12:02 ` Laxman Dewangan
2016-03-08 12:27 ` Vladimir Zapolskiy
2016-03-08 12:27 ` Vladimir Zapolskiy
2016-03-08 14:22 ` Thierry Reding
2016-03-08 14:22 ` Thierry Reding
2016-03-08 15:32 ` Laxman Dewangan
2016-03-08 15:32 ` Laxman Dewangan
2016-03-09 17:07 ` Stephen Warren
[not found] ` <56E0584B.9050607-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-03-10 6:58 ` Laxman Dewangan
2016-03-10 6:58 ` Laxman Dewangan
2016-03-08 12:02 ` [PATCH 3/5] gpio: of: Return error if gpio hog configuration failed Laxman Dewangan
2016-03-08 12:02 ` Laxman Dewangan
2016-03-08 14:23 ` Thierry Reding
2016-03-08 14:23 ` Thierry Reding
2016-03-09 17:11 ` Stephen Warren
2016-03-10 7:02 ` Laxman Dewangan
2016-03-10 7:02 ` Laxman Dewangan
2016-03-08 12:02 ` [PATCH 4/5] gpio: of: Add support to have multiple gpios in gpio-hog Laxman Dewangan
2016-03-08 12:02 ` Laxman Dewangan
2016-03-09 6:28 ` Markus Pargmann
2016-03-09 13:20 ` Laxman Dewangan
2016-03-09 13:20 ` Laxman Dewangan
[not found] ` <56E02335.6020901-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-03-09 17:17 ` Stephen Warren [this message]
2016-03-09 17:17 ` Stephen Warren
[not found] ` <56E05AA9.8000503-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-03-10 7:07 ` Laxman Dewangan
2016-03-10 7:07 ` Laxman Dewangan
2016-03-10 11:16 ` Markus Pargmann
2016-03-10 11:53 ` Laxman Dewangan
2016-03-10 11:53 ` Laxman Dewangan
2016-03-17 15:46 ` Rob Herring
2016-03-17 17:44 ` Laxman Dewangan
2016-03-17 17:44 ` Laxman Dewangan
2016-03-08 12:02 ` [PATCH 5/5] gpio: DT: Rephrase property "gpios" of hog node to support multiple gpios Laxman Dewangan
2016-03-08 12:02 ` Laxman Dewangan
2016-03-09 17:18 ` Stephen Warren
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=56E05AA9.8000503@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=bparrot-l0cyMroinI0@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
/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.