Thread (3 messages) 3 messages, 2 authors, 2015-08-13

[PATCH v2] gpio: Allow hogged gpios to be requested

From: Linus Walleij <hidden>
Date: 2015-08-10 09:26:50
Also in: linux-gpio

On Tue, Aug 4, 2015 at 11:27 AM, Markus Pargmann [off-list ref] wrote:
It can be useful to claim hogged gpios later, for example from
userspace. This allows to set defaults for GPIOs using the hogging
mechanism and override the setup later from userspace or a kernel driver.

This patch adds a check for hogged gpios to allow requesting them. If
the gpio is not hogged but marked as requested, it still fails with
-EBUSY.

Signed-off-by: Markus Pargmann <redacted>
To me it feels like a new DT property "gpio-inital-value" or so
need to be defined in addition to the hogging bindings, and that
one just sets the GPIO up without setting the FLAG_IS_HOGGED.

The mechanism needs to be available to non-DT as well
of course, but it could be a first usecase.

So instead of:

line_b {
           gpio-initval;
           gpios = <6 0>;
           output-low;
};

Note: no line-name. And it shouldn't be allowed: we don't
know who will use this in the end.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help