aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-05-08 12:24:11 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-05-08 12:24:11 +0000
commitaa970f13a37469839e3dab54437058e97da92a67 (patch)
tree0e9ebe2cf9f4d3eef05c6325d611825a1b726d62 /target/linux/ar71xx
parent17c78d12bd6b44f60f22a20541748e9c8ec42966 (diff)
downloadupstream-aa970f13a37469839e3dab54437058e97da92a67.tar.gz
upstream-aa970f13a37469839e3dab54437058e97da92a67.tar.bz2
upstream-aa970f13a37469839e3dab54437058e97da92a67.zip
ar71xx: add support for green LAN LEDS for wnr2000-v4
Signed-off-by: Michael J. Bazzinotti <mbazzinotti@gmail.com> SVN-Revision: 45637
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c
index 6718b16043..80044f45c0 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v4.c
@@ -33,10 +33,14 @@
#define WNR2000V4_GPIO_LED_WAN_GREEN 17
#define WNR2000V4_GPIO_LED_WPS 2
#define WNR2000V4_GPIO_LED_WLAN 12
-#define WNR2000V4_GPIO_LED_LAN1 18
-#define WNR2000V4_GPIO_LED_LAN2 19
-#define WNR2000V4_GPIO_LED_LAN3 20
-#define WNR2000V4_GPIO_LED_LAN4 21
+#define WNR2000V4_GPIO_LED_LAN1_GREEN 13
+#define WNR2000V4_GPIO_LED_LAN2_GREEN 14
+#define WNR2000V4_GPIO_LED_LAN3_GREEN 15
+#define WNR2000V4_GPIO_LED_LAN4_GREEN 16
+#define WNR2000V4_GPIO_LED_LAN1_AMBER 18
+#define WNR2000V4_GPIO_LED_LAN2_AMBER 19
+#define WNR2000V4_GPIO_LED_LAN3_AMBER 20
+#define WNR2000V4_GPIO_LED_LAN4_AMBER 21
#define STATUS_LED_GPIO 1
#define WNR2000V4_GPIO_LED_PWR_GREEN 0
@@ -76,21 +80,39 @@ static struct gpio_led wnr2000v4_leds_gpio[] __initdata = {
.gpio = WNR2000V4_GPIO_LED_WLAN,
.active_low = 1,
},
+ /* LAN LEDS */
+ {
+ .name = "netgear:green:lan1",
+ .gpio = WNR2000V4_GPIO_LED_LAN1_GREEN,
+ .active_low = 1,
+ }, {
+ .name = "netgear:green:lan2",
+ .gpio = WNR2000V4_GPIO_LED_LAN2_GREEN,
+ .active_low = 1,
+ }, {
+ .name = "netgear:green:lan3",
+ .gpio = WNR2000V4_GPIO_LED_LAN3_GREEN,
+ .active_low = 1,
+ }, {
+ .name = "netgear:green:lan4",
+ .gpio = WNR2000V4_GPIO_LED_LAN4_GREEN,
+ .active_low = 1,
+ },
{
.name = "netgear:amber:lan1",
- .gpio = WNR2000V4_GPIO_LED_LAN1,
+ .gpio = WNR2000V4_GPIO_LED_LAN1_AMBER,
.active_low = 1,
}, {
.name = "netgear:amber:lan2",
- .gpio = WNR2000V4_GPIO_LED_LAN2,
+ .gpio = WNR2000V4_GPIO_LED_LAN2_AMBER,
.active_low = 1,
}, {
.name = "netgear:amber:lan3",
- .gpio = WNR2000V4_GPIO_LED_LAN3,
+ .gpio = WNR2000V4_GPIO_LED_LAN3_AMBER,
.active_low = 1,
}, {
.name = "netgear:amber:lan4",
- .gpio = WNR2000V4_GPIO_LED_LAN4,
+ .gpio = WNR2000V4_GPIO_LED_LAN4_AMBER,
.active_low = 1,
}
};
@@ -155,8 +177,18 @@ static void __init wnr_common_setup(void)
static void __init wnr2000v4_setup(void)
{
+ int i;
+
wnr_common_setup();
+ /* Ensure no LED has an internal MUX signal, otherwise
+ control of LED could be lost... This is especially important
+ for most green LEDS (Eth,WAN).. who arrive in this function with
+ MUX signals set. */
+ for (i = 0; i < ARRAY_SIZE(wnr2000v4_leds_gpio); i++)
+ ath79_gpio_output_select(wnr2000v4_leds_gpio[i].gpio,
+ AR934X_GPIO_OUT_GPIO);
+
ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr2000v4_leds_gpio),
wnr2000v4_leds_gpio);