ath25: switch default kernel to 5.15
[openwrt/openwrt.git] / target / linux / mvebu / patches-5.10 / 006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch
1 From 91dd42d0e30fdbb250c61d1192af569f07e6ada4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
3 Date: Sun, 15 Nov 2020 14:59:21 +0100
4 Subject: ARM: dts: turris-omnia: add LED controller node
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Linux now has incomplete support for the LED controller on Turris Omnia:
10 it can set brightness and colors for each LED.
11
12 The controller can also put these LEDs into HW controlled mode, in which
13 the LEDs are controlled by HW: for example the WAN LED is connected via
14 MCU to the WAN PHY LED pin.
15
16 The driver does not support these HW controlled modes yet, and on probe
17 puts the LEDs into SW controlled mode.
18
19 Add node describing the LED controller, but disable it for now.
20
21 Signed-off-by: Marek Behún <kabel@kernel.org>
22 Cc: linux-arm-kernel@lists.infradead.org
23 Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
24 Cc: Jason Cooper <jason@lakedaemon.net>
25 Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
26 Cc: Andreas Färber <afaerber@suse.de>
27 Cc: Rob Herring <robh+dt@kernel.org>
28 Cc: devicetree@vger.kernel.org
29 Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
30 ---
31 arch/arm/boot/dts/armada-385-turris-omnia.dts | 111 +++++++++++++++++++++++++-
32 1 file changed, 110 insertions(+), 1 deletion(-)
33
34 --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
35 +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
36 @@ -12,6 +12,7 @@
37
38 #include <dt-bindings/gpio/gpio.h>
39 #include <dt-bindings/input/input.h>
40 +#include <dt-bindings/leds/common.h>
41 #include "armada-385.dtsi"
42
43 / {
44 @@ -187,7 +188,115 @@
45 reg = <0>;
46
47 /* STM32F0 command interface at address 0x2a */
48 - /* leds device (in STM32F0) at address 0x2b */
49 +
50 + led-controller@2b {
51 + compatible = "cznic,turris-omnia-leds";
52 + reg = <0x2b>;
53 + #address-cells = <1>;
54 + #size-cells = <0>;
55 +
56 + /*
57 + * LEDs are controlled by MCU (STM32F0) at
58 + * address 0x2b.
59 + *
60 + * The driver does not support HW control mode
61 + * for the LEDs yet. Disable the LEDs for now.
62 + *
63 + * Also LED functions are not stable yet:
64 + * - there are 3 LEDs connected via MCU to PCIe
65 + * ports. One of these ports supports mSATA.
66 + * There is no mSATA nor PCIe function.
67 + * For now we use LED_FUNCTION_WLAN, since
68 + * in most cases users have wifi cards in
69 + * these slots
70 + * - there are 2 LEDs dedicated for user: A and
71 + * B. Again there is no such function defined.
72 + * For now we use LED_FUNCTION_INDICATOR
73 + */
74 + status = "disabled";
75 +
76 + multi-led@0 {
77 + reg = <0x0>;
78 + color = <LED_COLOR_ID_RGB>;
79 + function = LED_FUNCTION_INDICATOR;
80 + function-enumerator = <2>;
81 + };
82 +
83 + multi-led@1 {
84 + reg = <0x1>;
85 + color = <LED_COLOR_ID_RGB>;
86 + function = LED_FUNCTION_INDICATOR;
87 + function-enumerator = <1>;
88 + };
89 +
90 + multi-led@2 {
91 + reg = <0x2>;
92 + color = <LED_COLOR_ID_RGB>;
93 + function = LED_FUNCTION_WLAN;
94 + function-enumerator = <3>;
95 + };
96 +
97 + multi-led@3 {
98 + reg = <0x3>;
99 + color = <LED_COLOR_ID_RGB>;
100 + function = LED_FUNCTION_WLAN;
101 + function-enumerator = <2>;
102 + };
103 +
104 + multi-led@4 {
105 + reg = <0x4>;
106 + color = <LED_COLOR_ID_RGB>;
107 + function = LED_FUNCTION_WLAN;
108 + function-enumerator = <1>;
109 + };
110 +
111 + multi-led@5 {
112 + reg = <0x5>;
113 + color = <LED_COLOR_ID_RGB>;
114 + function = LED_FUNCTION_WAN;
115 + };
116 +
117 + multi-led@6 {
118 + reg = <0x6>;
119 + color = <LED_COLOR_ID_RGB>;
120 + function = LED_FUNCTION_LAN;
121 + function-enumerator = <4>;
122 + };
123 +
124 + multi-led@7 {
125 + reg = <0x7>;
126 + color = <LED_COLOR_ID_RGB>;
127 + function = LED_FUNCTION_LAN;
128 + function-enumerator = <3>;
129 + };
130 +
131 + multi-led@8 {
132 + reg = <0x8>;
133 + color = <LED_COLOR_ID_RGB>;
134 + function = LED_FUNCTION_LAN;
135 + function-enumerator = <2>;
136 + };
137 +
138 + multi-led@9 {
139 + reg = <0x9>;
140 + color = <LED_COLOR_ID_RGB>;
141 + function = LED_FUNCTION_LAN;
142 + function-enumerator = <1>;
143 + };
144 +
145 + multi-led@a {
146 + reg = <0xa>;
147 + color = <LED_COLOR_ID_RGB>;
148 + function = LED_FUNCTION_LAN;
149 + function-enumerator = <0>;
150 + };
151 +
152 + multi-led@b {
153 + reg = <0xb>;
154 + color = <LED_COLOR_ID_RGB>;
155 + function = LED_FUNCTION_POWER;
156 + };
157 + };
158
159 eeprom@54 {
160 compatible = "atmel,24c64";