[PATCH v4 0/2] leds: Add support for CZ.NIC Turris 1.x LEDs

From: Josef Schlehofer

Date: Mon Oct 26 2026 - 15:51:34 EST


The CZ.NIC Turris 1.x routers have eight RGB LEDs driven by the CPLD.
turris1x.dts already describes the controller, but there is no driver.

Pali posted v1, v2 and a RESEND in 2022 [1][2][3]. I took the series
over with v3 [4] and kept Pali as the author.

The main change in v4 follows Marek's review. The five LAN LEDs share
one colour and can only be switched on and off, so rgb:lan-1 is now the
only multicolor LAN LED and its colour applies to all five. All five
have max_brightness 1.

Marek, I left out the symlinks. Linking a single attribute needs
compat_only_sysfs_link_entry_to_kobj(), which is meant for keeping old
paths working. Instead, the ABI says that rgb:lan-1 sets the colour of
all five. A link to the whole rgb:lan-1 directory can come on top if
you or Lee want it.

The global brightness moved from the Omnia ABI file to the Turris 1.x
one, because here it is a 0-255 CPLD level, not a percentage.

Based on leds/for-leds-next (59cf91cf87ab), because the driver uses
the hw_offloaded() callback queued there.

Tested on a Turris 1.1 with leds/for-leds-next plus this series, the
driver as a module and CONFIG_PROVE_LOCKING:
- the colour set through rgb:lan-1 shows on all LAN LEDs that are on,
also while rgb:lan-1 is off or under a trigger
- brightness levels, triggers, unbind/bind and rmmod work as in v3
- no lockdep report from the driver
- after a reboot, the stock U-Boot (2015.04) finds the LEDs back under
CPLD control, after sysrq-b they keep the Linux state (checked with
v3, the shutdown code is the same)

W=1 and sparse on powerpc, COMPILE_TEST on x86_64 and arm64,
dt_binding_check, dtbs_check and get_abi.py show nothing new.
checkpatch --strict only asks about MAINTAINERS on 1/2 and warns about
a macro argument reuse on 2/2.

[1] https://lore.kernel.org/r/20220705000448.14337-1-pali@xxxxxxxxxx/
[2] https://lore.kernel.org/r/20220705155929.25565-1-pali@xxxxxxxxxx/
[3] https://lore.kernel.org/r/20221226123630.6515-1-pali@xxxxxxxxxx/
[4] https://lore.kernel.org/r/20260928111907.72592-1-pepe.schlehofer@xxxxxxxxx/

Pali Rohár (2):
dt-bindings: leds: Add CZ.NIC Turris 1.x LED controller
leds: turris-1x: Add support for CZ.NIC Turris 1.x LEDs

.../testing/sysfs-class-led-driver-turris1x | 58 ++
.../bindings/leds/cznic,turris1x-leds.yaml | 132 ++++
MAINTAINERS | 9 +
drivers/leds/Kconfig | 13 +
drivers/leds/Makefile | 1 +
drivers/leds/leds-turris-1x.c | 624 ++++++++++++++++++
6 files changed, 837 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-class-led-driver-turris1x
create mode 100644 Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml
create mode 100644 drivers/leds/leds-turris-1x.c


base-commit: 59cf91cf87abb67a49b1bb7b9d3b06486abde8cf
--
2.54.0 (Apple Git-157)