[LEDE-DEV] [PATCH] brcm47xx: fix button inversion for Asus WL-500W

Mirko Parthey mirko.parthey at web.de
Tue Feb 14 13:38:17 PST 2017


The Asus WL-500W buttons are active high,
but the software treats them as active low.
Fix the inverted logic.

Signed-off-by: Mirko Parthey <mirko.parthey at web.de>
---
 .../patches-4.4/330-asus-wl500w-buttons.patch      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 target/linux/brcm47xx/patches-4.4/330-asus-wl500w-buttons.patch

diff --git a/target/linux/brcm47xx/patches-4.4/330-asus-wl500w-buttons.patch b/target/linux/brcm47xx/patches-4.4/330-asus-wl500w-buttons.patch
new file mode 100644
index 000000000000..2d55a7bac26f
--- /dev/null
+++ b/target/linux/brcm47xx/patches-4.4/330-asus-wl500w-buttons.patch
@@ -0,0 +1,26 @@
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -17,6 +17,12 @@
+ 		.active_low	= 1,					\
+ 	}
+ 
++#define BCM47XX_GPIO_KEY_H(_gpio, _code)				\
++	{								\
++		.code		= _code,				\
++		.gpio		= _gpio,				\
++	}
++
+ /* Asus */
+ 
+ static const struct gpio_keys_button
+@@ -85,8 +91,8 @@ bcm47xx_buttons_asus_wl500gpv2[] __initc
+ 
+ static const struct gpio_keys_button
+ bcm47xx_buttons_asus_wl500w[] __initconst = {
+-	BCM47XX_GPIO_KEY(6, KEY_RESTART),
+-	BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY_H(6, KEY_RESTART),
++	BCM47XX_GPIO_KEY_H(7, KEY_WPS_BUTTON),
+ };
+ 
+ static const struct gpio_keys_button
-- 
2.1.4



More information about the Lede-dev mailing list