MIPS: bcm47xx: Fix button inversion for Asus WL-500W
diff mbox

Message ID .
State Accepted
Delegated to: James Hogan
Headers show

Commit Message

Mirko Parthey Feb. 15, 2017, 10:31 p.m. UTC
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 <>
---
 arch/mips/bcm47xx/buttons.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Rafał Miłecki Feb. 15, 2017, 10:36 p.m. UTC | #1
On 02/15/2017 11:31 PM, Mirko Parthey wrote:
> 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 <>

Acked-by: Rafał Miłecki <>
James Hogan Feb. 17, 2017, 11:25 a.m. UTC | #2
On Wed, Feb 15, 2017 at 11:31:30PM +0100, Mirko Parthey wrote:
> 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 <>

Applied (with fixes/stable tag for 3.14 onwards).

Thanks
James

Patch
diff mbox

diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c
index 7d582275908c..8a760d801895 100644
--- 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
@@ -79,8 +85,8 @@  bcm47xx_buttons_asus_wl500gpv2[] __initconst = {
 
 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