Re: [PATCH v3 1/1] gpiolib: of: add gpio-line node support
From: Linus Walleij
Date: Thu Feb 19 2026 - 12:44:20 EST
On Mon, Feb 16, 2026 at 10:10 PM James Hilliard
<james.hilliard1@xxxxxxxxx> wrote:
> Allow GPIO controller child nodes marked with "gpio-line" to apply
> probe-time direction/flags without hogging the line.
>
> Extend OF gpiochip scanning and OF dynamic reconfiguration handling to
> process gpio-line nodes alongside gpio-hog nodes.
>
> Some boards need probe-time GPIO direction/value setup while still
> leaving lines available for later userspace or driver requests. GPIO
> hogs can initialize lines but reserve them permanently.
>
> Add gpiod_apply_line_init() as a core helper for one-shot line
> initialization and use it for gpio-line setup.
>
> Because gpio-line initialization does not reserve ownership, subsequent
> consumer requests remain normal requests and may reconfigure or release
> the line as usual.
>
> Support "gpio-line-name" for setting the visible line name. For
> gpio-hog nodes, keep "line-name" semantics as the hog consumer label.
>
> Some boards only need to name a small subset of GPIO lines. Doing this
> generally requires defining a full gpio-line-names array with empty
> placeholders for unrelated lines.
>
> In overlays, gpio-line-names replacement is all-or-nothing. Names from
> base DT and multiple overlays for the same gpiochip do not compose,
> because each update replaces the full property.
>
> Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
I like this looks of this, there might be some minor code duplication
with hogs, but the core idea is sane and very similar to what has been
discussed in the past.
It's minimalist, it's elegant, it does the job.
If for nothing else, so for the sake of making the previous attempts
count for something, and because I personally align with this idea,
and because at least three (3!) attempts in the past by different
people for the same idea:
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
... and if we apply the patch in the end I would have their names
added to the commit as Co-developed-by:
> Depends on:
> - https://github.com/devicetree-org/dt-schema/pull/185
That's the real trick isn't it?
FWIW I approved it.
Yours,
Linus Walleij