ar71xx: fix ethernet LEDs on the DIR-600-A1 board
authorGabor Juhos <juhosg@openwrt.org>
Tue, 31 Jan 2012 18:37:24 +0000 (18:37 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Tue, 31 Jan 2012 18:37:24 +0000 (18:37 +0000)
SVN-Revision: 29975

target/linux/ar71xx/base-files/etc/uci-defaults/leds
target/linux/ar71xx/files-2.6.39/arch/mips/ar71xx/mach-dir-600-a1.c
target/linux/ar71xx/files-3.2/arch/mips/ath79/mach-dir-600-a1.c

index 5b5aea35a4c1ea6f76396262649f7e934bc1730a..05c2f27b55fdd442f6cbf3654311d3f96cf85d55 100755 (executable)
@@ -118,6 +118,7 @@ rb750)
        set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02"
        ;;
 
+dir-600-a1|\
 dir-615-e4)
        set_led_netdev "wan" "WAN" "d-link:green:wan" "eth1"
        set_led_switch "lan1" "LAN1" "d-link:green:lan1" "switch0" "0x02"
index e0da86752d174155c0f0c44317c875cf09edd5c1..211985ed04320518021c8eee78e848f0155bd179 100644 (file)
 #define DIR_600_A1_GPIO_LED_WPS                        0
 #define DIR_600_A1_GPIO_LED_POWER_AMBER                1
 #define DIR_600_A1_GPIO_LED_POWER_GREEN                6
+#define DIR_600_A1_GPIO_LED_LAN1               13
+#define DIR_600_A1_GPIO_LED_LAN2               14
+#define DIR_600_A1_GPIO_LED_LAN3               15
+#define DIR_600_A1_GPIO_LED_LAN4               16
+#define DIR_600_A1_GPIO_LED_WAN_AMBER          7
+#define DIR_600_A1_GPIO_LED_WAN_GREEN          17
 
 #define DIR_600_A1_GPIO_BTN_RESET              8
 #define DIR_600_A1_GPIO_BTN_WPS                        12
@@ -85,6 +91,29 @@ static struct gpio_led dir_600_a1_leds_gpio[] __initdata = {
        }, {
                .name           = "d-link:amber:power",
                .gpio           = DIR_600_A1_GPIO_LED_POWER_AMBER,
+       }, {
+               .name           = "d-link:amber:wan",
+               .gpio           = DIR_600_A1_GPIO_LED_WAN_AMBER,
+       }, {
+               .name           = "d-link:green:wan",
+               .gpio           = DIR_600_A1_GPIO_LED_WAN_GREEN,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan1",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN1,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan2",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN2,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan3",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN3,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan4",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN4,
+               .active_low     = 1,
        }, {
                .name           = "d-link:blue:wps",
                .gpio           = DIR_600_A1_GPIO_LED_WPS,
@@ -126,6 +155,12 @@ static void __init dir_600_a1_setup(void)
 
        ar71xx_add_device_m25p80(&dir_600_a1_flash_data);
 
+       ar71xx_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(dir_600_a1_leds_gpio),
                                        dir_600_a1_leds_gpio);
 
index 9eca411a61d1626fade16c7bf775d25c77b564ae..6c5083202992bdc886b4424f79854a5246517a88 100644 (file)
@@ -12,7 +12,9 @@
 #include <linux/mtd/partitions.h>
 
 #include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
 
+#include "common.h"
 #include "dev-ap9x-pci.h"
 #include "dev-eth.h"
 #include "dev-gpio-buttons.h"
 #define DIR_600_A1_GPIO_LED_WPS                        0
 #define DIR_600_A1_GPIO_LED_POWER_AMBER                1
 #define DIR_600_A1_GPIO_LED_POWER_GREEN                6
+#define DIR_600_A1_GPIO_LED_LAN1               13
+#define DIR_600_A1_GPIO_LED_LAN2               14
+#define DIR_600_A1_GPIO_LED_LAN3               15
+#define DIR_600_A1_GPIO_LED_LAN4               16
+#define DIR_600_A1_GPIO_LED_WAN_AMBER          7
+#define DIR_600_A1_GPIO_LED_WAN_GREEN          17
 
 #define DIR_600_A1_GPIO_BTN_RESET              8
 #define DIR_600_A1_GPIO_BTN_WPS                        12
@@ -81,6 +89,29 @@ static struct gpio_led dir_600_a1_leds_gpio[] __initdata = {
        }, {
                .name           = "d-link:amber:power",
                .gpio           = DIR_600_A1_GPIO_LED_POWER_AMBER,
+       }, {
+               .name           = "d-link:amber:wan",
+               .gpio           = DIR_600_A1_GPIO_LED_WAN_AMBER,
+       }, {
+               .name           = "d-link:green:wan",
+               .gpio           = DIR_600_A1_GPIO_LED_WAN_GREEN,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan1",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN1,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan2",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN2,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan3",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN3,
+               .active_low     = 1,
+       }, {
+               .name           = "d-link:green:lan4",
+               .gpio           = DIR_600_A1_GPIO_LED_LAN4,
+               .active_low     = 1,
        }, {
                .name           = "d-link:blue:wps",
                .gpio           = DIR_600_A1_GPIO_LED_WPS,
@@ -122,6 +153,12 @@ static void __init dir_600_a1_setup(void)
 
        ath79_register_m25p80(&dir_600_a1_flash_data);
 
+       ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
        ath79_register_leds_gpio(-1, ARRAY_SIZE(dir_600_a1_leds_gpio),
                                 dir_600_a1_leds_gpio);