X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Ffiles%2Farch%2Fmips%2Fath79%2Fmach-tl-wax50re.c;h=cdb1f5a4d49711d377026fe0ae85952c57cefcef;hb=647f3fb9e22e63a02532add49a5c5427ee2d916b;hp=2f82f48fbb388a515e61c0a4a33cf69a5ef68874;hpb=71cbdfa7a11aba8372df8cceb86b75a0cd8cfd78;p=openwrt.git diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wax50re.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wax50re.c index 2f82f48fbb..cdb1f5a4d4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wax50re.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wax50re.c @@ -1,7 +1,9 @@ /* - * TP-LINK TL-WA750RE V1 / TP-LINK TL-WA850RE V1 board support + * TP-LINK TL-WA750RE v1/TL-WA801ND v2/TL-WA850RE v1/TL-WA901ND v3 + * board support * * Copyright (C) 2013 Martijn Zilverschoon + * Copyright (C) 2013 Jiri Pirko * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -31,6 +33,9 @@ #define TL_WAX50RE_GPIO_LED_SIGNAL4 3 #define TL_WAX50RE_GPIO_LED_SIGNAL5 4 +#define TL_WA801ND_V2_GPIO_LED_LAN 18 +#define TL_WA801ND_V2_GPIO_LED_SYSTEM 14 + #define TL_WAX50RE_GPIO_BTN_RESET 17 #define TL_WAX50RE_GPIO_BTN_WPS 16 @@ -137,6 +142,26 @@ static struct gpio_keys_button tl_wax50re_gpio_keys[] __initdata = { }, }; +static struct gpio_led tl_wa801nd_v2_leds_gpio[] __initdata = { + { + .name = "tp-link:green:lan", + .gpio = TL_WA801ND_V2_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "tp-link:green:wlan", + .gpio = TL_WAX50RE_GPIO_LED_WLAN, + .active_low = 1, + }, { + .name = "tp-link:green:qss", + .gpio = TL_WAX50RE_GPIO_LED_RE, + .active_low = 1, + }, { + .name = "tp-link:green:system", + .gpio = TL_WA801ND_V2_GPIO_LED_SYSTEM, + .active_low = 1, + }, +}; + static void __init tl_ap123_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); @@ -156,10 +181,6 @@ static void __init tl_ap123_setup(void) ath79_register_eth(0); ath79_register_wmac(ee, mac); - - ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wax50re_gpio_keys), - tl_wax50re_gpio_keys); } static void __init tl_wa750re_setup(void) @@ -167,17 +188,53 @@ static void __init tl_wa750re_setup(void) tl_ap123_setup(); ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa750re_leds_gpio), tl_wa750re_leds_gpio); + + ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wax50re_gpio_keys), + tl_wax50re_gpio_keys); } MIPS_MACHINE(ATH79_MACH_TL_WA750RE, "TL-WA750RE", "TP-LINK TL-WA750RE", tl_wa750re_setup); +static void __init tl_wa801nd_v2_setup(void) +{ + tl_ap123_setup(); + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa801nd_v2_leds_gpio), + tl_wa801nd_v2_leds_gpio); + + ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wax50re_gpio_keys), + tl_wax50re_gpio_keys); +} + +MIPS_MACHINE(ATH79_MACH_TL_WA801ND_V2, "TL-WA801ND-v2", "TP-LINK TL-WA801ND v2", + tl_wa801nd_v2_setup); + static void __init tl_wa850re_setup(void) { tl_ap123_setup(); ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa850re_leds_gpio), tl_wa850re_leds_gpio); + + ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wax50re_gpio_keys), + tl_wax50re_gpio_keys); } MIPS_MACHINE(ATH79_MACH_TL_WA850RE, "TL-WA850RE", "TP-LINK TL-WA850RE", tl_wa850re_setup); + +static void __init tl_wa901nd_v3_setup(void) +{ + tl_ap123_setup(); + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa801nd_v2_leds_gpio), + tl_wa801nd_v2_leds_gpio); + + ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wax50re_gpio_keys) - 1, + tl_wax50re_gpio_keys); +} + +MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V3, "TL-WA901ND-v3", "TP-LINK TL-WA901ND v3", + tl_wa901nd_v3_setup);