diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-03-02 11:49:27 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-26 18:09:23 -0400 |
commit | 96c10de32fde6c50e4f9e5c1f027e670073ea086 (patch) | |
tree | e705ab979dd0a537149830d64dae51b79656a382 /arch/mips/bcm47xx | |
parent | 848eeb66c7e09cbb76e866d77d6ec87abc9a787e (diff) |
MIPS: BCM47XX: Add button and led configuration for some Linksys devices
This adds led and button GPIO configuration for Linksys wrt54g3gv2,
wrt54gsv1 and wrtsl54gs. This is based on OpenWrt broadcom-diag code.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-mips@linux-mips.org
Cc: zajec5@gmail.com
Patchwork: https://patchwork.linux-mips.org/patch/6592/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r-- | arch/mips/bcm47xx/buttons.c | 27 | ||||
-rw-r--r-- | arch/mips/bcm47xx/leds.c | 33 |
2 files changed, 60 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c index 872c62e93e0e..f165887b1eca 100644 --- a/arch/mips/bcm47xx/buttons.c +++ b/arch/mips/bcm47xx/buttons.c | |||
@@ -259,6 +259,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __initconst = { | |||
259 | }; | 259 | }; |
260 | 260 | ||
261 | static const struct gpio_keys_button | 261 | static const struct gpio_keys_button |
262 | bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = { | ||
263 | BCM47XX_GPIO_KEY(5, KEY_WIMAX), | ||
264 | BCM47XX_GPIO_KEY(6, KEY_RESTART), | ||
265 | }; | ||
266 | |||
267 | static const struct gpio_keys_button | ||
268 | bcm47xx_buttons_linksys_wrt54gsv1[] __initconst = { | ||
269 | BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), | ||
270 | BCM47XX_GPIO_KEY(6, KEY_RESTART), | ||
271 | }; | ||
272 | |||
273 | static const struct gpio_keys_button | ||
262 | bcm47xx_buttons_linksys_wrt610nv1[] __initconst = { | 274 | bcm47xx_buttons_linksys_wrt610nv1[] __initconst = { |
263 | BCM47XX_GPIO_KEY(6, KEY_RESTART), | 275 | BCM47XX_GPIO_KEY(6, KEY_RESTART), |
264 | BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), | 276 | BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), |
@@ -270,6 +282,12 @@ bcm47xx_buttons_linksys_wrt610nv2[] __initconst = { | |||
270 | BCM47XX_GPIO_KEY(6, KEY_RESTART), | 282 | BCM47XX_GPIO_KEY(6, KEY_RESTART), |
271 | }; | 283 | }; |
272 | 284 | ||
285 | static const struct gpio_keys_button | ||
286 | bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = { | ||
287 | BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), | ||
288 | BCM47XX_GPIO_KEY(6, KEY_RESTART), | ||
289 | }; | ||
290 | |||
273 | /* Motorola */ | 291 | /* Motorola */ |
274 | 292 | ||
275 | static const struct gpio_keys_button | 293 | static const struct gpio_keys_button |
@@ -479,12 +497,21 @@ int __init bcm47xx_buttons_register(void) | |||
479 | case BCM47XX_BOARD_LINKSYS_WRT310NV1: | 497 | case BCM47XX_BOARD_LINKSYS_WRT310NV1: |
480 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); | 498 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); |
481 | break; | 499 | break; |
500 | case BCM47XX_BOARD_LINKSYS_WRT54G: | ||
501 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54gsv1); | ||
502 | break; | ||
503 | case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: | ||
504 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2); | ||
505 | break; | ||
482 | case BCM47XX_BOARD_LINKSYS_WRT610NV1: | 506 | case BCM47XX_BOARD_LINKSYS_WRT610NV1: |
483 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1); | 507 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1); |
484 | break; | 508 | break; |
485 | case BCM47XX_BOARD_LINKSYS_WRT610NV2: | 509 | case BCM47XX_BOARD_LINKSYS_WRT610NV2: |
486 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2); | 510 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2); |
487 | break; | 511 | break; |
512 | case BCM47XX_BOARD_LINKSYS_WRTSL54GS: | ||
513 | err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs); | ||
514 | break; | ||
488 | 515 | ||
489 | case BCM47XX_BOARD_MOTOROLA_WE800G: | 516 | case BCM47XX_BOARD_MOTOROLA_WE800G: |
490 | err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g); | 517 | err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g); |
diff --git a/arch/mips/bcm47xx/leds.c b/arch/mips/bcm47xx/leds.c index 647d15527066..d74117574f01 100644 --- a/arch/mips/bcm47xx/leds.c +++ b/arch/mips/bcm47xx/leds.c | |||
@@ -292,6 +292,21 @@ bcm47xx_leds_linksys_wrt310nv1[] __initconst = { | |||
292 | }; | 292 | }; |
293 | 293 | ||
294 | static const struct gpio_led | 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 | ||
295 | bcm47xx_leds_linksys_wrt610nv1[] __initconst = { | 310 | bcm47xx_leds_linksys_wrt610nv1[] __initconst = { |
296 | BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), | 311 | BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), |
297 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF), | 312 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF), |
@@ -308,6 +323,15 @@ bcm47xx_leds_linksys_wrt610nv2[] __initconst = { | |||
308 | BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), | 323 | BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), |
309 | }; | 324 | }; |
310 | 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 | |||
311 | /* Motorola */ | 335 | /* Motorola */ |
312 | 336 | ||
313 | static const struct gpio_led | 337 | static const struct gpio_led |
@@ -502,12 +526,21 @@ void __init bcm47xx_leds_register(void) | |||
502 | case BCM47XX_BOARD_LINKSYS_WRT310NV1: | 526 | case BCM47XX_BOARD_LINKSYS_WRT310NV1: |
503 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1); | 527 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1); |
504 | break; | 528 | break; |
529 | case BCM47XX_BOARD_LINKSYS_WRT54G: | ||
530 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54gsv1); | ||
531 | break; | ||
532 | case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: | ||
533 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2); | ||
534 | break; | ||
505 | case BCM47XX_BOARD_LINKSYS_WRT610NV1: | 535 | case BCM47XX_BOARD_LINKSYS_WRT610NV1: |
506 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1); | 536 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1); |
507 | break; | 537 | break; |
508 | case BCM47XX_BOARD_LINKSYS_WRT610NV2: | 538 | case BCM47XX_BOARD_LINKSYS_WRT610NV2: |
509 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2); | 539 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2); |
510 | break; | 540 | break; |
541 | case BCM47XX_BOARD_LINKSYS_WRTSL54GS: | ||
542 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs); | ||
543 | break; | ||
511 | 544 | ||
512 | case BCM47XX_BOARD_MOTOROLA_WE800G: | 545 | case BCM47XX_BOARD_MOTOROLA_WE800G: |
513 | bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g); | 546 | bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g); |