aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-06-04 13:25:54 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-06-04 13:25:54 +0000
commit11706ba13e1373a8a05079f9081e4288affd3f9b (patch)
tree1df36b394fa683257e6a90b039e102c5db8ca370 /target
parentabb05a413a9551b42731e8fb435ff08fb7a4536d (diff)
downloadmaster-187ad058-11706ba13e1373a8a05079f9081e4288affd3f9b.tar.gz
master-187ad058-11706ba13e1373a8a05079f9081e4288affd3f9b.tar.bz2
master-187ad058-11706ba13e1373a8a05079f9081e4288affd3f9b.zip
ar71xx: add support for WIFI button on tp-link tl-mr3220v2
The TP-LINK TL-MR3220 v2 has a button on the left side labeled "WIFI". This is GPIO 24. This patch adds the support for this button. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36848 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c
index 7eb4d2fceb..851b7624ff 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c
@@ -34,6 +34,9 @@
#define TL_WR741NDV4_GPIO_LED_LAN4 17
#define TL_WR741NDV4_GPIO_LED_SYSTEM 27
+#define TL_MR3220V2_GPIO_BTN_WPS 11
+#define TL_MR3220V2_GPIO_BTN_WIFI 24
+
#define TL_MR3220V2_GPIO_LED_3G 26
#define TL_MR3220V2_GPIO_USB_POWER 8
@@ -99,7 +102,6 @@ static struct gpio_keys_button tl_wr741ndv4_gpio_keys[] __initdata = {
.gpio = TL_WR741NDV4_GPIO_BTN_RESET,
.active_low = 0,
}, {
- /* the WPS button is only present on the WR741ND v4 */
.desc = "WPS",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
@@ -109,6 +111,24 @@ static struct gpio_keys_button tl_wr741ndv4_gpio_keys[] __initdata = {
}
};
+static struct gpio_keys_button tl_mr3220v2_gpio_keys[] __initdata = {
+ {
+ .desc = "WPS",
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
+ .debounce_interval = TL_WR741NDV4_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_MR3220V2_GPIO_BTN_WPS,
+ .active_low = 0,
+ }, {
+ .desc = "WIFI button",
+ .type = EV_KEY,
+ .code = KEY_RFKILL,
+ .debounce_interval = TL_WR741NDV4_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_MR3220V2_GPIO_BTN_WIFI,
+ .active_low = 0,
+ }
+};
+
static void __init tl_ap121_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
@@ -159,8 +179,8 @@ static void __init tl_mr3220v2_setup(void)
ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr741ndv4_leds_gpio),
tl_wr741ndv4_leds_gpio);
ath79_register_gpio_keys_polled(1, TL_WR741NDV4_KEYS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wr741ndv4_gpio_keys) - 1,
- tl_wr741ndv4_gpio_keys);
+ ARRAY_SIZE(tl_mr3220v2_gpio_keys),
+ tl_mr3220v2_gpio_keys);
}
MIPS_MACHINE(ATH79_MACH_TL_MR3220_V2, "TL-MR3220-v2",