ramips: use gpio-keys-polled instead of gpio-buttons
authorGabor Juhos <juhosg@openwrt.org>
Sat, 11 Feb 2012 19:37:06 +0000 (19:37 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 11 Feb 2012 19:37:06 +0000 (19:37 +0000)
SVN-Revision: 30461

27 files changed:
target/linux/ramips/Makefile
target/linux/ramips/files/arch/mips/include/asm/mach-ralink/dev-gpio-buttons.h
target/linux/ramips/files/arch/mips/ralink/common/dev-gpio-buttons.c
target/linux/ramips/files/arch/mips/ralink/rt288x/mach-f5d8235-v1.c
target/linux/ramips/files/arch/mips/ralink/rt288x/mach-rt-n15.c
target/linux/ramips/files/arch/mips/ralink/rt288x/mach-wli-tx4-ag300n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-all0256n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-argus-atp52b.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-bc2.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-300-revb.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-esr-9753.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-fonera20n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-hw550-3g.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-mofi3500-3gn.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-nbg-419n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-nw718.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-pwh2004.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-rt-g32-revb.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-v22rw-2x2.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-w502u.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wcr150gn.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-whr-g300n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl341v3.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl351.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wr512-3gn.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wr6202.c

index c9dc086ee9c8d65fd6fe11481a6a0173de620d38..16fc2c6caafb6ac2d0a5c14a244cb32abf9a7c6a 100644 (file)
@@ -17,8 +17,9 @@ LINUX_VERSION:=2.6.39.4
 
 include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES+=\
-       kmod-leds-gpio kmod-input-core kmod-input-polldev kmod-input-gpio-buttons \
-       kmod-button-hotplug kmod-rt2800-pci wpad-mini maccalc
+       kmod-leds-gpio kmod-input-core kmod-input-polldev \
+       kmod-input-gpio-keys-polled kmod-button-hotplug \
+       kmod-rt2800-pci wpad-mini maccalc
 
 define Target/Description
        Build firmware images for Ralink RT288x/RT305x based boards.
index d223737e0990d8e0f86803562a6769efba250694..8eb5e16906582e19cff286d59ed37e3523737628 100644 (file)
 #define __ASM_MACH_RALINK_DEV_GPIO_BUTTONS_H
 
 #include <linux/input.h>
-#include <linux/gpio_buttons.h>
+#include <linux/gpio_keys.h>
 
 #ifdef CONFIG_RALINK_DEV_GPIO_BUTTONS
-void ramips_register_gpio_buttons(int id,
-                                 unsigned poll_interval,
-                                 unsigned nbuttons,
-                                 struct gpio_button *buttons);
+void
+ramips_register_gpio_buttons(int id, unsigned poll_interval, unsigned nbuttons,
+                            struct gpio_keys_button *buttons);
 #else
-static inline void ramips_register_gpio_buttons(int id,
-                                               unsigned poll_interval,
-                                               unsigned nbuttons,
-                                               struct gpio_button *buttons)
+static inline void
+ramips_register_gpio_buttons(int id, unsigned poll_interval, unsigned nbuttons,
+                            struct gpio_keys_button *buttons)
 {
 }
 #endif
index 4d936d05c24743c1059923388f58de81272fe80f..75a2a17143bfd3c4a58edbf87883104fa1cd9b64 100644 (file)
 void __init ramips_register_gpio_buttons(int id,
                                         unsigned poll_interval,
                                         unsigned nbuttons,
-                                        struct gpio_button *buttons)
+                                        struct gpio_keys_button *buttons)
 {
        struct platform_device *pdev;
-       struct gpio_buttons_platform_data pdata;
-       struct gpio_button *p;
+       struct gpio_keys_platform_data pdata;
+       struct gpio_keys_button *p;
        int err;
 
        p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
@@ -30,7 +30,7 @@ void __init ramips_register_gpio_buttons(int id,
 
        memcpy(p, buttons, nbuttons * sizeof(*p));
 
-       pdev = platform_device_alloc("gpio-buttons", id);
+       pdev = platform_device_alloc("gpio-keys-polled", id);
        if (!pdev)
                goto err_free_buttons;
 
@@ -43,7 +43,6 @@ void __init ramips_register_gpio_buttons(int id,
        if (err)
                goto err_put_pdev;
 
-
        err = platform_device_add(pdev);
        if (err)
                goto err_put_pdev;
index 71c84c14671bce67c37f9c8ad696a709f710a50e..850dc4bd7dd6bbc1c1dd9b8b49783d589027cd26 100644 (file)
@@ -35,7 +35,8 @@
 #define F5D8235_GPIO_BUTTON_WPS                0
 #define F5D8235_GPIO_BUTTON_RESET      9
 
-#define F5D8235_BUTTONS_POLL_INTERVAL  20
+#define F5D8235_KEYS_POLL_INTERVAL     20
+#define F5D8235_KEYS_DEBOUNCE_INTERVAL (3 * F5D8235_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition f5d8235_partitions[] = {
        {
@@ -92,19 +93,19 @@ static struct gpio_led f5d8235_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button f5d8235_gpio_buttons[] __initdata = {
+static struct gpio_keys_button f5d8235_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = F5D8235_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = F5D8235_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = F5D8235_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = F5D8235_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -121,7 +122,7 @@ static void __init f5d8235_init(void)
        ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235_leds_gpio),
                                  f5d8235_leds_gpio);
 
-       ramips_register_gpio_buttons(-1, F5D8235_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, F5D8235_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(f5d8235_gpio_buttons),
                                     f5d8235_gpio_buttons);
 
index 0818f2c23316d7e89056321a42fc5cf453758ddb..dcffec0006cf3cf9d613cc60eea58ab06ded8bc9 100644 (file)
@@ -32,7 +32,8 @@
 #define RT_N15_GPIO_RTL8366_SCK                2
 #define RT_N15_GPIO_RTL8366_SDA                1
 
-#define RT_N15_BUTTONS_POLL_INTERVAL   20
+#define RT_N15_KEYS_POLL_INTERVAL      20
+#define RT_N15_KEYS_DEBOUNCE_INTERVAL  (3 * RT_N15_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition rt_n15_partitions[] = {
        {
@@ -78,19 +79,19 @@ static struct gpio_led rt_n15_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button rt_n15_gpio_buttons[] __initdata = {
+static struct gpio_keys_button rt_n15_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = RT_N15_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = RT_N15_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = RT_N15_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = RT_N15_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -118,7 +119,7 @@ static void __init rt_n15_init(void)
        ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n15_leds_gpio),
                                  rt_n15_leds_gpio);
 
-       ramips_register_gpio_buttons(-1, RT_N15_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, RT_N15_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(rt_n15_gpio_buttons),
                                     rt_n15_gpio_buttons);
 
index 03c4adf31b882fc41e56cdf51f8b596750b9eba7..a9f0de4d86f26d7cf100483f6205e9b4dfd79b44 100644 (file)
@@ -32,7 +32,8 @@
 #define WLI_TX4_AG300N_GPIO_BUTTON_BW_SWITCH   8
 #define WLI_TX4_AG300N_GPIO_BUTTON_RESET       9
 
-#define WLI_TX4_AG300N_BUTTONS_POLL_INTERVAL   20
+#define WLI_TX4_AG300N_KEYS_POLL_INTERVAL      20
+#define WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL  (3 * WLI_TX4_AG300N_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition wli_tx4_ag300n_partitions[] = {
        {
@@ -98,12 +99,12 @@ static struct gpio_led wli_tx4_ag300n_leds_gpio[] __initdata = {
        },
 };
 
-static struct gpio_button wli_tx4_ag300n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wli_tx4_ag300n_gpio_buttons[] __initdata = {
        {
                .desc           = "Reset button",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WLI_TX4_AG300N_GPIO_BUTTON_RESET,
                .active_low     = 1,
        },
@@ -111,7 +112,7 @@ static struct gpio_button wli_tx4_ag300n_gpio_buttons[] __initdata = {
                .desc           = "AOSS button",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WLI_TX4_AG300N_GPIO_BUTTON_AOSS,
                .active_low     = 1,
        },
@@ -119,7 +120,7 @@ static struct gpio_button wli_tx4_ag300n_gpio_buttons[] __initdata = {
                .desc           = "Bandwidth switch",
                .type           = EV_KEY,
                .code           = BTN_0,
-               .threshold      = 3,
+               .debounce_interval = WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WLI_TX4_AG300N_GPIO_BUTTON_BW_SWITCH,
                .active_low     = 0,
        },
@@ -131,7 +132,7 @@ static void __init wli_tx4_ag300n_init(void)
 
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wli_tx4_ag300n_leds_gpio),
                                  wli_tx4_ag300n_leds_gpio);
-       ramips_register_gpio_buttons(-1, WLI_TX4_AG300N_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WLI_TX4_AG300N_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(wli_tx4_ag300n_gpio_buttons),
                                     wli_tx4_ag300n_gpio_buttons);
 
index 3a53e16d075dd4f2d3262a03b35dcfbcb9d84a2d..cd25c4345b14f5191e14e339bf5d0bf3a5918de7 100644 (file)
@@ -28,7 +28,8 @@
 #define ALL0256N_GPIO_LED_RSSI_LOW 14
 #define ALL0256N_GPIO_LED_RSSI_MED 12
 #define ALL0256N_GPIO_LED_RSSI_HIGH 13
-#define ALL0256N_BUTTONS_POLL_INTERVAL 20
+#define ALL0256N_KEYS_POLL_INTERVAL 20
+#define ALL0256N_KEYS_DEBOUNCE_INTERVAL        (3 * ALL0256N_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition all0256n_partitions[] = {
        {
@@ -76,12 +77,12 @@ struct spi_board_info all0256n_spi_slave_info[] __initdata = {
        },
 };
 
-static struct gpio_button all0256n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button all0256n_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = ALL0256N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = ALL0256N_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }
@@ -112,7 +113,7 @@ static void __init all0256n_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(all0256n_leds_gpio),
                                  all0256n_leds_gpio);
