[OpenWrt-Devel] [PATCH] [ar71xx] oolite: corrected directionality of button GPIOs

Brent Thomson brentthomson at gmail.com
Wed Jul 30 21:37:39 EDT 2014


The reset button on the GS-Oolite v1.0 was reversed. That is, it
registered `release' when first depressed and `press' when released.
This resulted in the device being sent back to factory defaults the
instant the button was depressed (because the `press' time was zero
and the resulting interval was longer than the factory reset timeout),
rather than only when the button is held for XX seconds and then
released. Buttons 6 & 7 were similarly inverted. Now they're not ;-)

Signed-off-by: Brent Thomson <brentthomson at gmail.com>

---
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
index 3d85f24..c6cb61c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
@@ -54,7 +54,7 @@ static struct gpio_keys_button gs_oolite_gpio_keys[]
__initdata = {
                .code           = KEY_RESTART,
                .debounce_interval = GS_OOLITE_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = GS_OOLITE_GPIO_BTN_RESET,
-               .active_low     = 1,
+               .active_low     = 0,
        },
        {
                .desc           = "BTN_6",
@@ -62,7 +62,7 @@ static struct gpio_keys_button gs_oolite_gpio_keys[]
__initdata = {
                .code           = BTN_6,
                .debounce_interval = GS_OOLITE_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = GS_OOLITE_GPIO_BTN6,
-               .active_low     = 1,
+               .active_low     = 0,
        },
        {
                .desc           = "BTN_7",
@@ -70,7 +70,7 @@ static struct gpio_keys_button gs_oolite_gpio_keys[]
__initdata = {
                .code           = BTN_7,
                .debounce_interval = GS_OOLITE_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = GS_OOLITE_GPIO_BTN7,
-               .active_low     = 1,
+               .active_low     = 0,
        },
 };
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list