b1072ce6408ddb7d24b1267ba313e8286f23ba5b
[openwrt/staging/wigyori.git] /
1 From 13344f8ce8a0d98aa7f5d69ce3b47393c73a343b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Mon, 27 Dec 2021 15:59:04 +0100
4 Subject: [PATCH] dt-bindings: leds: add Broadcom's BCM63138 controller
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Broadcom used 2 LEDs hardware blocks for their BCM63xx SoCs:
10 1. Older one (BCM6318, BCM6328, BCM6362, BCM63268, BCM6838)
11 2. Newer one (BCM6848, BCM6858, BCM63138, BCM63148, BCM63381, BCM68360)
12
13 The newer one was also later also used on BCM4908 SoC.
14
15 Old block is already documented in the leds-bcm6328.yaml. This binding
16 documents the new one which uses different registers & programming. It's
17 first used in BCM63138 thus the binding name.
18
19 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
20 Reviewed-by: Rob Herring <robh@kernel.org>
21 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
22 Signed-off-by: Pavel Machek <pavel@ucw.cz>
23 ---
24 .../bindings/leds/leds-bcm63138.yaml | 95 +++++++++++++++++++
25 1 file changed, 95 insertions(+)
26 create mode 100644 Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
27
28 --- /dev/null
29 +++ b/Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
30 @@ -0,0 +1,95 @@
31 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
32 +%YAML 1.2
33 +---
34 +$id: http://devicetree.org/schemas/leds/leds-bcm63138.yaml#
35 +$schema: http://devicetree.org/meta-schemas/core.yaml#
36 +
37 +title: Broadcom's BCM63138 LEDs controller
38 +
39 +maintainers:
40 + - Rafał Miłecki <rafal@milecki.pl>
41 +
42 +description: |
43 + This LEDs controller was first used on BCM63138 and later reused on BCM4908,
44 + BCM6848, BCM6858, BCM63138, BCM63148, BCM63381 and BCM68360 SoCs.
45 +
46 + It supports up to 32 LEDs that can be connected parallelly or serially. It
47 + also includes limited support for hardware blinking.
48 +
49 + Binding serially connected LEDs isn't documented yet.
50 +
51 +properties:
52 + compatible:
53 + oneOf:
54 + - items:
55 + - enum:
56 + - brcm,bcm4908-leds
57 + - brcm,bcm6848-leds
58 + - brcm,bcm6858-leds
59 + - brcm,bcm63148-leds
60 + - brcm,bcm63381-leds
61 + - brcm,bcm68360-leds
62 + - const: brcm,bcm63138-leds
63 + - const: brcm,bcm63138-leds
64 +
65 + reg:
66 + maxItems: 1
67 +
68 + "#address-cells":
69 + const: 1
70 +
71 + "#size-cells":
72 + const: 0
73 +
74 +patternProperties:
75 + "^led@[a-f0-9]+$":
76 + type: object
77 +
78 + $ref: common.yaml#
79 +
80 + properties:
81 + reg:
82 + maxItems: 1
83 + description: LED pin number
84 +
85 + active-low:
86 + type: boolean
87 + description: Makes LED active low.
88 +
89 + required:
90 + - reg
91 +
92 + unevaluatedProperties: false
93 +
94 +required:
95 + - reg
96 + - "#address-cells"
97 + - "#size-cells"
98 +
99 +additionalProperties: false
100 +
101 +examples:
102 + - |
103 + #include <dt-bindings/leds/common.h>
104 +
105 + leds@ff800800 {
106 + compatible = "brcm,bcm4908-leds", "brcm,bcm63138-leds";
107 + reg = <0xff800800 0xdc>;
108 +
109 + #address-cells = <1>;
110 + #size-cells = <0>;
111 +
112 + led@0 {
113 + reg = <0x0>;
114 + function = LED_FUNCTION_POWER;
115 + color = <LED_COLOR_ID_GREEN>;
116 + default-state = "on";
117 + };
118 +
119 + led@3 {
120 + reg = <0x3>;
121 + function = LED_FUNCTION_STATUS;
122 + color = <LED_COLOR_ID_GREEN>;
123 + active-low;
124 + };
125 + };