Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: qcom: ipq8064-rb3011: Add Switch LED for each port

Add Switch LED for each port for MikroTik RB3011UiAS-RM.

MikroTik RB3011UiAS-RM is a 10 port device with 2 qca8337 switch chips
connected.

It was discovered that in the hardware design all 3 Switch LED trace of
the related port is connected to the same LED. This was discovered by
setting to 'always on' the related led in the switch regs and noticing
that all 3 LED for the specific port (for example for port 1) cause the
connected LED for port 1 to turn on. As an extra test we tried enabling
2 different LED for the port resulting in the LED turned off only if
every led in the reg was off.

Aside from this funny and strange hardware implementation, the device
itself have one green LED for each port, resulting in 10 green LED one
for each of the 10 supported port.

Cc: Jonathan McDowell <noodles@earth.li>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Christian Marangi and committed by
David S. Miller
09930f1f 939595c7

+120
+120
arch/arm/boot/dts/qcom-ipq8064-rb3011.dts
··· 65 65 port@1 { 66 66 reg = <1>; 67 67 label = "sw1"; 68 + 69 + leds { 70 + #address-cells = <1>; 71 + #size-cells = <0>; 72 + 73 + led@0 { 74 + reg = <0>; 75 + color = <LED_COLOR_ID_GREEN>; 76 + function = LED_FUNCTION_LAN; 77 + default-state = "keep"; 78 + }; 79 + }; 68 80 }; 69 81 70 82 port@2 { 71 83 reg = <2>; 72 84 label = "sw2"; 85 + 86 + leds { 87 + #address-cells = <1>; 88 + #size-cells = <0>; 89 + 90 + led@0 { 91 + reg = <0>; 92 + color = <LED_COLOR_ID_GREEN>; 93 + function = LED_FUNCTION_LAN; 94 + default-state = "keep"; 95 + }; 96 + }; 73 97 }; 74 98 75 99 port@3 { 76 100 reg = <3>; 77 101 label = "sw3"; 102 + 103 + leds { 104 + #address-cells = <1>; 105 + #size-cells = <0>; 106 + 107 + led@0 { 108 + reg = <0>; 109 + color = <LED_COLOR_ID_GREEN>; 110 + function = LED_FUNCTION_LAN; 111 + default-state = "keep"; 112 + }; 113 + }; 78 114 }; 79 115 80 116 port@4 { 81 117 reg = <4>; 82 118 label = "sw4"; 119 + 120 + leds { 121 + #address-cells = <1>; 122 + #size-cells = <0>; 123 + 124 + led@0 { 125 + reg = <0>; 126 + color = <LED_COLOR_ID_GREEN>; 127 + function = LED_FUNCTION_LAN; 128 + default-state = "keep"; 129 + }; 130 + }; 83 131 }; 84 132 85 133 port@5 { 86 134 reg = <5>; 87 135 label = "sw5"; 136 + 137 + leds { 138 + #address-cells = <1>; 139 + #size-cells = <0>; 140 + 141 + led@0 { 142 + reg = <0>; 143 + color = <LED_COLOR_ID_GREEN>; 144 + function = LED_FUNCTION_LAN; 145 + default-state = "keep"; 146 + }; 147 + }; 88 148 }; 89 149 }; 90 150 }; ··· 190 130 port@1 { 191 131 reg = <1>; 192 132 label = "sw6"; 133 + 134 + leds { 135 + #address-cells = <1>; 136 + #size-cells = <0>; 137 + 138 + led@0 { 139 + reg = <0>; 140 + color = <LED_COLOR_ID_GREEN>; 141 + function = LED_FUNCTION_LAN; 142 + default-state = "keep"; 143 + }; 144 + }; 193 145 }; 194 146 195 147 port@2 { 196 148 reg = <2>; 197 149 label = "sw7"; 150 + 151 + leds { 152 + #address-cells = <1>; 153 + #size-cells = <0>; 154 + 155 + led@0 { 156 + reg = <0>; 157 + color = <LED_COLOR_ID_GREEN>; 158 + function = LED_FUNCTION_LAN; 159 + default-state = "keep"; 160 + }; 161 + }; 198 162 }; 199 163 200 164 port@3 { 201 165 reg = <3>; 202 166 label = "sw8"; 167 + 168 + leds { 169 + #address-cells = <1>; 170 + #size-cells = <0>; 171 + 172 + led@0 { 173 + reg = <0>; 174 + color = <LED_COLOR_ID_GREEN>; 175 + function = LED_FUNCTION_LAN; 176 + default-state = "keep"; 177 + }; 178 + }; 203 179 }; 204 180 205 181 port@4 { 206 182 reg = <4>; 207 183 label = "sw9"; 184 + 185 + leds { 186 + #address-cells = <1>; 187 + #size-cells = <0>; 188 + 189 + led@0 { 190 + reg = <0>; 191 + color = <LED_COLOR_ID_GREEN>; 192 + function = LED_FUNCTION_LAN; 193 + default-state = "keep"; 194 + }; 195 + }; 208 196 }; 209 197 210 198 port@5 { 211 199 reg = <5>; 212 200 label = "sw10"; 201 + 202 + leds { 203 + #address-cells = <1>; 204 + #size-cells = <0>; 205 + 206 + led@0 { 207 + reg = <0>; 208 + color = <LED_COLOR_ID_GREEN>; 209 + function = LED_FUNCTION_LAN; 210 + default-state = "keep"; 211 + }; 212 + }; 213 213 }; 214 214 }; 215 215 };