From: Josef Schlehofer <pepe.schlehofer@gmail.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: "Pali Rohár" <pali@kernel.org>, "Marek Behún" <kabel@kernel.org>,
"Andy Shevchenko" <andy@kernel.org>, "Rong Zhang" <i@rong.moe>,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/2] dt-bindings: leds: Add CZ.NIC Turris 1.x LED controller
Date: Mon, 28 Sep 2026 13:19:06 +0200 [thread overview]
Message-ID: <20260928111907.72592-2-pepe.schlehofer@gmail.com> (raw)
In-Reply-To: <20260928111907.72592-1-pepe.schlehofer@gmail.com>
From: Pali Rohár <pali@kernel.org>
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@kernel.org>
Cc: Marek Behún <kabel@kernel.org>
Co-developed-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
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@gmail.com>
+
+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)
next prev parent reply other threads:[~2026-09-28 11:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 11:19 [PATCH v3 0/2] leds: Add support for CZ.NIC Turris 1.x LEDs Josef Schlehofer
2026-09-28 11:19 ` Josef Schlehofer [this message]
2026-09-28 11:19 ` [PATCH v3 2/2] leds: Add support for " Josef Schlehofer
2026-09-28 13:07 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260928111907.72592-2-pepe.schlehofer@gmail.com \
--to=pepe.schlehofer@gmail.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=i@rong.moe \
--cc=kabel@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pali@kernel.org \
--cc=pavel@kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®