lkml.org 
[lkml]   [2024]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED usage
Each port can have up to 4 LEDs (3 for current rtl8365mb devices). The
LED reg property will indicate its LED group.

An example of LED usage was included in an existing switch example.

Cc: devicetree@vger.kernel.org
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
.../devicetree/bindings/net/dsa/realtek.yaml | 46 ++++++++++++++++++++++
1 file changed, 46 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
index 70b6bda3cf98..45c1656b3fae 100644
--- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
@@ -108,6 +108,32 @@ properties:
compatible:
const: realtek,smi-mdio

+patternProperties:
+ '^(ethernet-)?ports$':
+ type: object
+ additionalProperties: true
+
+ patternProperties:
+ '^(ethernet-)?port@[0-6]$':
+ type: object
+ additionalProperties: true
+
+ properties:
+ leds:
+ description:
+ "LEDs associated with this port"
+
+ patternProperties:
+ '^led@[a-f0-9]+$':
+ type: object
+ additionalProperties: true
+
+ properties:
+ reg:
+ description:
+ "reg indicates the LED group for this LED"
+ enum: [0, 1, 2, 3]
+
if:
required:
- reg
@@ -144,6 +170,7 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/leds/common.h>
#include <dt-bindings/interrupt-controller/irq.h>

platform {
@@ -190,6 +217,25 @@ examples:
reg = <4>;
label = "wan";
phy-handle = <&phy4>;
+
+ leds {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led@0 {
+ reg = <0>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_WAN;
+ default-state = "keep";
+ };
+
+ led@3 {
+ reg = <3>;
+ color = <LED_COLOR_ID_AMBER>;
+ function = LED_FUNCTION_WAN;
+ default-state = "keep";
+ };
+ };
};
port@5 {
reg = <5>;
--
2.44.0


\
 
 \ /
  Last update: 2024-05-27 15:43    [W:0.228 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site