-       ramips_register_gpio_buttons(-1, ALL0256N_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, ALL0256N_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(all0256n_gpio_buttons),
                                     all0256n_gpio_buttons);
        rt305x_register_wifi();
index d1c51702939bd737f2cbdcf58be5370d32c68d67..00832f13bb18fbf2f42292f54e8071b0a046d0fc 100644 (file)
@@ -27,7 +27,8 @@
 #define ARGUS_ATP52B_GPIO_LED_NET              13
 #define ARGUS_ATP52B_GPIO_BUTTON_WPS           0
 #define ARGUS_ATP52B_GPIO_BUTTON_RESET         10
-#define ARGUS_ATP52B_BUTTONS_POLL_INTERVAL     20
+#define ARGUS_ATP52B_KEYS_POLL_INTERVAL                20
+#define ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL    (3 * ARGUS_ATP52B_KEYS_POLL_INTERVAL)
 
 static struct gpio_led argus_atp52b_leds_gpio[] __initdata = {
        {
@@ -42,12 +43,12 @@ static struct gpio_led argus_atp52b_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button argus_atp52b_gpio_buttons[] __initdata = {
+static struct gpio_keys_button argus_atp52b_gpio_buttons[] __initdata = {
        {
                .desc       = "wps",
                .type       = EV_KEY,
                .code       = KEY_WPS_BUTTON,
-               .threshold  = 3,
+               .debounce_interval = ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL,
                .gpio       = ARGUS_ATP52B_GPIO_BUTTON_WPS,
                .active_low = 1,
        },
@@ -55,7 +56,7 @@ static struct gpio_button argus_atp52b_gpio_buttons[] __initdata = {
                .desc       = "reset",
                .type       = EV_KEY,
                .code       = KEY_RESTART,
-               .threshold  = 10,
+               .debounce_interval = ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL,
                .gpio       = ARGUS_ATP52B_GPIO_BUTTON_RESET,
                .active_low = 1,
        }
@@ -99,7 +100,7 @@ static void __init argus_atp52b_init(void)
        rt305x_register_flash(0, &argus_atp52b_flash_data);
        ramips_register_gpio_leds(-1, ARRAY_SIZE(argus_atp52b_leds_gpio),
                                        argus_atp52b_leds_gpio);
-       ramips_register_gpio_buttons(-1, ARGUS_ATP52B_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, ARGUS_ATP52B_KEYS_POLL_INTERVAL,
                                        ARRAY_SIZE(argus_atp52b_gpio_buttons),
                                        argus_atp52b_gpio_buttons);
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
index bb225c1f1cc2dc2f9e0428635e787d1c8c43fd1c..4b03b776c7e2a4c5486b1122a2c0f7a1d85f7a51 100644 (file)
@@ -25,7 +25,8 @@
 #define BC2_GPIO_BUTTON_RESET          17
 #define BC2_GPIO_LED_USB               20
 
-#define BC2_BUTTONS_POLL_INTERVAL      20
+#define BC2_KEYS_POLL_INTERVAL         20
+#define BC2_KEYS_DEBOUNCE_INTERVAL     (3 * BC2_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition bc2_partitions[] = {
        {
@@ -71,12 +72,12 @@ static struct gpio_led bc2_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button bc2_gpio_buttons[] __initdata = {
+static struct gpio_keys_button bc2_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = BC2_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = BC2_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }
@@ -93,7 +94,7 @@ static void __init bc2_init(void)
        ramips_register_gpio_leds(-1, ARRAY_SIZE(bc2_leds_gpio),
                                  bc2_leds_gpio);
 
-       ramips_register_gpio_buttons(-1, BC2_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, BC2_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(bc2_gpio_buttons),
                                     bc2_gpio_buttons);
 
index 70a2245b8dba82c3371c5d69eac79dd32ba9cf77..b84d9ed9f4a8e3330cdbd472956e7ac1e1ef5a10 100644 (file)
@@ -29,7 +29,8 @@
 #define DIR_300B_GPIO_BUTTON_WPS       0       /* active low */
 #define DIR_300B_GPIO_BUTTON_RESET     10      /* active low */
 
-#define DIR_300B_BUTTONS_POLL_INTERVAL 20
+#define DIR_300B_KEYS_POLL_INTERVAL    20
+#define DIR_300B_KEYS_DEBOUNCE_INTERVAL        (3 * DIR_300B_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition dir_300b_partitions[] = {
        {
@@ -83,19 +84,19 @@ static struct gpio_led dir_300b_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button dir_300b_gpio_buttons[] __initdata = {
+static struct gpio_keys_button dir_300b_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = DIR_300B_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = DIR_300B_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = DIR_300B_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = DIR_300B_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -110,7 +111,7 @@ static void __init dir_300b_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_300b_leds_gpio),
                                  dir_300b_leds_gpio);
-       ramips_register_gpio_buttons(-1, DIR_300B_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, DIR_300B_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(dir_300b_gpio_buttons),
                                     dir_300b_gpio_buttons);
        rt305x_register_wifi();
index fb3b7c8d66221fb3a321c23367a981543b944764..371487a2172fef2efca293a184bbf2550d9ee31c 100644 (file)
@@ -28,7 +28,8 @@
 #define ESR_9753_GPIO_BUTTON_WPS       0       /* active low */
 #define ESR_9753_GPIO_BUTTON_RESET     10      /* active low */
 
-#define ESR_9753_BUTTONS_POLL_INTERVAL 20
+#define ESR_9753_KEYS_POLL_INTERVAL    20
+#define ESR_9753_KEYS_DEBOUNCE_INTERVAL        (3 * ESR_9753_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition esr_9753_partitions[] = {
        {
@@ -78,19 +79,19 @@ static struct gpio_led esr_9753_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button esr_9753_gpio_buttons[] __initdata = {
+static struct gpio_keys_button esr_9753_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = ESR_9753_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = ESR_9753_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = ESR_9753_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = ESR_9753_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -105,7 +106,7 @@ static void __init esr_9753_init(void)
        ramips_register_gpio_leds(-1, ARRAY_SIZE(esr_9753_leds_gpio),
                                  esr_9753_leds_gpio);
 
-       ramips_register_gpio_buttons(-1, ESR_9753_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, ESR_9753_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(esr_9753_gpio_buttons),
                                     esr_9753_gpio_buttons);
 
index 2157ca7a7cb8fd3c7273d6d92f249f80818bd8c8..5955f6391800ad577879abdefc2c6e5f9ee45409 100644 (file)
@@ -29,7 +29,8 @@
 #define FONERA20N_GPIO_LED_POWER       9
 #define FONERA20N_GPIO_LED_USB         14
 
-#define FONERA20N_BUTTONS_POLL_INTERVAL        20
+#define FONERA20N_KEYS_POLL_INTERVAL   20
+#define FONERA20N_KEYS_DEBOUNCE_INTERVAL (3 * FONERA20N_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition fonera20n_partitions[] = {
        {
@@ -83,19 +84,19 @@ static struct gpio_led fonera20n_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button fonera20n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button fonera20n_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = FONERA20N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = FONERA20N_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "switch",
                .type           = EV_KEY,
                .code           = BTN_1,
-               .threshold      = 3,
+               .debounce_interval = FONERA20N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = FONERA20N_GPIO_SWITCH,
                .active_low     = 1,
        }
@@ -110,7 +111,7 @@ static void __init fonera20n_init(void)
        ramips_register_gpio_leds(-1, ARRAY_SIZE(fonera20n_leds_gpio),
                                  fonera20n_leds_gpio);
 
-       ramips_register_gpio_buttons(-1, FONERA20N_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, FONERA20N_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(fonera20n_gpio_buttons),
                                     fonera20n_gpio_buttons);
 
index 21587812c46efa82becc432985794d27f37b5a9c..08ee40a9148d85310e8bcca117ddd111142691af 100644 (file)
@@ -31,7 +31,8 @@
 #define HW550_3G_GPIO_BUTTON_CONNECT   7
 #define HW550_3G_GPIO_BUTTON_WPS       0
 
-#define HW550_3G_BUTTONS_POLL_INTERVAL 20
+#define HW550_3G_KEYS_POLL_INTERVAL    20
+#define HW550_3G_KEYS_DEBOUNCE_INTERVAL        (3 * HW550_3G_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition hw550_3g_partitions[] = {
        {
@@ -89,26 +90,26 @@ static struct gpio_led hw550_3g_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button hw550_3g_gpio_buttons[] __initdata = {
+static struct gpio_keys_button hw550_3g_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = HW550_3G_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = HW550_3G_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "connect",
                .type           = EV_KEY,
                .code           = KEY_CONNECT,
-               .threshold      = 3,
+               .debounce_interval = HW550_3G_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = HW550_3G_GPIO_BUTTON_CONNECT,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = HW550_3G_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = HW550_3G_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -127,7 +128,7 @@ static void __init hw550_3g_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(hw550_3g_leds_gpio),
                                  hw550_3g_leds_gpio);
-       ramips_register_gpio_buttons(-1, HW550_3G_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, HW550_3G_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(hw550_3g_gpio_buttons),
                                     hw550_3g_gpio_buttons);
        rt305x_register_wifi();
index e3273ba70e0fe501e672f6eb63118e78842c1cb4..fa046df9fe21a336ccc94b8c25d0107b4332dd91 100644 (file)
@@ -31,7 +31,8 @@
 #define MOFI3500_3GN_GPIO_BUTTON_CONNECT       7
 #define MOFI3500_3GN_GPIO_BUTTON_WPS           0
 
-#define MOFI3500_3GN_BUTTONS_POLL_INTERVAL     20
+#define MOFI3500_3GN_KEYS_POLL_INTERVAL                20
+#define MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL    (3 * MOFI3500_3GN_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition mofi3500_3gn_partitions[] = {
        {
@@ -89,26 +90,26 @@ static struct gpio_led mofi3500_3gn_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button mofi3500_3gn_gpio_buttons[] __initdata = {
+static struct gpio_keys_button mofi3500_3gn_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = MOFI3500_3GN_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "connect",
                .type           = EV_KEY,
                .code           = KEY_CONNECT,
-               .threshold      = 3,
+               .debounce_interval = MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = MOFI3500_3GN_GPIO_BUTTON_CONNECT,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = MOFI3500_3GN_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -127,7 +128,7 @@ static void __init mofi3500_3gn_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(mofi3500_3gn_leds_gpio),
                                  mofi3500_3gn_leds_gpio);
-       ramips_register_gpio_buttons(-1, MOFI3500_3GN_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, MOFI3500_3GN_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(mofi3500_3gn_gpio_buttons),
                                     mofi3500_3gn_gpio_buttons);
        rt305x_register_wifi();
index 63071da656b7454a5f75307cc3a8c49a4954d279..afe51d71e8201413b18404355552dba29654c42f 100644 (file)
@@ -28,7 +28,8 @@
 #define NBG_419N_GPIO_BUTTON_WPS       0       /* active low */
 #define NBG_419N_GPIO_BUTTON_RESET     10      /* active low */
 
-#define NBG_419N_BUTTONS_POLL_INTERVAL 20
+#define NBG_419N_KEYS_POLL_INTERVAL    20
+#define NBG_419N_KEYS_DEBOUNCE_INTERVAL        (3 * NBG_419N_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition nbg_419n_partitions[] = {
        {
@@ -70,19 +71,19 @@ static struct gpio_led nbg_419n_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button nbg_419n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button nbg_419n_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = NBG_419N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = NBG_419N_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = NBG_419N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = NBG_419N_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -97,7 +98,7 @@ static void __init nbg_419n_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(nbg_419n_leds_gpio),
                                  nbg_419n_leds_gpio);
-       ramips_register_gpio_buttons(-1, NBG_419N_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, NBG_419N_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(nbg_419n_gpio_buttons),
                                     nbg_419n_gpio_buttons);
        rt305x_register_wifi();
index 917357ec12fed6bbc81a39ceecd6270462b2a039..a287bc63ff0fd27a5e538600b680c3e9687e455b 100644 (file)
@@ -32,7 +32,8 @@
 
 #define NW718_GPIO_SPI_CS0             3
 
-#define NW718_BUTTONS_POLL_INTERVAL    20
+#define NW718_KEYS_POLL_INTERVAL       20
+#define NW718_KEYS_DEBOUNCE_INTERVAL   (3 * NW718_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition nw718_partitions[] = {
        {
@@ -86,19 +87,19 @@ static struct gpio_led nw718_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button nw718_gpio_buttons[] __initdata = {
+static struct gpio_keys_button nw718_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = NW718_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = NW718_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = NW718_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = NW718_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -124,7 +125,7 @@ static void __init nw718_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(nw718_leds_gpio),
                                  nw718_leds_gpio);
-       ramips_register_gpio_buttons(-1, NW718_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, NW718_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(nw718_gpio_buttons),
                                     nw718_gpio_buttons);
        rt305x_register_wifi();
index a6c1a163a36a518bee142b8ae7c4f5e4e549dd55..149609956af2e72eea10ff7a6b66d85726cc3f89 100644 (file)
@@ -25,7 +25,8 @@
 
 #define OMNI_EMB_GPIO_BUTTON_RESET     12 /* active low */
 
-#define OMNI_EMB_BUTTONS_POLL_INTERVAL 20
+#define OMNI_EMB_KEYS_POLL_INTERVAL    20
+#define OMNI_EMB_KEYS_DEBOUNCE_INTERVAL        (3 * OMNI_EMB_KEYS_POLL_INTERVAL)
 
 #define OMNI_EMB_GPIO_LED_STATUS       9
 #define OMNI_EMB_GPIO_LED_WLAN         14
@@ -77,12 +78,12 @@ static struct gpio_led omni_emb_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button omni_emb_gpio_buttons[] __initdata = {
+static struct gpio_keys_button omni_emb_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = OMNI_EMB_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = OMNI_EMB_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }
@@ -96,7 +97,7 @@ static void __init omni_emb_init(void)
 
        ramips_register_gpio_leds(-1, ARRAY_SIZE(omni_emb_leds_gpio),
                                omni_emb_leds_gpio);
-       ramips_register_gpio_buttons(-1, OMNI_EMB_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, OMNI_EMB_KEYS_POLL_INTERVAL,
                                ARRAY_SIZE(omni_emb_gpio_buttons),
                                omni_emb_gpio_buttons);
 
index 4eb1f4b99eb10587707407c342e7a9749dff35f0..dc02f49638fd58e99272f51d2ac66843323fa01e 100644 (file)
@@ -25,7 +25,8 @@
 #define PWH2004_GPIO_BUTTON_WPS                12
 #define PWH2004_GPIO_LED_POWER         9
 #define PWH2004_GPIO_LED_WIFI          14
-#define PWH2004_BUTTONS_POLL_INTERVAL  20
+#define PWH2004_KEYS_POLL_INTERVAL     20
+#define PWH2004_KEYS_DEBOUNCE_INTERVAL (3 * PWH2004_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition pwh2004_partitions[] = {
        {
@@ -71,12 +72,12 @@ static struct gpio_led pwh2004_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button pwh2004_gpio_buttons[] __initdata = {
+static struct gpio_keys_button pwh2004_gpio_buttons[] __initdata = {
        {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = PWH2004_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = PWH2004_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -88,7 +89,7 @@ static void __init pwh2004_init(void)
        rt305x_register_flash(0, &pwh2004_flash_data);
        ramips_register_gpio_leds(-1, ARRAY_SIZE(pwh2004_leds_gpio),
                                  pwh2004_leds_gpio);
-       ramips_register_gpio_buttons(-1, PWH2004_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, PWH2004_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(pwh2004_gpio_buttons),
                                     pwh2004_gpio_buttons);
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
index 6963c1744e18a1e3b776dfade7f36a0830dd497d..2359f2a40d1ebde121eaf7164bd8beb2cc6baf00 100644 (file)
@@ -25,7 +25,8 @@
 #define RT_G32B_GPIO_BUTTON_WPS                0       /* active low */
 #define RT_G32B_GPIO_BUTTON_RESET      10      /* active low */
 
-#define RT_G32B_BUTTONS_POLL_INTERVAL  20
+#define RT_G32B_KEYS_POLL_INTERVAL     20
+#define RT_G32B_KEYS_DEBOUNCE_INTERVAL (3 * RT_G32B_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition rt_g32b_partitions[] = {
        {
@@ -75,19 +76,19 @@ struct spi_board_info __initdata rt_g32b_spi_slave_info[] = {
        },
 };
 
-static struct gpio_button rt_g32b_gpio_buttons[] __initdata = {
+static struct gpio_keys_button rt_g32b_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = RT_G32B_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = RT_G32B_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = RT_G32B_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = RT_G32B_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -101,7 +102,7 @@ static void __init rt_g32b_init(void)
 
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
-       ramips_register_gpio_buttons(-1, RT_G32B_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, RT_G32B_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(rt_g32b_gpio_buttons),
                                     rt_g32b_gpio_buttons);
        rt305x_register_wifi();
index 6dee249440656c0745e88660bd539353d8908567..acef9780718b1060de122235dbe11c2428f24e46 100644 (file)
@@ -27,7 +27,8 @@
 #define V22RW_2X2_GPIO_LED_SECURITY    13
 #define V22RW_2X2_GPIO_LED_WPS         14
 
-#define V22RW_2X2_BUTTONS_POLL_INTERVAL        20
+#define V22RW_2X2_KEYS_POLL_INTERVAL   20
+#define V22RW_2X2_KEYS_DEBOUNCE_INTERVAL (3 * V22RW_2X2_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition v22rw_2x2_partitions[] = {
        {
@@ -77,19 +78,19 @@ static struct gpio_led v22rw_2x2_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button v22rw_2x2_gpio_buttons[] __initdata = {
+static struct gpio_keys_button v22rw_2x2_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = V22RW_2X2_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = V22RW_2X2_GPIO_BUTTON_SWRST,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = V22RW_2X2_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = V22RW_2X2_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -104,7 +105,7 @@ static void __init v22rw_2x2_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(v22rw_2x2_leds_gpio),
                                  v22rw_2x2_leds_gpio);
-       ramips_register_gpio_buttons(-1, V22RW_2X2_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, V22RW_2X2_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(v22rw_2x2_gpio_buttons),
                                     v22rw_2x2_gpio_buttons);
        rt305x_register_wifi();
index b2140265958dec67bfc5fb8f049c7ad8ca1bfc07..390388b1ce604e15ab63ac9e8e146ab76aa909f8 100644 (file)
@@ -28,7 +28,8 @@
 #define W502U_GPIO_BUTTON_WPS          0
 #define W502U_GPIO_BUTTON_RESET                10
 
-#define W502U_BUTTONS_POLL_INTERVAL    20
+#define W502U_KEYS_POLL_INTERVAL       20
+#define W502U_KEYS_DEBOUNCE_INTERVAL   (3 * W502U_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition w502u_partitions[] = {
        {
@@ -84,12 +85,12 @@ static struct gpio_led w502u_leds_gpio[] __initdata = {
        },
 };
 
-static struct gpio_button w502u_gpio_buttons[] __initdata = {
+static struct gpio_keys_button w502u_gpio_buttons[] __initdata = {
        {
                .desc           = "Reset button",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = W502U_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = W502U_GPIO_BUTTON_RESET,
                .active_low     = 1,
        },
@@ -97,7 +98,7 @@ static struct gpio_button w502u_gpio_buttons[] __initdata = {
                .desc           = "WPS button",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = W502U_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = W502U_GPIO_BUTTON_WPS,
                .active_low     = 1,
        },
@@ -113,7 +114,7 @@ static void __init w502u_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(w502u_leds_gpio),
                                  w502u_leds_gpio);
-       ramips_register_gpio_buttons(-1, W502U_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, W502U_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(w502u_gpio_buttons),
                                     w502u_gpio_buttons);
        rt305x_register_wifi();
index 8e3ed733a27ad84bea5d2045c3916ffcf4c8a26e..96a449527fc4f815fd2bb5b683dd37738fc79cad 100644 (file)
@@ -26,7 +26,8 @@
 #define WCR150GN_GPIO_LED_POWER                        8
 #define WCR150GN_GPIO_BUTTON_WPS               10
 #define WCR150GN_GPIO_BUTTON_RESET             0
-#define WCR150GN_BUTTONS_POLL_INTERVAL         20
+#define WCR150GN_KEYS_POLL_INTERVAL    20
+#define WCR150GN_KEYS_DEBOUNCE_INTERVAL        (3 * WCR150GN_KEYS_POLL_INTERVAL)
 
 static struct gpio_led wcr150gn_leds_gpio[] __initdata = {
        {
@@ -41,12 +42,12 @@ static struct gpio_led wcr150gn_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button wcr150gn_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wcr150gn_gpio_buttons[] __initdata = {
        {
                .desc       = "wps",
                .type       = EV_KEY,
                .code       = KEY_WPS_BUTTON,
-               .threshold  = 3,
+               .debounce_interval = WCR150GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio       = WCR150GN_GPIO_BUTTON_WPS,
                .active_low = 1,
        },
@@ -54,7 +55,7 @@ static struct gpio_button wcr150gn_gpio_buttons[] __initdata = {
                .desc       = "reset",
                .type       = EV_KEY,
                .code       = KEY_RESTART,
-               .threshold  = 10,
+               .debounce_interval = WCR150GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio       = WCR150GN_GPIO_BUTTON_RESET,
                .active_low = 1,
        }
@@ -104,7 +105,7 @@ static void __init wcr150gn_init(void)
        rt305x_register_flash(0, &wcr150gn_flash_data);
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wcr150gn_leds_gpio),
                                  wcr150gn_leds_gpio);
-       ramips_register_gpio_buttons(-1, WCR150GN_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WCR150GN_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(wcr150gn_gpio_buttons),
                                     wcr150gn_gpio_buttons);
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
index 394c45accae01ff3aeddb66a8fd546b45fe640fd..6d6dc7f60fb1c4db5af004b466a5a6920e600ddd 100644 (file)
@@ -31,7 +31,8 @@
 #define WHR_G300N_GPIO_BUTTON_ROUTER_ON                8       /* active low */
 #define WHR_G300N_GPIO_BUTTON_ROUTER_OFF       11      /* active low */
 
-#define WHR_G300N_BUTTONS_POLL_INTERVAL                20
+#define WHR_G300N_KEYS_POLL_INTERVAL           20
+#define WHR_G300N_KEYS_DEBOUNCE_INTERVAL       (3 * WHR_G300N_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition whr_g300n_partitions[] = {
        {
@@ -89,33 +90,33 @@ static struct gpio_led whr_g300n_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button whr_g300n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button whr_g300n_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WHR_G300N_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "aoss",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WHR_G300N_GPIO_BUTTON_AOSS,
                .active_low     = 1,
        }, {
                .desc           = "router-off",
                .type           = EV_KEY,
                .code           = BTN_2,
-               .threshold      = 3,
+               .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WHR_G300N_GPIO_BUTTON_ROUTER_OFF,
                .active_low     = 1,
        }, {
                .desc           = "router-on",
                .type           = EV_KEY,
                .code           = BTN_3,
-               .threshold      = 3,
+               .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WHR_G300N_GPIO_BUTTON_ROUTER_ON,
                .active_low     = 1,
        }
@@ -130,7 +131,7 @@ static void __init whr_g300n_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(whr_g300n_leds_gpio),
                                  whr_g300n_leds_gpio);
-       ramips_register_gpio_buttons(-1, WHR_G300N_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WHR_G300N_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(whr_g300n_gpio_buttons),
                                     whr_g300n_gpio_buttons);
        rt305x_register_wifi();
index a3c4485584d7a67d5ab7f9cf65b577a2fb88afdc..f737fe523d72b20e154474ba11023b045b3d5f25 100644 (file)
@@ -33,7 +33,8 @@
 #define WL341V3_GPIO_BUTTON_WPS                5       /* active low */
 #define WL341V3_GPIO_BUTTON_RESET      7       /* active low */
 
-#define WL341V3_BUTTONS_POLL_INTERVAL  20
+#define WL341V3_KEYS_POLL_INTERVAL     20
+#define WL341V3_KEYS_DEBOUNCE_INTERVAL (3 * WL341V3_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition wl341v3_partitions[] = {
        {
@@ -111,19 +112,19 @@ static struct gpio_led wl341v3_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button wl341v3_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wl341v3_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = WL341V3_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WL341V3_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = WL341V3_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WL341V3_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -138,7 +139,7 @@ static void __init wl341v3_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wl341v3_leds_gpio),
                                  wl341v3_leds_gpio);
-       ramips_register_gpio_buttons(-1, WL341V3_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WL341V3_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(wl341v3_gpio_buttons),
                                     wl341v3_gpio_buttons);
        rt305x_register_wifi();
index ff2a1c2e56fa9f1dd07c5c5c5b87ca42986595a3..9d227b66b8dfd65ff4034531fd536b77c1ebdd12 100644 (file)
@@ -31,8 +31,8 @@
 #define WL351_GPIO_BUTTON_RESET        10
 #define WL351_GPIO_BUTTON_WPS  0
 
-#define WL351_BUTTONS_POLL_INTERVAL    20
-
+#define WL351_KEYS_POLL_INTERVAL       20
+#define WL351_KEYS_DEBOUNCE_INTERVAL   (3 * WL351_KEYS_POLL_INTERVAL)
 
 static struct gpio_led wl351_leds_gpio[] __initdata = {
        {
@@ -51,19 +51,19 @@ static struct gpio_led wl351_leds_gpio[] __initdata = {
 };
 
 
-static struct gpio_button wl351_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wl351_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = WL351_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WL351_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = WL351_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WL351_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -133,7 +133,7 @@ static void __init wl351_init(void)
        rt305x_register_flash(0, &wl351_flash_data);
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wl351_leds_gpio),
                                                wl351_leds_gpio);
-       ramips_register_gpio_buttons(-1, WL351_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WL351_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(wl351_gpio_buttons),
                                     wl351_gpio_buttons);
        // external rtl8366rb
index d49a243622015ed490df7b89b72f5c0abf79d33e..201823c49c2f56c00df7c3633c6216b2d3e6f0f5 100644 (file)
@@ -42,7 +42,8 @@
 #define WR512_3GN_GPIO_BUTTON_WPS      0
 #define WR512_3GN_GPIO_BUTTON_WPS2     8
 
-#define WR512_3GN_BUTTONS_POLL_INTERVAL        20
+#define WR512_3GN_KEYS_POLL_INTERVAL   20
+#define WR512_3GN_KEYS_DEBOUNCE_INTERVAL (3 * WR512_3GN_KEYS_POLL_INTERVAL)
 
 static struct mtd_partition wr512_3gn_partitions[] = {
        {
@@ -104,19 +105,19 @@ static struct gpio_led wr512_3gn_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button wr512_3gn_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wr512_3gn_gpio_buttons[] __initdata = {
        {
                .desc           = "reset_wps",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = WR512_3GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WR512_3GN_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "mode",
                .type           = EV_KEY,
                .code           = KEY_M,
-               .threshold      = 3,
+               .debounce_interval = WR512_3GN_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WR512_3GN_GPIO_BUTTON_CONNECT,
                .active_low     = 1,
        }
@@ -135,7 +136,7 @@ static void __init wr512_3gn_init(void)
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wr512_3gn_leds_gpio),
                                  wr512_3gn_leds_gpio);
-       ramips_register_gpio_buttons(-1, WR512_3GN_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WR512_3GN_KEYS_POLL_INTERVAL,
                                     ARRAY_SIZE(wr512_3gn_gpio_buttons),
                                     wr512_3gn_gpio_buttons);
        rt305x_register_wifi();
index 9609b18285e95cb7839b9e8cc736c370420c2cdc..c63adb96dda853f51b7436a71b5060e38bc5e282 100644 (file)
@@ -26,7 +26,8 @@
 #define WR6202_GPIO_BUTTON_RESET     10        /* active low */
 #define WR6202_GPIO_BUTTON_WPS        0        /* active low */
 
-#define WR6202_BUTTONS_POLL_INTERVAL 20
+#define WR6202_KEYS_POLL_INTERVAL 20
+#define WR6202_KEYS_DEBOUNCE_INTERVAL  (3 * WR6202_KEYS_POLL_INTERVAL)
 
 #define WR6202_GPIO_USB_POWER       11
 
@@ -76,19 +77,19 @@ static struct gpio_led wr6202_leds_gpio[] __initdata = {
        }
 };
 
-static struct gpio_button wr6202_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wr6202_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = KEY_RESTART,
-               .threshold      = 3,
+               .debounce_interval = WR6202_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WR6202_GPIO_BUTTON_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
                .code           = KEY_WPS_BUTTON,
-               .threshold      = 3,
+               .debounce_interval = WR6202_KEYS_DEBOUNCE_INTERVAL,
                .gpio           = WR6202_GPIO_BUTTON_WPS,
                .active_low     = 1,
        }
@@ -102,7 +103,7 @@ static void __init wr6202_init(void)
 
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wr6202_leds_gpio),
                                wr6202_leds_gpio);
-       ramips_register_gpio_buttons(-1, WR6202_BUTTONS_POLL_INTERVAL,
+       ramips_register_gpio_buttons(-1, WR6202_KEYS_POLL_INTERVAL,
                                ARRAY_SIZE(wr6202_gpio_buttons),
                                wr6202_gpio_buttons);