[PATCH v1 0/2] gpio: 74x164: seed the chain from DT at probe time
From: Chanhong Jung
Date: Wed Apr 22 2026 - 12:06:09 EST
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