Re: [PATCH v1 1/2] dt-bindings: gpio: fairchild,74hc595: add registers-default property

Linus Walleij
2026-05-05T09:46:12Z

On Wed, Apr 29, 2026 at 11:04 AM Bartosz Golaszewski <brgl@kernel.org> wrote:

> > lines-initial-states:
> > $ref: /schemas/types.yaml#/definitions/uint32
> > description:
> > Bitmask that specifies the initial state of each line.
> > When a bit is set to zero, the corresponding line will be initialized to
> > the input (pulled-up) state.
> > When the bit is set to one, the line will be initialized to the
> > low-level output state.
> > If the property is not specified all lines will be initialized to the
> > input state.
> >
> > If you want to set up initial states, use this property.
> >
> > This also makes it possible for us to centralize the handling later on.
> >
>
> Ah, the old initial/default GPIO values problem strikes again. :(
>
> IMO this is software configuration, not HW description. I think the
> driver should do it based on the compatible and/or machine. It should
> not be a property but if Krzysztof is fine with it, I'll queue it.

This one is particularly uncomfortably hard to define.

If we depend on the machine we need to sprinkle
of_machine_is_compatible() over all drivers.

A lot of detailed properties that could have been handled by a few
gazillion of_machine_is_compatible():s are already present
in the kernel.

What is good about the property that has the same name
is that we can create nicer looking kernel code that is easier
to maintain. The DT maintainers may not care about that, but
from a GPIO subsystem PoV I think the line-initial-states
are better.

Yours,
Linus Walleij