aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-03-10 19:11:13 +0000
committerJohn Crispin <blogic@openwrt.org>2016-03-10 19:11:13 +0000
commit860e96a71325377d7d30702aee534e14d10ba649 (patch)
treecf9a52c4e836c56e028d80034ada1214471cb93f /target/linux/ar71xx
parent76c7acee0b183dfa17f179869e46f058f3435460 (diff)
downloadmaster-187ad058-860e96a71325377d7d30702aee534e14d10ba649.tar.gz
master-187ad058-860e96a71325377d7d30702aee534e14d10ba649.tar.bz2
master-187ad058-860e96a71325377d7d30702aee534e14d10ba649.zip
ar71xx: Arduino Yun board 'WLAN RST' button support
This patch adds support for Arduino Yun board "WLAN RST" button. Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48983 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c
index d55d542c99..5873248edf 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c
@@ -60,6 +60,17 @@ static struct gpio_led ds_leds_gpio[] __initdata = {
},
};
+static struct gpio_keys_button ds_gpio_keys[] __initdata = {
+ {
+ .desc = "configuration button",
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
+ .debounce_interval = DS_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = DS_GPIO_CONF_BTN,
+ .active_low = 1,
+ },
+};
+
static void __init ds_common_setup(void)
{
static u8 mac[6];
@@ -97,8 +108,18 @@ static void __init ds_setup(void)
ath79_register_leds_gpio(-1, ARRAY_SIZE(ds_leds_gpio),
ds_leds_gpio);
+ ath79_register_gpio_keys_polled(-1, DS_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ds_gpio_keys),
+ ds_gpio_keys);
ath79_register_usb();
+ /* use the swtich_led directly form sysfs */
+ 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);
+
//Disable the Function for some pins to have GPIO functionality active
// GPIO6-7-8 and GPIO11
ath79_gpio_function_setup(AR933X_GPIO_FUNC_JTAG_DISABLE | AR933X_GPIO_FUNC_I2S_MCK_EN, 0);