Re: [PATCH v2 1/1] gpiolib: of: add gpio-line node support

From: Rob Herring

Date: Tue Feb 17 2026 - 09:13:05 EST


On Tue, Feb 17, 2026 at 05:18:18AM -0800, Bartosz Golaszewski wrote:
> On Mon, 16 Feb 2026 22:20:10 +0100, James Hilliard
> <james.hilliard1@xxxxxxxxx> said:
> > On Mon, Feb 16, 2026 at 4:38 AM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
> >>
> >> On Sat, 14 Feb 2026 22:32:37 +0100, James Hilliard
> >> <james.hilliard1@xxxxxxxxx> said:
> >> > Allow GPIO controller child nodes marked with "gpio-line" to
> >> > configure direction/flags at probe time without hogging the line.
> >> >
> >> > Teach OF gpiochip scanning and OF dynamic reconfiguration handlers to
> >> > process gpio-line nodes in addition to gpio-hog nodes.
> >> >
> >> > Also parse "gpio-line-name" and apply it to desc->name. For gpio-hog
> >> > nodes, keep "line-name" semantics as the hog consumer label.
> >> >
> >>
> >> One important thing that's missing from this commit description is: what is
> >> the use-case and why do you need this.
> >
> > Added some more use-case details in v3:
> > https://lore.kernel.org/all/20260216211021.3019827-1-james.hilliard1@xxxxxxxxx/
> >
> > In my case I'm setting up the GPIO line initial state and names for
> > userspace consumers mostly. I want to be able to configure the
> > individual line names from a combination of the dts file and multiple
> > dtso files for the same gpiochip along with setting up an initial state
> > before userspace consumers operate on the lines.
> >
> >> The DT binding patch should be sent together with this in a single series. It
> >> should also be documented in the relevant .rst file.
> >
> > Which file would that be?
> >
>
> Documentation/driver-api/gpio/board.rst would fit best.
>
> > I had previously added docs to gpio.txt but was told here to just
> > drop the docs:
> > https://lore.kernel.org/all/b851bfd4-3c35-489f-a32d-dcd7a37ca99a@xxxxxxxxxx/
> >
>
> There's a difference between device-tree bindings (formal, machine-readable
> definition of the firmware ABI) under Documentation/devicetree/bindings/ and
> documentation for humans residing elsewhere in Documentation/. Make sure to
> not confuse the two. I would expect both to be supplied with such a change.
>
> >> I suppose it's another shot at defining what we previously called
> >> "initial-line-state", "default-line-state", etc. What happens when someone
> >> requests the line, reconfigures it and then releases it?
> >
> > This should just provide an initial configuration, subsequent consumers
> > would override whatever is set here AFAIU.
> >
>
> Yeah, that's what I was afraid of. This is not hardware description, this is
> user-convencience and as such I don't think it has place in DT bindings and -
> by extension - in DTS.

I agree.

> I'm afraid I don't have good alternatives to offer, solving this has been
> attempted several times in the past without success. Even gpio-hog would likely
> not get past DT maintainer review these days but it's ABI now so will stay
> supported.

I might still... I don't love the binding and didn't at the time either.
There was enough justification which this one completely lacks.

Please slow down your pace and give folks time to review. You're on v3
already and it's the first I see it. People are in different timezones,
take days off, get busy on other work, etc.

Rob