linux-mips
[Top] [All Lists]

[PATCH 4.4 02/91] MIPS: BCM47XX: Fix button inversion for Asus WL-500W

To: linux-kernel@vger.kernel.org
Subject: [PATCH 4.4 02/91] MIPS: BCM47XX: Fix button inversion for Asus WL-500W
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 10 Mar 2017 10:08:01 +0100
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Mirko Parthey <mirko.parthey@web.de>, Rafał Miłecki <rafal@milecki.pl>, Hauke Mehrtens <hauke@hauke-m.de>, linux-mips@linux-mips.org, James Hogan <james.hogan@imgtec.com>
In-reply-to: <20170310083900.730556986@linuxfoundation.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20170310083900.730556986@linuxfoundation.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: quilt/0.65
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mirko Parthey <mirko.parthey@web.de>

commit bdfdaf1a016ef09cb941f2edad485a713510b8d5 upstream.

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

Fixes: 3be972556fa1 ("MIPS: BCM47XX: Import buttons database from OpenWrt")
Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15295/
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/bcm47xx/buttons.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- 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[] __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



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 4.4 02/91] MIPS: BCM47XX: Fix button inversion for Asus WL-500W, Greg Kroah-Hartman <=