diff mbox

[OpenWrt-Devel,ar71xx] mach-arduino-yun.c : Arduino Yun board 'WLAN RST' button support

Message ID CAA2RiuQgBAaQzKFSM=ejLoj3kJht=_A=ELqNUc+Gwys5nA0_Fg@mail.gmail.com
State Changes Requested
Headers show

Commit Message

Hirokazu MORIKAWA March 9, 2016, 12:47 a.m. UTC
This patch is a support for Arduino Yun board "WLAN RST" button.

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
---
 .../ar71xx/files/arch/mips/ath79/mach-arduino-yun.c | 21
+++++++++++++++++++++
 1 file changed, 21 insertions(+)

AR933X_GPIO_FUNC_I2S_MCK_EN, 0);

Comments

John Crispin March 9, 2016, 4:58 a.m. UTC | #1
Hi,

* do not send us HTML emails. patchwork wont pick them up properly and
they end up being line wrapped/whitespace broken
https://patchwork.ozlabs.org/patch/594794/
* do not use // comments but /* */, i will ask hauke to fix the rest of
the file
* the prefi is wrong. it should be ar71xx:

please fix and resend

	John

On 09/03/2016 01:47, Hirokazu MORIKAWA wrote:
> This patch is a support for Arduino Yun board "WLAN RST" button.
> 
> Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com
> <mailto:morikw2@gmail.com>>
> ---
>  .../ar71xx/files/arch/mips/ath79/mach-arduino-yun.c | 21
> +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> 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 d55d542..67a9d18 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);
> -- 
> 1.9.1
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
diff mbox

Patch

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 d55d542..67a9d18 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 |