From: Ross Cawston <ross@r-sc.ca>
To: lee@kernel.org, pavel@kernel.org
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
chris.packham@alliedtelesis.co.nz, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, linux-leds@vger.kernel.org,
devicetree@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Ross Cawston <ross@r-sc.ca>
Subject: [PATCH 1/3] dt-bindings: leds: add Realtek RTL9301 port LEDs
Date: Sun, 18 Oct 2026 12:43:36 -0700 [thread overview]
Message-ID: <20261018194339.132-2-ross@r-sc.ca> (raw)
In-Reply-To: <20261018194339.132-1-ross@r-sc.ca>
Add a binding for RTL9300 switch port LEDs under software control. The
node is a child of the switch and gives the offset of the software LED
control registers; each LED child names its switch port and its place
among the port's LEDs.
Signed-off-by: Ross Cawston <ross@r-sc.ca>
---
.../leds/realtek,rtl9301-port-leds.yaml | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/realtek,rtl9301-port-leds.yaml
diff --git a/Documentation/devicetree/bindings/leds/realtek,rtl9301-port-leds.yaml b/Documentation/devicetree/bindings/leds/realtek,rtl9301-port-leds.yaml
new file mode 100644
index 00000000000..8d6b3552526
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/realtek,rtl9301-port-leds.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/realtek,rtl9301-port-leds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek RTL9300 switch port LEDs under software control
+
+maintainers:
+ - Ross Cawston <ross@r-sc.ca>
+
+description: |
+ The RTL9300 switch drives up to four LEDs per port over its LED interface,
+ serial or scanned, each normally showing a hardware function chosen by the
+ LED set of the port. The LEDs listed here are taken over by software instead
+ and switched on and off as LED class devices, for port LEDs that have no
+ hardware function such as the PoE status LED of a PoE switch. The node is a
+ child of the switch, whose registers it uses.
+
+properties:
+ compatible:
+ const: realtek,rtl9301-port-leds
+
+ reg:
+ description: The software LED control registers, from SW_LED_LOAD to the
+ end of LED_PORT_SW_CTRL, as an offset into the switch registers.
+ maxItems: 1
+
+ "#address-cells":
+ const: 2
+
+ "#size-cells":
+ const: 0
+
+patternProperties:
+ "^led@[0-9a-f]+,[0-3]$":
+ $ref: /schemas/leds/common.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ reg:
+ items:
+ - items:
+ - description: Switch port
+ maximum: 27
+ - description: LED of the port, numbered as in the port's
+ LED set
+ maximum: 3
+
+ required:
+ - reg
+
+required:
+ - compatible
+ - reg
+ - "#address-cells"
+ - "#size-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/common.h>
+
+ led-controller@cc48 {
+ compatible = "realtek,rtl9301-port-leds";
+ reg = <0xcc48 0x84>;
+ #address-cells = <2>;
+ #size-cells = <0>;
+
+ led@0,2 {
+ reg = <0 2>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = "poe";
+ function-enumerator = <1>;
+ };
+
+ led@8,2 {
+ reg = <8 2>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = "poe";
+ function-enumerator = <2>;
+ };
+ };
--
2.55.0.windows.5
next prev parent reply other threads:[~2026-10-18 19:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 19:43 [PATCH 0/3] leds: add Realtek RTL9300 port LEDs under software control Ross Cawston
2026-10-18 19:43 ` Ross Cawston [this message]
2026-10-18 19:43 ` [PATCH 2/3] dt-bindings: net: realtek,rtl9301-switch: add port LED controller Ross Cawston
2026-10-18 19:43 ` [PATCH 3/3] leds: add Realtek RTL9300 port LED driver Ross Cawston
2026-10-19 7:01 ` Uwe Kleine-König
2026-10-18 22:36 ` [PATCH 0/3] leds: add Realtek RTL9300 port LEDs under software control Andrew Lunn
2026-10-18 23:20 ` Ross Cawston
2026-10-19 0:02 ` Andrew Lunn
2026-10-19 5:42 ` Ross Cawston
2026-10-19 6:41 ` AW: " Markus Stockhausen
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=20261018194339.132-2-ross@r-sc.ca \
--to=ross@r-sc.ca \
--cc=andrew+netdev@lunn.ch \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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