Linux 3.15-rc1
[linux/fpc-iii.git] / arch / mips / bcm47xx / leds.c
blobadcb547a91c394cad116fd3a6c622318bb88515f
1 #include "bcm47xx_private.h"
3 #include <linux/leds.h>
4 #include <bcm47xx_board.h>
6 /**************************************************
7 * Database
8 **************************************************/
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, \
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, \
29 /* Asus */
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),
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),
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),
49 static const struct gpio_led
50 bcm47xx_leds_asus_wl300g[] __initconst = {
51 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
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),
61 static const struct gpio_led
62 bcm47xx_leds_asus_wl330ge[] __initconst = {
63 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
66 static const struct gpio_led
67 bcm47xx_leds_asus_wl500gd[] __initconst = {
68 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
71 static const struct gpio_led
72 bcm47xx_leds_asus_wl500gpv1[] __initconst = {
73 BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
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),
82 static const struct gpio_led
83 bcm47xx_leds_asus_wl500w[] __initconst = {
84 BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
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),
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),
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. */
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),
110 /* Belkin */
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),
122 /* Buffalo */
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),
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),
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),
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),
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),
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),
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),
177 /* Dell */
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),
185 /* D-Link */
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),
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),
200 /* Huawei */
202 static const struct gpio_led
203 bcm47xx_leds_huawei_e970[] __initconst = {
204 BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
207 /* Linksys */
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),
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),
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),
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),
242 static const struct gpio_led
243 bcm47xx_leds_linksys_e3200v1[] __initconst = {
244 BCM47XX_GPIO_LED(3, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
247 static const struct gpio_led
248 bcm47xx_leds_linksys_e4200v1[] __initconst = {
249 BCM47XX_GPIO_LED(5, "white", "power", 1, LEDS_GPIO_DEFSTATE_ON),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
335 /* Motorola */
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),
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),
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),
359 /* Netgear */
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),
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),
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),
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),
394 /* SimpleTech */
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 */
401 /**************************************************
402 * Init
403 **************************************************/
405 static struct gpio_led_platform_data bcm47xx_leds_pdata;
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)
412 void __init bcm47xx_leds_register(void)
414 enum bcm47xx_board board = bcm47xx_board_get();
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;
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;
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;
490 case BCM47XX_BOARD_DELL_TM2300:
491 bcm47xx_set_pdata(bcm47xx_leds_dell_tm2300);
492 break;
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;
501 case BCM47XX_BOARD_HUAWEI_E970:
502 bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
503 break;
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;
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;
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;
577 case BCM47XX_BOARD_SIEMENS_SE505V2:
578 bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2);
579 break;
581 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
582 bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare);
583 break;
585 default:
586 pr_debug("No LEDs configuration found for this device\n");
587 return;
590 gpio_led_register_device(-1, &bcm47xx_leds_pdata);