[PATCH v3 1/2] dt-bindings: leds: Add CZ.NIC Turris 1.x LED controller
From: Josef Schlehofer
Date: Mon Sep 28 2026 - 07:19:39 EST
From: Pali Rohár <pali@xxxxxxxxxx>
Add a binding for the LED controller on the front panel of the CZ.NIC
Turris 1.x routers. The LEDs are controlled by the firmware of the
CZ.NIC CPLD, which is memory mapped on the local bus.
The turris1x.dts device tree, which is part of the mainline kernel since
v6.0, already references this compatible string.
Signed-off-by: Pali Rohár <pali@xxxxxxxxxx>
Cc: Marek Behún <kabel@xxxxxxxxxx>
Co-developed-by: Josef Schlehofer <pepe.schlehofer@xxxxxxxxx>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@xxxxxxxxx>
---
Notes:
Changes in v3, by Josef Schlehofer:
- drop the file name and "binding" from the subject
- describe the hardware rather than the driver
- fix example indentation and use the merged turris1x.dts node
- set Josef Schlehofer as the binding maintainer
- constrain color to LED_COLOR_ID_RGB
- list the required controller and LED properties
- describe the register range and the LED order in the reg properties,
and put the SPDX expression in parentheses
- pass dt_binding_check with dtschema 2026.9
checkpatch asks whether MAINTAINERS needs updating for the new file.
The MAINTAINERS entry that covers it is added in 2/2, together with
the driver.
.../bindings/leds/cznic,turris1x-leds.yaml | 132 ++++++++++++++++++
1 file changed, 132 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml
diff --git a/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml b/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml
new file mode 100644
index 000000000000..ad7ef7015f0b
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml
@@ -0,0 +1,132 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/cznic,turris1x-leds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: CZ.NIC Turris 1.x LED controller
+
+maintainers:
+ - Josef Schlehofer <pepe.schlehofer@xxxxxxxxx>
+
+description:
+ The front panel of the CZ.NIC Turris 1.x routers carries eight RGB LEDs
+ driven by the CPLD firmware running on a Lattice FPGA. The five LAN LEDs
+ share one set of colour registers, so they cannot be given different
+ colours or brightness from each other. The CPLD firmware is open source
+ and available at
+ https://gitlab.nic.cz/turris/hw/turris_cpld/-/blob/master/CZ_NIC_Router_CPLD.v
+
+properties:
+ compatible:
+ const: cznic,turris1x-leds
+
+ reg:
+ description:
+ CPLD address range of the LED registers. It starts at the first colour
+ register, offset 0x13 in the CPLD, and ends at 0x2f; the offsets of
+ the registers inside the range are fixed by the CPLD firmware.
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+patternProperties:
+ "^multi-led@[0-7]$":
+ type: object
+ $ref: leds-class-multicolor.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ color:
+ const: 9 # LED_COLOR_ID_RGB
+
+ reg:
+ description:
+ Index of the LED, which is also its bit in the CPLD LED control
+ registers. 0 is WAN, 1 to 5 are LAN 5 to LAN 1, 6 is WiFi and 7 is
+ power. The CPLD source calls LEDs 1 to 5 lan1 to lan5 and the WiFi
+ LED status.
+ minimum: 0
+ maximum: 7
+
+ required:
+ - reg
+ - color
+
+required:
+ - compatible
+ - reg
+ - "#address-cells"
+ - "#size-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/common.h>
+
+ led-controller@13 {
+ compatible = "cznic,turris1x-leds";
+ reg = <0x13 0x1d>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ multi-led@0 {
+ reg = <0x0>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_WAN;
+ };
+
+ multi-led@1 {
+ reg = <0x1>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_LAN;
+ function-enumerator = <5>;
+ };
+
+ multi-led@2 {
+ reg = <0x2>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_LAN;
+ function-enumerator = <4>;
+ };
+
+ multi-led@3 {
+ reg = <0x3>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_LAN;
+ function-enumerator = <3>;
+ };
+
+ multi-led@4 {
+ reg = <0x4>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_LAN;
+ function-enumerator = <2>;
+ };
+
+ multi-led@5 {
+ reg = <0x5>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_LAN;
+ function-enumerator = <1>;
+ };
+
+ multi-led@6 {
+ reg = <0x6>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_WLAN;
+ };
+
+ multi-led@7 {
+ reg = <0x7>;
+ color = <LED_COLOR_ID_RGB>;
+ function = LED_FUNCTION_POWER;
+ };
+ };
+
+...
--
2.54.0 (Apple Git-157)