xref: /linux/arch/mips/bcm47xx/leds.c (revision 00a6d7b6762c27d441e9ac8faff36384bc0fc180)
1 #include "bcm47xx_private.h"
2 
3 #include <linux/leds.h>
4 #include <bcm47xx_board.h>
5 
6 /**************************************************
7  * Database
8  **************************************************/
9 
10 #define BCM47XX_GPIO_LED(_gpio, _color, _function, _active_low,		\
11 			 _default_state)				\
12 	{								\
13 		.name		= "bcm47xx:" _color ":" _function,	\
14 		.gpio		= _gpio,				\
15 		.active_low	= _active_low,				\
16 		.default_state	= _default_state,			\
17 	}
18 
19 #define BCM47XX_GPIO_LED_TRIGGER(_gpio, _color, _function, _active_low,	\
20 				 _default_trigger)			\
21 	{								\
22 		.name		= "bcm47xx:" _color ":" _function,	\
23 		.gpio		= _gpio,				\
24 		.active_low	= _active_low,				\
25 		.default_state	= LEDS_GPIO_DEFSTATE_OFF,		\
26 		.default_trigger	= _default_trigger,		\
27 	}
28 
29 /* Asus */
30 
31 static const struct gpio_led
32 bcm47xx_leds_asus_rtn12[] __initconst = {
33 	BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
34 	BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
35 };
36 
37 static const struct gpio_led
38 bcm47xx_leds_asus_rtn16[] __initconst = {
39 	BCM47XX_GPIO_LED(1, "blue", "power", 1, LEDS_GPIO_DEFSTATE_ON),
40 	BCM47XX_GPIO_LED(7, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
41 };
42 
43 static const struct gpio_led
44 bcm47xx_leds_asus_rtn66u[] __initconst = {
45 	BCM47XX_GPIO_LED(12, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
46 	BCM47XX_GPIO_LED(15, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
47 };
48 
49 static const struct gpio_led
50 bcm47xx_leds_asus_wl300g[] __initconst = {
51 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
52 };
53 
54 static const struct gpio_led
55 bcm47xx_leds_asus_wl320ge[] __initconst = {
56 	BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
57 	BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
58 	BCM47XX_GPIO_LED(11, "unk", "link", 1, LEDS_GPIO_DEFSTATE_OFF),
59 };
60 
61 static const struct gpio_led
62 bcm47xx_leds_asus_wl330ge[] __initconst = {
63 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
64 };
65 
66 static const struct gpio_led
67 bcm47xx_leds_asus_wl500gd[] __initconst = {
68 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
69 };
70 
71 static const struct gpio_led
72 bcm47xx_leds_asus_wl500gpv1[] __initconst = {
73 	BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
74 };
75 
76 static const struct gpio_led
77 bcm47xx_leds_asus_wl500gpv2[] __initconst = {
78 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
79 	BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
80 };
81 
82 static const struct gpio_led
83 bcm47xx_leds_asus_wl500w[] __initconst = {
84 	BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
85 };
86 
87 static const struct gpio_led
88 bcm47xx_leds_asus_wl520gc[] __initconst = {
89 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
90 	BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
91 };
92 
93 static const struct gpio_led
94 bcm47xx_leds_asus_wl520gu[] __initconst = {
95 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
96 	BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
97 };
98 
99 static const struct gpio_led
100 bcm47xx_leds_asus_wl700ge[] __initconst = {
101 	BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), /* Labeled "READY" (there is no "power" LED). Originally ON, flashing on USB activity. */
102 };
103 
104 static const struct gpio_led
105 bcm47xx_leds_asus_wlhdd[] __initconst = {
106 	BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
107 	BCM47XX_GPIO_LED(2, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
108 };
109 
110 /* Belkin */
111 
112 static const struct gpio_led
113 bcm47xx_leds_belkin_f7d4301[] __initconst = {
114 	BCM47XX_GPIO_LED(10, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
115 	BCM47XX_GPIO_LED(11, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF),
116 	BCM47XX_GPIO_LED(12, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
117 	BCM47XX_GPIO_LED(13, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
118 	BCM47XX_GPIO_LED(14, "unk", "usb0", 1, LEDS_GPIO_DEFSTATE_OFF),
119 	BCM47XX_GPIO_LED(15, "unk", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF),
120 };
121 
122 /* Buffalo */
123 
124 static const struct gpio_led
125 bcm47xx_leds_buffalo_whr2_a54g54[] __initconst = {
126 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
127 };
128 
129 static const struct gpio_led
130 bcm47xx_leds_buffalo_whr_g125[] __initconst = {
131 	BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF),
132 	BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
133 	BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF),
134 	BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
135 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
136 };
137 
138 static const struct gpio_led
139 bcm47xx_leds_buffalo_whr_g54s[] __initconst = {
140 	BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF),
141 	BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
142 	BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF),
143 	BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
144 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
145 };
146 
147 static const struct gpio_led
148 bcm47xx_leds_buffalo_whr_hp_g54[] __initconst = {
149 	BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF),
150 	BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
151 	BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF),
152 	BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
153 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
154 };
155 
156 static const struct gpio_led
157 bcm47xx_leds_buffalo_wzr_g300n[] __initconst = {
158 	BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF),
159 	BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
160 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
161 };
162 
163 static const struct gpio_led
164 bcm47xx_leds_buffalo_wzr_rs_g54[] __initconst = {
165 	BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
166 	BCM47XX_GPIO_LED(1, "unk", "vpn", 1, LEDS_GPIO_DEFSTATE_OFF),
167 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
168 };
169 
170 static const struct gpio_led
171 bcm47xx_leds_buffalo_wzr_rs_g54hp[] __initconst = {
172 	BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
173 	BCM47XX_GPIO_LED(1, "unk", "vpn", 1, LEDS_GPIO_DEFSTATE_OFF),
174 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
175 };
176 
177 /* Dell */
178 
179 static const struct gpio_led
180 bcm47xx_leds_dell_tm2300[] __initconst = {
181 	BCM47XX_GPIO_LED(6, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
182 	BCM47XX_GPIO_LED(7, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
183 };
184 
185 /* D-Link */
186 
187 static const struct gpio_led
188 bcm47xx_leds_dlink_dir130[] __initconst = {
189 	BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */
190 	BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF),
191 };
192 
193 static const struct gpio_led
194 bcm47xx_leds_dlink_dir330[] __initconst = {
195 	BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */
196 	BCM47XX_GPIO_LED(4, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
197 	BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF),
198 };
199 
200 /* Huawei */
201 
202 static const struct gpio_led
203 bcm47xx_leds_huawei_e970[] __initconst = {
204 	BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
205 };
206 
207 /* Linksys */
208 
209 static const struct gpio_led
210 bcm47xx_leds_linksys_e1000v1[] __initconst = {
211 	BCM47XX_GPIO_LED(0, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
212 	BCM47XX_GPIO_LED(1, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
213 	BCM47XX_GPIO_LED(2, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
214 	BCM47XX_GPIO_LED(4, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
215 };
216 
217 static const struct gpio_led
218 bcm47xx_leds_linksys_e1000v21[] __initconst = {
219 	BCM47XX_GPIO_LED(5, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
220 	BCM47XX_GPIO_LED(6, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
221 	BCM47XX_GPIO_LED(7, "amber", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
222 	BCM47XX_GPIO_LED(8, "blue", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
223 };
224 
225 static const struct gpio_led
226 bcm47xx_leds_linksys_e2000v1[] __initconst = {
227 	BCM47XX_GPIO_LED(1, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
228 	BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
229 	BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
230 	BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
231 };
232 
233 static const struct gpio_led
234 bcm47xx_leds_linksys_e3000v1[] __initconst = {
235 	BCM47XX_GPIO_LED(0, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
236 	BCM47XX_GPIO_LED(1, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
237 	BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
238 	BCM47XX_GPIO_LED(5, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
239 	BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
240 };
241 
242 static const struct gpio_led
243 bcm47xx_leds_linksys_e3200v1[] __initconst = {
244 	BCM47XX_GPIO_LED(3, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
245 };
246 
247 static const struct gpio_led
248 bcm47xx_leds_linksys_e4200v1[] __initconst = {
249 	BCM47XX_GPIO_LED(5, "white", "power", 1, LEDS_GPIO_DEFSTATE_ON),
250 };
251 
252 static const struct gpio_led
253 bcm47xx_leds_linksys_wrt150nv1[] __initconst = {
254 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
255 	BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
256 	BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
257 };
258 
259 static const struct gpio_led
260 bcm47xx_leds_linksys_wrt150nv11[] __initconst = {
261 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
262 	BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
263 	BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
264 };
265 
266 static const struct gpio_led
267 bcm47xx_leds_linksys_wrt160nv1[] __initconst = {
268 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
269 	BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
270 	BCM47XX_GPIO_LED(5, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
271 };
272 
273 static const struct gpio_led
274 bcm47xx_leds_linksys_wrt160nv3[] __initconst = {
275 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
276 	BCM47XX_GPIO_LED(2, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
277 	BCM47XX_GPIO_LED(4, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
278 };
279 
280 static const struct gpio_led
281 bcm47xx_leds_linksys_wrt300nv11[] __initconst = {
282 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
283 	BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
284 	BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
285 };
286 
287 static const struct gpio_led
288 bcm47xx_leds_linksys_wrt310nv1[] __initconst = {
289 	BCM47XX_GPIO_LED(1, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
290 	BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
291 	BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
292 };
293 
294 static const struct gpio_led
295 bcm47xx_leds_linksys_wrt54gsv1[] __initconst = {
296 	BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
297 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
298 	BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
299 	BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
300 };
301 
302 static const struct gpio_led
303 bcm47xx_leds_linksys_wrt54g3gv2[] __initconst = {
304 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
305 	BCM47XX_GPIO_LED(2, "green", "3g", 0, LEDS_GPIO_DEFSTATE_OFF),
306 	BCM47XX_GPIO_LED(3, "blue", "3g", 0, LEDS_GPIO_DEFSTATE_OFF),
307 };
308 
309 static const struct gpio_led
310 bcm47xx_leds_linksys_wrt610nv1[] __initconst = {
311 	BCM47XX_GPIO_LED(0, "unk", "usb",  1, LEDS_GPIO_DEFSTATE_OFF),
312 	BCM47XX_GPIO_LED(1, "unk", "power",  0, LEDS_GPIO_DEFSTATE_OFF),
313 	BCM47XX_GPIO_LED(3, "amber", "wps",  1, LEDS_GPIO_DEFSTATE_OFF),
314 	BCM47XX_GPIO_LED(9, "blue", "wps",  1, LEDS_GPIO_DEFSTATE_OFF),
315 };
316 
317 static const struct gpio_led
318 bcm47xx_leds_linksys_wrt610nv2[] __initconst = {
319 	BCM47XX_GPIO_LED(0, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
320 	BCM47XX_GPIO_LED(1, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
321 	BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
322 	BCM47XX_GPIO_LED(5, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
323 	BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
324 };
325 
326 static const struct gpio_led
327 bcm47xx_leds_linksys_wrtsl54gs[] __initconst = {
328 	BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
329 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
330 	BCM47XX_GPIO_LED(2, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
331 	BCM47XX_GPIO_LED(3, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
332 	BCM47XX_GPIO_LED(7, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
333 };
334 
335 /* Motorola */
336 
337 static const struct gpio_led
338 bcm47xx_leds_motorola_we800g[] __initconst = {
339 	BCM47XX_GPIO_LED(1, "amber", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
340 	BCM47XX_GPIO_LED(2, "unk", "unk", 1, LEDS_GPIO_DEFSTATE_OFF), /* There are only 3 LEDs: Power, Wireless and Device (ethernet) */
341 	BCM47XX_GPIO_LED(4, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
342 };
343 
344 static const struct gpio_led
345 bcm47xx_leds_motorola_wr850gp[] __initconst = {
346 	BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
347 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
348 	BCM47XX_GPIO_LED(6, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
349 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
350 };
351 
352 static const struct gpio_led
353 bcm47xx_leds_motorola_wr850gv2v3[] __initconst = {
354 	BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
355 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
356 	BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF),
357 };
358 
359 /* Netgear */
360 
361 static const struct gpio_led
362 bcm47xx_leds_netgear_wndr3400v1[] __initconst = {
363 	BCM47XX_GPIO_LED(2, "green", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
364 	BCM47XX_GPIO_LED(3, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
365 	BCM47XX_GPIO_LED(7, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
366 };
367 
368 static const struct gpio_led
369 bcm47xx_leds_netgear_wndr4500v1[] __initconst = {
370 	BCM47XX_GPIO_LED(1, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
371 	BCM47XX_GPIO_LED(2, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
372 	BCM47XX_GPIO_LED(3, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF),
373 	BCM47XX_GPIO_LED(8, "green", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF),
374 	BCM47XX_GPIO_LED(9, "green", "2ghz", 1, LEDS_GPIO_DEFSTATE_OFF),
375 	BCM47XX_GPIO_LED(11, "blue", "5ghz", 1, LEDS_GPIO_DEFSTATE_OFF),
376 	BCM47XX_GPIO_LED(14, "green", "usb2", 1, LEDS_GPIO_DEFSTATE_OFF),
377 };
378 
379 static const struct gpio_led
380 bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
381 	BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
382 	BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
383 	BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF),
384 };
385 
386 /* Siemens */
387 static const struct gpio_led
388 bcm47xx_leds_siemens_se505v2[] __initconst = {
389 	BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
390 	BCM47XX_GPIO_LED(3, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
391 	BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
392 };
393 
394 /* SimpleTech */
395 
396 static const struct gpio_led
397 bcm47xx_leds_simpletech_simpleshare[] __initconst = {
398 	BCM47XX_GPIO_LED(1, "unk", "status", 1, LEDS_GPIO_DEFSTATE_OFF), /* "Ready" LED */
399 };
400 
401 /**************************************************
402  * Init
403  **************************************************/
404 
405 static struct gpio_led_platform_data bcm47xx_leds_pdata;
406 
407 #define bcm47xx_set_pdata(dev_leds) do {				\
408 	bcm47xx_leds_pdata.leds = dev_leds;				\
409 	bcm47xx_leds_pdata.num_leds = ARRAY_SIZE(dev_leds);		\
410 } while (0)
411 
412 void __init bcm47xx_leds_register(void)
413 {
414 	enum bcm47xx_board board = bcm47xx_board_get();
415 
416 	switch (board) {
417 	case BCM47XX_BOARD_ASUS_RTN12:
418 		bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
419 		break;
420 	case BCM47XX_BOARD_ASUS_RTN16:
421 		bcm47xx_set_pdata(bcm47xx_leds_asus_rtn16);
422 		break;
423 	case BCM47XX_BOARD_ASUS_RTN66U:
424 		bcm47xx_set_pdata(bcm47xx_leds_asus_rtn66u);
425 		break;
426 	case BCM47XX_BOARD_ASUS_WL300G:
427 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl300g);
428 		break;
429 	case BCM47XX_BOARD_ASUS_WL320GE:
430 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl320ge);
431 		break;
432 	case BCM47XX_BOARD_ASUS_WL330GE:
433 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl330ge);
434 		break;
435 	case BCM47XX_BOARD_ASUS_WL500GD:
436 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gd);
437 		break;
438 	case BCM47XX_BOARD_ASUS_WL500GPV1:
439 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gpv1);
440 		break;
441 	case BCM47XX_BOARD_ASUS_WL500GPV2:
442 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gpv2);
443 		break;
444 	case BCM47XX_BOARD_ASUS_WL500W:
445 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl500w);
446 		break;
447 	case BCM47XX_BOARD_ASUS_WL520GC:
448 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl520gc);
449 		break;
450 	case BCM47XX_BOARD_ASUS_WL520GU:
451 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl520gu);
452 		break;
453 	case BCM47XX_BOARD_ASUS_WL700GE:
454 		bcm47xx_set_pdata(bcm47xx_leds_asus_wl700ge);
455 		break;
456 	case BCM47XX_BOARD_ASUS_WLHDD:
457 		bcm47xx_set_pdata(bcm47xx_leds_asus_wlhdd);
458 		break;
459 
460 	case BCM47XX_BOARD_BELKIN_F7D3301:
461 	case BCM47XX_BOARD_BELKIN_F7D3302:
462 	case BCM47XX_BOARD_BELKIN_F7D4301:
463 	case BCM47XX_BOARD_BELKIN_F7D4302:
464 	case BCM47XX_BOARD_BELKIN_F7D4401:
465 		bcm47xx_set_pdata(bcm47xx_leds_belkin_f7d4301);
466 		break;
467 
468 	case BCM47XX_BOARD_BUFFALO_WHR2_A54G54:
469 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr2_a54g54);
470 		break;
471 	case BCM47XX_BOARD_BUFFALO_WHR_G125:
472 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_g125);
473 		break;
474 	case BCM47XX_BOARD_BUFFALO_WHR_G54S:
475 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_g54s);
476 		break;
477 	case BCM47XX_BOARD_BUFFALO_WHR_HP_G54:
478 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_hp_g54);
479 		break;
480 	case BCM47XX_BOARD_BUFFALO_WZR_G300N:
481 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_g300n);
482 		break;
483 	case BCM47XX_BOARD_BUFFALO_WZR_RS_G54:
484 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_rs_g54);
485 		break;
486 	case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP:
487 		bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_rs_g54hp);
488 		break;
489 
490 	case BCM47XX_BOARD_DELL_TM2300:
491 		bcm47xx_set_pdata(bcm47xx_leds_dell_tm2300);
492 		break;
493 
494 	case BCM47XX_BOARD_DLINK_DIR130:
495 		bcm47xx_set_pdata(bcm47xx_leds_dlink_dir130);
496 		break;
497 	case BCM47XX_BOARD_DLINK_DIR330:
498 		bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330);
499 		break;
500 
501 	case BCM47XX_BOARD_HUAWEI_E970:
502 		bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
503 		break;
504 
505 	case BCM47XX_BOARD_LINKSYS_E1000V1:
506 		bcm47xx_set_pdata(bcm47xx_leds_linksys_e1000v1);
507 		break;
508 	case BCM47XX_BOARD_LINKSYS_E1000V21:
509 		bcm47xx_set_pdata(bcm47xx_leds_linksys_e1000v21);
510 		break;
511 	case BCM47XX_BOARD_LINKSYS_E2000V1:
512 		bcm47xx_set_pdata(bcm47xx_leds_linksys_e2000v1);
513 		break;
514 	case BCM47XX_BOARD_LINKSYS_E3000V1:
515 		bcm47xx_set_pdata(bcm47xx_leds_linksys_e3000v1);
516 		break;
517 	case BCM47XX_BOARD_LINKSYS_E3200V1:
518 		bcm47xx_set_pdata(bcm47xx_leds_linksys_e3200v1);
519 		break;
520 	case BCM47XX_BOARD_LINKSYS_E4200V1:
521 		bcm47xx_set_pdata(bcm47xx_leds_linksys_e4200v1);
522 		break;
523 	case BCM47XX_BOARD_LINKSYS_WRT150NV1:
524 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt150nv1);
525 		break;
526 	case BCM47XX_BOARD_LINKSYS_WRT150NV11:
527 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt150nv11);
528 		break;
529 	case BCM47XX_BOARD_LINKSYS_WRT160NV1:
530 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt160nv1);
531 		break;
532 	case BCM47XX_BOARD_LINKSYS_WRT160NV3:
533 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt160nv3);
534 		break;
535 	case BCM47XX_BOARD_LINKSYS_WRT300NV11:
536 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt300nv11);
537 		break;
538 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
539 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
540 		break;
541 	case BCM47XX_BOARD_LINKSYS_WRT54G:
542 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54gsv1);
543 		break;
544 	case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
545 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
546 		break;
547 	case BCM47XX_BOARD_LINKSYS_WRT610NV1:
548 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1);
549 		break;
550 	case BCM47XX_BOARD_LINKSYS_WRT610NV2:
551 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2);
552 		break;
553 	case BCM47XX_BOARD_LINKSYS_WRTSL54GS:
554 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs);
555 		break;
556 
557 	case BCM47XX_BOARD_MOTOROLA_WE800G:
558 		bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g);
559 		break;
560 	case BCM47XX_BOARD_MOTOROLA_WR850GP:
561 		bcm47xx_set_pdata(bcm47xx_leds_motorola_wr850gp);
562 		break;
563 	case BCM47XX_BOARD_MOTOROLA_WR850GV2V3:
564 		bcm47xx_set_pdata(bcm47xx_leds_motorola_wr850gv2v3);
565 		break;
566 
567 	case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
568 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr3400v1);
569 		break;
570 	case BCM47XX_BOARD_NETGEAR_WNDR4500V1:
571 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr4500v1);
572 		break;
573 	case BCM47XX_BOARD_NETGEAR_WNR834BV2:
574 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2);
575 		break;
576 
577 	case BCM47XX_BOARD_SIEMENS_SE505V2:
578 		bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2);
579 		break;
580 
581 	case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
582 		bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare);
583 		break;
584 
585 	default:
586 		pr_debug("No LEDs configuration found for this device\n");
587 		return;
588 	}
589 
590 	gpio_led_register_device(-1, &bcm47xx_leds_pdata);
591 }
592