Thread (10 messages) 10 messages, 4 authors, 2015-01-16

Re: [Patch v5 2/2] gpio: Document GPIO hogging mechanism

From: Arend van Spriel <hidden>
Date: 2015-01-12 10:28:06
Also in: linux-gpio, lkml

On 01/12/15 11:20, Linus Walleij wrote:
On Fri, Dec 19, 2014 at 9:07 PM, Benoit Parrot[off-list ref]  wrote:
quoted
Add GPIO hogging documentation to gpio.txt

Signed-off-by: Benoit Parrot<redacted>
Reviewed-by: Alexandre Courbot<acourbot@nvidia.com>
This is starting to look good ...
quoted
+               line_b {
+                       gpio-hog;
+                       gpios =<6 0>;
+                       state = "output-low";
I don't like the state string.

Instead have boolean properties for all states.

line_b {
     gpio-hog;
     gpios =<6 0>;
     output-low;
     line-name = "foo-bar-gpio";
}

Then use of_property_read_bool() in the code to check which
state is to be selected intially. You can check that no mutually
exclusive state are selected, I don't like that an arbitrary string
select the state like that, if we do it that way an enumerator would
be better, I prefer bools.
To avoid the mutual exclusive state checking, would it not be more 
straightforward to use numeric enum values defined in boot/dts/include.

Regards,
Arend
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help