1 #include "bcm47xx_private.h"
3 #include <linux/leds.h>
4 #include <bcm47xx_board.h>
6 /**************************************************
8 **************************************************/
10 #define BCM47XX_GPIO_LED(_gpio, _color, _function, _active_low, \
13 .name = "bcm47xx:" _color ":" _function, \
15 .active_low = _active_low, \
16 .default_state = _default_state, \
19 #define BCM47XX_GPIO_LED_TRIGGER(_gpio, _color, _function, _active_low, \
22 .name = "bcm47xx:" _color ":" _function, \
24 .active_low = _active_low, \
25 .default_state = LEDS_GPIO_DEFSTATE_OFF, \
26 .default_trigger = _default_trigger, \
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_rtn15u
[] __initconst
= {
39 /* TODO: Add "wlan" LED */
40 BCM47XX_GPIO_LED(3, "blue", "wan", 1, LEDS_GPIO_DEFSTATE_OFF
),
41 BCM47XX_GPIO_LED(4, "blue", "lan", 1, LEDS_GPIO_DEFSTATE_OFF
),
42 BCM47XX_GPIO_LED(6, "blue", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
43 BCM47XX_GPIO_LED(9, "blue", "usb", 0, LEDS_GPIO_DEFSTATE_OFF
),
46 static const struct gpio_led
47 bcm47xx_leds_asus_rtn16
[] __initconst
= {
48 BCM47XX_GPIO_LED(1, "blue", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
49 BCM47XX_GPIO_LED(7, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
52 static const struct gpio_led
53 bcm47xx_leds_asus_rtn66u
[] __initconst
= {
54 BCM47XX_GPIO_LED(12, "blue", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
55 BCM47XX_GPIO_LED(15, "blue", "usb", 1, LEDS_GPIO_DEFSTATE_OFF
),
58 static const struct gpio_led
59 bcm47xx_leds_asus_wl300g
[] __initconst
= {
60 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
63 static const struct gpio_led
64 bcm47xx_leds_asus_wl320ge
[] __initconst
= {
65 BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
66 BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
67 BCM47XX_GPIO_LED(11, "unk", "link", 1, LEDS_GPIO_DEFSTATE_OFF
),
70 static const struct gpio_led
71 bcm47xx_leds_asus_wl330ge
[] __initconst
= {
72 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
75 static const struct gpio_led
76 bcm47xx_leds_asus_wl500g
[] __initconst
= {
77 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
80 static const struct gpio_led
81 bcm47xx_leds_asus_wl500gd
[] __initconst
= {
82 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
85 static const struct gpio_led
86 bcm47xx_leds_asus_wl500gpv1
[] __initconst
= {
87 BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
90 static const struct gpio_led
91 bcm47xx_leds_asus_wl500gpv2
[] __initconst
= {
92 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
93 BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
96 static const struct gpio_led
97 bcm47xx_leds_asus_wl500w
[] __initconst
= {
98 BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
101 static const struct gpio_led
102 bcm47xx_leds_asus_wl520gc
[] __initconst
= {
103 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
104 BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
107 static const struct gpio_led
108 bcm47xx_leds_asus_wl520gu
[] __initconst
= {
109 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
110 BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
113 static const struct gpio_led
114 bcm47xx_leds_asus_wl700ge
[] __initconst
= {
115 BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
), /* Labeled "READY" (there is no "power" LED). Originally ON, flashing on USB activity. */
118 static const struct gpio_led
119 bcm47xx_leds_asus_wlhdd
[] __initconst
= {
120 BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
121 BCM47XX_GPIO_LED(2, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF
),
126 static const struct gpio_led
127 bcm47xx_leds_belkin_f7d4301
[] __initconst
= {
128 BCM47XX_GPIO_LED(10, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
129 BCM47XX_GPIO_LED(11, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF
),
130 BCM47XX_GPIO_LED(12, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
131 BCM47XX_GPIO_LED(13, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
132 BCM47XX_GPIO_LED(14, "unk", "usb0", 1, LEDS_GPIO_DEFSTATE_OFF
),
133 BCM47XX_GPIO_LED(15, "unk", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF
),
138 static const struct gpio_led
139 bcm47xx_leds_buffalo_whr2_a54g54
[] __initconst
= {
140 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
143 static const struct gpio_led
144 bcm47xx_leds_buffalo_whr_g125
[] __initconst
= {
145 BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF
),
146 BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
147 BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF
),
148 BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
149 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
152 static const struct gpio_led
153 bcm47xx_leds_buffalo_whr_g54s
[] __initconst
= {
154 BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF
),
155 BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
156 BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF
),
157 BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
158 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
161 static const struct gpio_led
162 bcm47xx_leds_buffalo_whr_hp_g54
[] __initconst
= {
163 BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF
),
164 BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
165 BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF
),
166 BCM47XX_GPIO_LED(6, "unk", "wps", 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_g300n
[] __initconst
= {
172 BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF
),
173 BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
174 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
177 static const struct gpio_led
178 bcm47xx_leds_buffalo_wzr_rs_g54
[] __initconst
= {
179 BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
180 BCM47XX_GPIO_LED(1, "unk", "vpn", 1, LEDS_GPIO_DEFSTATE_OFF
),
181 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
184 static const struct gpio_led
185 bcm47xx_leds_buffalo_wzr_rs_g54hp
[] __initconst
= {
186 BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
187 BCM47XX_GPIO_LED(1, "unk", "vpn", 1, LEDS_GPIO_DEFSTATE_OFF
),
188 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
193 static const struct gpio_led
194 bcm47xx_leds_dell_tm2300
[] __initconst
= {
195 BCM47XX_GPIO_LED(6, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
196 BCM47XX_GPIO_LED(7, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
201 static const struct gpio_led
202 bcm47xx_leds_dlink_dir130
[] __initconst
= {
203 BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */
204 BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF
),
207 static const struct gpio_led
208 bcm47xx_leds_dlink_dir330
[] __initconst
= {
209 BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */
210 BCM47XX_GPIO_LED(4, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF
),
211 BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF
),
216 static const struct gpio_led
217 bcm47xx_leds_huawei_e970
[] __initconst
= {
218 BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
223 static const struct gpio_led
224 bcm47xx_leds_linksys_e1000v1
[] __initconst
= {
225 BCM47XX_GPIO_LED(0, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
226 BCM47XX_GPIO_LED(1, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
227 BCM47XX_GPIO_LED(2, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
228 BCM47XX_GPIO_LED(4, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
231 static const struct gpio_led
232 bcm47xx_leds_linksys_e1000v21
[] __initconst
= {
233 BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
234 BCM47XX_GPIO_LED(6, "blue", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
235 BCM47XX_GPIO_LED(7, "amber", "wps", 0, LEDS_GPIO_DEFSTATE_OFF
),
236 BCM47XX_GPIO_LED(8, "blue", "wps", 0, LEDS_GPIO_DEFSTATE_OFF
),
239 static const struct gpio_led
240 bcm47xx_leds_linksys_e2000v1
[] __initconst
= {
241 BCM47XX_GPIO_LED(1, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
242 BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
243 BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
244 BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
247 static const struct gpio_led
248 bcm47xx_leds_linksys_e3000v1
[] __initconst
= {
249 BCM47XX_GPIO_LED(0, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
250 BCM47XX_GPIO_LED(1, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
251 BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
252 BCM47XX_GPIO_LED(5, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
253 BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF
),
256 static const struct gpio_led
257 bcm47xx_leds_linksys_e3200v1
[] __initconst
= {
258 BCM47XX_GPIO_LED(3, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
261 static const struct gpio_led
262 bcm47xx_leds_linksys_e4200v1
[] __initconst
= {
263 BCM47XX_GPIO_LED(5, "white", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
266 static const struct gpio_led
267 bcm47xx_leds_linksys_wrt150nv1
[] __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, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
273 static const struct gpio_led
274 bcm47xx_leds_linksys_wrt150nv11
[] __initconst
= {
275 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
276 BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
277 BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
280 static const struct gpio_led
281 bcm47xx_leds_linksys_wrt160nv1
[] __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, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
287 static const struct gpio_led
288 bcm47xx_leds_linksys_wrt160nv3
[] __initconst
= {
289 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
290 BCM47XX_GPIO_LED(2, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
291 BCM47XX_GPIO_LED(4, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
294 static const struct gpio_led
295 bcm47xx_leds_linksys_wrt300nv11
[] __initconst
= {
296 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
297 BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
298 BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
301 static const struct gpio_led
302 bcm47xx_leds_linksys_wrt310nv1
[] __initconst
= {
303 BCM47XX_GPIO_LED(1, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
304 BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
305 BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
308 static const struct gpio_led
309 bcm47xx_leds_linksys_wrt54g_generic
[] __initconst
= {
310 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF
),
311 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
312 BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
313 BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
316 static const struct gpio_led
317 bcm47xx_leds_linksys_wrt54g3gv2
[] __initconst
= {
318 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
319 BCM47XX_GPIO_LED(2, "green", "3g", 0, LEDS_GPIO_DEFSTATE_OFF
),
320 BCM47XX_GPIO_LED(3, "blue", "3g", 0, LEDS_GPIO_DEFSTATE_OFF
),
323 /* Verified on: WRT54GS V1.0 */
324 static const struct gpio_led
325 bcm47xx_leds_linksys_wrt54g_type_0101
[] __initconst
= {
326 BCM47XX_GPIO_LED(0, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
327 BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
328 BCM47XX_GPIO_LED(7, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF
),
331 /* Verified on: WRT54GL V1.1 */
332 static const struct gpio_led
333 bcm47xx_leds_linksys_wrt54g_type_0467
[] __initconst
= {
334 BCM47XX_GPIO_LED(0, "green", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
335 BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
336 BCM47XX_GPIO_LED(2, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
337 BCM47XX_GPIO_LED(3, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
338 BCM47XX_GPIO_LED(7, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF
),
341 static const struct gpio_led
342 bcm47xx_leds_linksys_wrt610nv1
[] __initconst
= {
343 BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF
),
344 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF
),
345 BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
346 BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
349 static const struct gpio_led
350 bcm47xx_leds_linksys_wrt610nv2
[] __initconst
= {
351 BCM47XX_GPIO_LED(0, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
352 BCM47XX_GPIO_LED(1, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
353 BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
354 BCM47XX_GPIO_LED(5, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
355 BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF
),
358 static const struct gpio_led
359 bcm47xx_leds_linksys_wrtsl54gs
[] __initconst
= {
360 BCM47XX_GPIO_LED(0, "green", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF
),
361 BCM47XX_GPIO_LED(1, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
362 BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
363 BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
368 static const struct gpio_led
369 bcm47xx_leds_microsoft_nm700
[] __initconst
= {
370 BCM47XX_GPIO_LED(6, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
375 static const struct gpio_led
376 bcm47xx_leds_motorola_we800g
[] __initconst
= {
377 BCM47XX_GPIO_LED(1, "amber", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF
),
378 BCM47XX_GPIO_LED(2, "unk", "unk", 1, LEDS_GPIO_DEFSTATE_OFF
), /* There are only 3 LEDs: Power, Wireless and Device (ethernet) */
379 BCM47XX_GPIO_LED(4, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
382 static const struct gpio_led
383 bcm47xx_leds_motorola_wr850gp
[] __initconst
= {
384 BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
385 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
386 BCM47XX_GPIO_LED(6, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF
),
387 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
390 static const struct gpio_led
391 bcm47xx_leds_motorola_wr850gv2v3
[] __initconst
= {
392 BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
393 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
394 BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF
),
399 static const struct gpio_led
400 bcm47xx_leds_netgear_wndr3400v1
[] __initconst
= {
401 BCM47XX_GPIO_LED(2, "green", "usb", 1, LEDS_GPIO_DEFSTATE_OFF
),
402 BCM47XX_GPIO_LED(3, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
403 BCM47XX_GPIO_LED(7, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF
),
406 static const struct gpio_led
407 bcm47xx_leds_netgear_wndr4500v1
[] __initconst
= {
408 BCM47XX_GPIO_LED(1, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
409 BCM47XX_GPIO_LED(2, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
410 BCM47XX_GPIO_LED(3, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF
),
411 BCM47XX_GPIO_LED(8, "green", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF
),
412 BCM47XX_GPIO_LED(9, "green", "2ghz", 1, LEDS_GPIO_DEFSTATE_OFF
),
413 BCM47XX_GPIO_LED(11, "blue", "5ghz", 1, LEDS_GPIO_DEFSTATE_OFF
),
414 BCM47XX_GPIO_LED(14, "green", "usb2", 1, LEDS_GPIO_DEFSTATE_OFF
),
417 static const struct gpio_led
418 bcm47xx_leds_netgear_wnr3500lv1
[] __initconst
= {
419 BCM47XX_GPIO_LED(0, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
420 BCM47XX_GPIO_LED(1, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF
),
421 BCM47XX_GPIO_LED(2, "green", "wan", 1, LEDS_GPIO_DEFSTATE_OFF
),
422 BCM47XX_GPIO_LED(3, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
423 BCM47XX_GPIO_LED(7, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF
),
426 static const struct gpio_led
427 bcm47xx_leds_netgear_wnr834bv2
[] __initconst
= {
428 BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON
),
429 BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF
),
430 BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF
),
434 static const struct gpio_led
435 bcm47xx_leds_siemens_se505v2
[] __initconst
= {
436 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF
),
437 BCM47XX_GPIO_LED(3, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF
),
438 BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON
),
443 static const struct gpio_led
444 bcm47xx_leds_simpletech_simpleshare
[] __initconst
= {
445 BCM47XX_GPIO_LED(1, "unk", "status", 1, LEDS_GPIO_DEFSTATE_OFF
), /* "Ready" LED */
448 /**************************************************
450 **************************************************/
452 static struct gpio_led_platform_data bcm47xx_leds_pdata
;
454 #define bcm47xx_set_pdata(dev_leds) do { \
455 bcm47xx_leds_pdata.leds = dev_leds; \
456 bcm47xx_leds_pdata.num_leds = ARRAY_SIZE(dev_leds); \
459 void __init
bcm47xx_leds_register(void)
461 enum bcm47xx_board board
= bcm47xx_board_get();
464 case BCM47XX_BOARD_ASUS_RTN12
:
465 bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12
);
467 case BCM47XX_BOARD_ASUS_RTN15U
:
468 bcm47xx_set_pdata(bcm47xx_leds_asus_rtn15u
);
470 case BCM47XX_BOARD_ASUS_RTN16
:
471 bcm47xx_set_pdata(bcm47xx_leds_asus_rtn16
);
473 case BCM47XX_BOARD_ASUS_RTN66U
:
474 bcm47xx_set_pdata(bcm47xx_leds_asus_rtn66u
);
476 case BCM47XX_BOARD_ASUS_WL300G
:
477 bcm47xx_set_pdata(bcm47xx_leds_asus_wl300g
);
479 case BCM47XX_BOARD_ASUS_WL320GE
:
480 bcm47xx_set_pdata(bcm47xx_leds_asus_wl320ge
);
482 case BCM47XX_BOARD_ASUS_WL330GE
:
483 bcm47xx_set_pdata(bcm47xx_leds_asus_wl330ge
);
485 case BCM47XX_BOARD_ASUS_WL500G
:
486 bcm47xx_set_pdata(bcm47xx_leds_asus_wl500g
);
488 case BCM47XX_BOARD_ASUS_WL500GD
:
489 bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gd
);
491 case BCM47XX_BOARD_ASUS_WL500GPV1
:
492 bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gpv1
);
494 case BCM47XX_BOARD_ASUS_WL500GPV2
:
495 bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gpv2
);
497 case BCM47XX_BOARD_ASUS_WL500W
:
498 bcm47xx_set_pdata(bcm47xx_leds_asus_wl500w
);
500 case BCM47XX_BOARD_ASUS_WL520GC
:
501 bcm47xx_set_pdata(bcm47xx_leds_asus_wl520gc
);
503 case BCM47XX_BOARD_ASUS_WL520GU
:
504 bcm47xx_set_pdata(bcm47xx_leds_asus_wl520gu
);
506 case BCM47XX_BOARD_ASUS_WL700GE
:
507 bcm47xx_set_pdata(bcm47xx_leds_asus_wl700ge
);
509 case BCM47XX_BOARD_ASUS_WLHDD
:
510 bcm47xx_set_pdata(bcm47xx_leds_asus_wlhdd
);
513 case BCM47XX_BOARD_BELKIN_F7D3301
:
514 case BCM47XX_BOARD_BELKIN_F7D3302
:
515 case BCM47XX_BOARD_BELKIN_F7D4301
:
516 case BCM47XX_BOARD_BELKIN_F7D4302
:
517 case BCM47XX_BOARD_BELKIN_F7D4401
:
518 bcm47xx_set_pdata(bcm47xx_leds_belkin_f7d4301
);
521 case BCM47XX_BOARD_BUFFALO_WHR2_A54G54
:
522 bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr2_a54g54
);
524 case BCM47XX_BOARD_BUFFALO_WHR_G125
:
525 bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_g125
);
527 case BCM47XX_BOARD_BUFFALO_WHR_G54S
:
528 bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_g54s
);
530 case BCM47XX_BOARD_BUFFALO_WHR_HP_G54
:
531 bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_hp_g54
);
533 case BCM47XX_BOARD_BUFFALO_WZR_G300N
:
534 bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_g300n
);
536 case BCM47XX_BOARD_BUFFALO_WZR_RS_G54
:
537 bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_rs_g54
);
539 case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP
:
540 bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_rs_g54hp
);
543 case BCM47XX_BOARD_DELL_TM2300
:
544 bcm47xx_set_pdata(bcm47xx_leds_dell_tm2300
);
547 case BCM47XX_BOARD_DLINK_DIR130
:
548 bcm47xx_set_pdata(bcm47xx_leds_dlink_dir130
);
550 case BCM47XX_BOARD_DLINK_DIR330
:
551 bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330
);
554 case BCM47XX_BOARD_HUAWEI_E970
:
555 bcm47xx_set_pdata(bcm47xx_leds_huawei_e970
);
558 case BCM47XX_BOARD_LINKSYS_E1000V1
:
559 bcm47xx_set_pdata(bcm47xx_leds_linksys_e1000v1
);
561 case BCM47XX_BOARD_LINKSYS_E1000V21
:
562 bcm47xx_set_pdata(bcm47xx_leds_linksys_e1000v21
);
564 case BCM47XX_BOARD_LINKSYS_E2000V1
:
565 bcm47xx_set_pdata(bcm47xx_leds_linksys_e2000v1
);
567 case BCM47XX_BOARD_LINKSYS_E3000V1
:
568 bcm47xx_set_pdata(bcm47xx_leds_linksys_e3000v1
);
570 case BCM47XX_BOARD_LINKSYS_E3200V1
:
571 bcm47xx_set_pdata(bcm47xx_leds_linksys_e3200v1
);
573 case BCM47XX_BOARD_LINKSYS_E4200V1
:
574 bcm47xx_set_pdata(bcm47xx_leds_linksys_e4200v1
);
576 case BCM47XX_BOARD_LINKSYS_WRT150NV1
:
577 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt150nv1
);
579 case BCM47XX_BOARD_LINKSYS_WRT150NV11
:
580 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt150nv11
);
582 case BCM47XX_BOARD_LINKSYS_WRT160NV1
:
583 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt160nv1
);
585 case BCM47XX_BOARD_LINKSYS_WRT160NV3
:
586 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt160nv3
);
588 case BCM47XX_BOARD_LINKSYS_WRT300NV11
:
589 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt300nv11
);
591 case BCM47XX_BOARD_LINKSYS_WRT310NV1
:
592 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1
);
594 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2
:
595 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2
);
597 case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101
:
598 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g_type_0101
);
600 case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467
:
601 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g_type_0467
);
603 case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708
:
604 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g_generic
);
606 case BCM47XX_BOARD_LINKSYS_WRT610NV1
:
607 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1
);
609 case BCM47XX_BOARD_LINKSYS_WRT610NV2
:
610 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2
);
612 case BCM47XX_BOARD_LINKSYS_WRTSL54GS
:
613 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs
);
616 case BCM47XX_BOARD_MICROSOFT_MN700
:
617 bcm47xx_set_pdata(bcm47xx_leds_microsoft_nm700
);
620 case BCM47XX_BOARD_MOTOROLA_WE800G
:
621 bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g
);
623 case BCM47XX_BOARD_MOTOROLA_WR850GP
:
624 bcm47xx_set_pdata(bcm47xx_leds_motorola_wr850gp
);
626 case BCM47XX_BOARD_MOTOROLA_WR850GV2V3
:
627 bcm47xx_set_pdata(bcm47xx_leds_motorola_wr850gv2v3
);
630 case BCM47XX_BOARD_NETGEAR_WNDR3400V1
:
631 bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr3400v1
);
633 case BCM47XX_BOARD_NETGEAR_WNDR4500V1
:
634 bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr4500v1
);
636 case BCM47XX_BOARD_NETGEAR_WNR3500L
:
637 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1
);
639 case BCM47XX_BOARD_NETGEAR_WNR834BV2
:
640 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2
);
643 case BCM47XX_BOARD_SIEMENS_SE505V2
:
644 bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2
);
647 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE
:
648 bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare
);
652 pr_debug("No LEDs configuration found for this device\n");
656 gpio_led_register_device(-1, &bcm47xx_leds_pdata
);