This patch adds button support for WeIO board.
WeIO is the new AR9331 MIPS based board for Internet of Things.
Project web-site is: http://we-io.net/
From 3fb5d59d6ade5161d89983874568db50e32d6dac Mon Sep 17 00:00:00 2001
From: Drasko DRASKOVIC <[email protected]>
Date: Mon, 24 Mar 2014 00:10:33 +0100
Subject: [PATCH 3/5] weio: buttons - added WeIO button support
button: Soft reset button moved to GPIO23
---
target/linux/ar71xx/config-3.10 | 2 +-
.../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 22 +++++++++++++---------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index feac512..36576a2 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -39,7 +39,6 @@ CONFIG_ATH79_MACH_AW_NR580=y
CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
CONFIG_ATH79_MACH_CAP4200AG=y
CONFIG_ATH79_MACH_CARAMBOLA2=y
-CONFIG_ATH79_MACH_WEIO=y
CONFIG_ATH79_MACH_DB120=y
CONFIG_ATH79_MACH_DIR_505_A1=y
CONFIG_ATH79_MACH_DIR_600_A1=y
@@ -101,6 +100,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V9=y
CONFIG_ATH79_MACH_TL_WR941ND=y
CONFIG_ATH79_MACH_UBNT=y
CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_WEIO=y
CONFIG_ATH79_MACH_WHR_HP_G300N=y
CONFIG_ATH79_MACH_WLAE_AG300N=y
CONFIG_ATH79_MACH_WLR8100=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
index 3b5a40b..8317ee2 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
@@ -50,7 +50,7 @@
//#define WEIO_GPIO_LED_ETH0 13
#define WEIO_GPIO_BTN_AP 20
-#define WEIO_GPIO_BTN_RESET 15
+#define WEIO_GPIO_BTN_RESET 23
#define WEIO_KEYS_POLL_INTERVAL 20 /* msecs */
#define WEIO_KEYS_DEBOUNCE_INTERVAL (3 * WEIO_KEYS_POLL_INTERVAL)
@@ -65,10 +65,12 @@ static struct gpio_led weio_leds_gpio[] __initdata = {
.name = "weio:green:sta",
.gpio = WEIO_GPIO_LED_STA,
.active_low = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
}, {
.name = "weio:green:ap",
.gpio = WEIO_GPIO_LED_AP,
.active_low = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
}
};
@@ -76,15 +78,15 @@ static struct gpio_keys_button weio_gpio_keys[] __initdata = {
{
.desc = "ap button",
.type = EV_KEY,
- .code = KEY_WPS_BUTTON,
+ .code = BTN_0,
.debounce_interval = WEIO_KEYS_DEBOUNCE_INTERVAL,
.gpio = WEIO_GPIO_BTN_AP,
.active_low = 1,
},
{
- .desc = "reset button",
+ .desc = "soft-reset button",
.type = EV_KEY,
- .code = KEY_RESTART,
+ .code = BTN_1,
.debounce_interval = WEIO_KEYS_DEBOUNCE_INTERVAL,
.gpio = WEIO_GPIO_BTN_RESET,
.active_low = 1,
@@ -120,14 +122,16 @@ static void __init weio_setup(void)
{
weio_common_setup();
- 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_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+ AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+ AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+ AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+ AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
ath79_register_leds_gpio(-1, ARRAY_SIZE(weio_leds_gpio),
weio_leds_gpio);
+
ath79_register_gpio_keys_polled(-1, WEIO_KEYS_POLL_INTERVAL,
ARRAY_SIZE(weio_gpio_keys),
weio_gpio_keys);
--
1.8.5.3
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel