brcm47xx: fix button inversion for Asus WL-500W
[librecmc/librecmc.git] / target / linux / brcm47xx / patches-4.4 / 130-MIPS-bcm47xx-Fix-button-inversion-for-Asus-WL-500W.patch
1 From: Mirko Parthey <mirko.parthey@web.de>
2 Subject: [PATCH] MIPS: bcm47xx: Fix button inversion for Asus WL-500W
3
4 The Asus WL-500W buttons are active high,
5 but the software treats them as active low.
6 Fix the inverted logic.
7
8 Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
9 ---
10  arch/mips/bcm47xx/buttons.c | 10 ++++++++--
11  1 file changed, 8 insertions(+), 2 deletions(-)
12
13 --- a/arch/mips/bcm47xx/buttons.c
14 +++ b/arch/mips/bcm47xx/buttons.c
15 @@ -17,6 +17,12 @@
16                 .active_low     = 1,                                    \
17         }
18  
19 +#define BCM47XX_GPIO_KEY_H(_gpio, _code)                               \
20 +       {                                                               \
21 +               .code           = _code,                                \
22 +               .gpio           = _gpio,                                \
23 +       }
24 +
25  /* Asus */
26  
27  static const struct gpio_keys_button
28 @@ -85,8 +91,8 @@ bcm47xx_buttons_asus_wl500gpv2[] __initc
29  
30  static const struct gpio_keys_button
31  bcm47xx_buttons_asus_wl500w[] __initconst = {
32 -       BCM47XX_GPIO_KEY(6, KEY_RESTART),
33 -       BCM47XX_GPIO_KEY(7, KEY_WPS_BUTTON),
34 +       BCM47XX_GPIO_KEY_H(6, KEY_RESTART),
35 +       BCM47XX_GPIO_KEY_H(7, KEY_WPS_BUTTON),
36  };
37  
38  static const struct gpio_keys_button