public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] gpio: 74x164: seed the chain from DT at probe time
@ 2026-04-22 16:05 Chanhong Jung
  2026-04-22 16:05 ` [PATCH v1 1/2] dt-bindings: gpio: fairchild,74hc595: add registers-default property Chanhong Jung
  2026-04-22 16:05 ` [PATCH v1 2/2] gpio: 74x164: support 'registers-default' DT property for initial state Chanhong Jung
  0 siblings, 2 replies; 5+ messages in thread
From: Chanhong Jung @ 2026-04-22 16:05 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Maxime Ripard
  Cc: linux-gpio, devicetree, linux-kernel

Hi all,

This short series lets the 74HC595/74LVC594 shift-register driver
initialise its chain to a board-specified pattern before the gpiochip
is registered, via a new optional 'registers-default' DT property.

Motivation
----------

74HC595 chains latch their outputs from the first serial write onwards.
The current driver always issues that first write from a zeroed buffer
during probe, so every output comes up low until user space intervenes.

Boards that wire the chain to signals whose power-on state matters
(active-low indicators, reset lines, early-boot status LEDs, etc.) have
no DT-level way to express the intended initial pattern today, and must
recreate it in user space after every probe.

The property and layout documented here have been honoured by U-Boot's
matching driver (drivers/gpio/74x164_gpio.c) for years, so this change
also restores binding parity between the two boot stages: whichever one
owns the chain first can leave it in a known state for the next.

Validation
----------

Tested on stm32mp153d-ssonic, which drives 16 active-low LEDs from two
cascaded 74HC595s with 'registers-default = /bits/ 8 <0xff 0xff 0x00
0x00>;'. With the series applied, the LED bank comes up in its defined
off-state from probe onwards; without it, the bank flashes on briefly
on every reboot until the user-space init writes the pattern.

Tooling:
  - scripts/checkpatch.pl --strict: 0 errors, 0 warnings on each patch
  - make dt_binding_check DT_SCHEMA_FILES=fairchild,74hc595: passes
    (example DTS extracted, compiled, and validated against the new
     schema)
  - dt-validate on a built stm32mp153d-ssonic.dtb against the updated
    processed-schema.json: 'registers-default' accepted cleanly; no
    regressions against the rest of the 74hc595 binding

Patch 1 adds the binding property. Patch 2 consumes it in the driver.

Thanks for your time and reviews — feedback very welcome.

Chanhong

Chanhong Jung (2):
  dt-bindings: gpio: fairchild,74hc595: add registers-default property
  gpio: 74x164: support 'registers-default' DT property for initial
    state

 .../bindings/gpio/fairchild,74hc595.yaml           | 10 ++++++++++
 drivers/gpio/gpio-74x164.c                         | 14 ++++++++++++++
 2 files changed, 24 insertions(+)

--
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-23 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 16:05 [PATCH v1 0/2] gpio: 74x164: seed the chain from DT at probe time Chanhong Jung
2026-04-22 16:05 ` [PATCH v1 1/2] dt-bindings: gpio: fairchild,74hc595: add registers-default property Chanhong Jung
2026-04-23  8:59   ` Krzysztof Kozlowski
2026-04-23 10:33     ` Chanhong Jung
2026-04-22 16:05 ` [PATCH v1 2/2] gpio: 74x164: support 'registers-default' DT property for initial state Chanhong Jung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox