ramips: use gpio-keys-polled instead of gpio-buttons

SVN-Revision: 30461
This commit is contained in:
Gabor Juhos 2012-02-11 19:37:06 +00:00
parent 8ce80f7454
commit 32b9e8c750
27 changed files with 159 additions and 138 deletions

View file

@ -17,8 +17,9 @@ LINUX_VERSION:=2.6.39.4
include $(INCLUDE_DIR)/target.mk include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES+=\ DEFAULT_PACKAGES+=\
kmod-leds-gpio kmod-input-core kmod-input-polldev kmod-input-gpio-buttons \ kmod-leds-gpio kmod-input-core kmod-input-polldev \
kmod-button-hotplug kmod-rt2800-pci wpad-mini maccalc kmod-input-gpio-keys-polled kmod-button-hotplug \
kmod-rt2800-pci wpad-mini maccalc
define Target/Description define Target/Description
Build firmware images for Ralink RT288x/RT305x based boards. Build firmware images for Ralink RT288x/RT305x based boards.

View file

@ -12,18 +12,16 @@
#define __ASM_MACH_RALINK_DEV_GPIO_BUTTONS_H #define __ASM_MACH_RALINK_DEV_GPIO_BUTTONS_H
#include <linux/input.h> #include <linux/input.h>
#include <linux/gpio_buttons.h> #include <linux/gpio_keys.h>
#ifdef CONFIG_RALINK_DEV_GPIO_BUTTONS #ifdef CONFIG_RALINK_DEV_GPIO_BUTTONS
void ramips_register_gpio_buttons(int id, void
unsigned poll_interval, ramips_register_gpio_buttons(int id, unsigned poll_interval, unsigned nbuttons,
unsigned nbuttons, struct gpio_keys_button *buttons);
struct gpio_button *buttons);
#else #else
static inline void ramips_register_gpio_buttons(int id, static inline void
unsigned poll_interval, ramips_register_gpio_buttons(int id, unsigned poll_interval, unsigned nbuttons,
unsigned nbuttons, struct gpio_keys_button *buttons)
struct gpio_button *buttons)
{ {
} }
#endif #endif

View file

@ -17,11 +17,11 @@
void __init ramips_register_gpio_buttons(int id, void __init ramips_register_gpio_buttons(int id,
unsigned poll_interval, unsigned poll_interval,
unsigned nbuttons, unsigned nbuttons,
struct gpio_button *buttons) struct gpio_keys_button *buttons)
{ {
struct platform_device *pdev; struct platform_device *pdev;
struct gpio_buttons_platform_data pdata; struct gpio_keys_platform_data pdata;
struct gpio_button *p; struct gpio_keys_button *p;
int err; int err;
p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL); 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)); memcpy(p, buttons, nbuttons * sizeof(*p));
pdev = platform_device_alloc("gpio-buttons", id); pdev = platform_device_alloc("gpio-keys-polled", id);
if (!pdev) if (!pdev)
goto err_free_buttons; goto err_free_buttons;
@ -43,7 +43,6 @@ void __init ramips_register_gpio_buttons(int id,
if (err) if (err)
goto err_put_pdev; goto err_put_pdev;
err = platform_device_add(pdev); err = platform_device_add(pdev);
if (err) if (err)
goto err_put_pdev; goto err_put_pdev;

View file

@ -35,7 +35,8 @@
#define F5D8235_GPIO_BUTTON_WPS 0 #define F5D8235_GPIO_BUTTON_WPS 0
#define F5D8235_GPIO_BUTTON_RESET 9 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = F5D8235_KEYS_DEBOUNCE_INTERVAL,
.gpio = F5D8235_GPIO_BUTTON_RESET, .gpio = F5D8235_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = F5D8235_KEYS_DEBOUNCE_INTERVAL,
.gpio = F5D8235_GPIO_BUTTON_WPS, .gpio = F5D8235_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -121,7 +122,7 @@ static void __init f5d8235_init(void)
ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235_leds_gpio),
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), ARRAY_SIZE(f5d8235_gpio_buttons),
f5d8235_gpio_buttons); f5d8235_gpio_buttons);

View file

@ -32,7 +32,8 @@
#define RT_N15_GPIO_RTL8366_SCK 2 #define RT_N15_GPIO_RTL8366_SCK 2
#define RT_N15_GPIO_RTL8366_SDA 1 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = RT_N15_KEYS_DEBOUNCE_INTERVAL,
.gpio = RT_N15_GPIO_BUTTON_RESET, .gpio = RT_N15_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = RT_N15_KEYS_DEBOUNCE_INTERVAL,
.gpio = RT_N15_GPIO_BUTTON_WPS, .gpio = RT_N15_GPIO_BUTTON_WPS,
.active_low = 1, .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), ramips_register_gpio_leds(-1, ARRAY_SIZE(rt_n15_leds_gpio),
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), ARRAY_SIZE(rt_n15_gpio_buttons),
rt_n15_gpio_buttons); rt_n15_gpio_buttons);

View file

@ -32,7 +32,8 @@
#define WLI_TX4_AG300N_GPIO_BUTTON_BW_SWITCH 8 #define WLI_TX4_AG300N_GPIO_BUTTON_BW_SWITCH 8
#define WLI_TX4_AG300N_GPIO_BUTTON_RESET 9 #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[] = { 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", .desc = "Reset button",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WLI_TX4_AG300N_GPIO_BUTTON_RESET, .gpio = WLI_TX4_AG300N_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, },
@ -111,7 +112,7 @@ static struct gpio_button wli_tx4_ag300n_gpio_buttons[] __initdata = {
.desc = "AOSS button", .desc = "AOSS button",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WLI_TX4_AG300N_GPIO_BUTTON_AOSS, .gpio = WLI_TX4_AG300N_GPIO_BUTTON_AOSS,
.active_low = 1, .active_low = 1,
}, },
@ -119,7 +120,7 @@ static struct gpio_button wli_tx4_ag300n_gpio_buttons[] __initdata = {
.desc = "Bandwidth switch", .desc = "Bandwidth switch",
.type = EV_KEY, .type = EV_KEY,
.code = BTN_0, .code = BTN_0,
.threshold = 3, .debounce_interval = WLI_TX4_AG300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WLI_TX4_AG300N_GPIO_BUTTON_BW_SWITCH, .gpio = WLI_TX4_AG300N_GPIO_BUTTON_BW_SWITCH,
.active_low = 0, .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), ramips_register_gpio_leds(-1, ARRAY_SIZE(wli_tx4_ag300n_leds_gpio),
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), ARRAY_SIZE(wli_tx4_ag300n_gpio_buttons),
wli_tx4_ag300n_gpio_buttons); wli_tx4_ag300n_gpio_buttons);

View file

@ -28,7 +28,8 @@
#define ALL0256N_GPIO_LED_RSSI_LOW 14 #define ALL0256N_GPIO_LED_RSSI_LOW 14
#define ALL0256N_GPIO_LED_RSSI_MED 12 #define ALL0256N_GPIO_LED_RSSI_MED 12
#define ALL0256N_GPIO_LED_RSSI_HIGH 13 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = ALL0256N_KEYS_DEBOUNCE_INTERVAL,
.gpio = ALL0256N_GPIO_BUTTON_RESET, .gpio = ALL0256N_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
} }
@ -112,7 +113,7 @@ static void __init all0256n_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(all0256n_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(all0256n_leds_gpio),
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), ARRAY_SIZE(all0256n_gpio_buttons),
all0256n_gpio_buttons); all0256n_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -27,7 +27,8 @@
#define ARGUS_ATP52B_GPIO_LED_NET 13 #define ARGUS_ATP52B_GPIO_LED_NET 13
#define ARGUS_ATP52B_GPIO_BUTTON_WPS 0 #define ARGUS_ATP52B_GPIO_BUTTON_WPS 0
#define ARGUS_ATP52B_GPIO_BUTTON_RESET 10 #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 = { 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", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL,
.gpio = ARGUS_ATP52B_GPIO_BUTTON_WPS, .gpio = ARGUS_ATP52B_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
}, },
@ -55,7 +56,7 @@ static struct gpio_button argus_atp52b_gpio_buttons[] __initdata = {
.desc = "reset", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 10, .debounce_interval = ARGUS_ATP52B_KEYS_DEBOUNCE_INTERVAL,
.gpio = ARGUS_ATP52B_GPIO_BUTTON_RESET, .gpio = ARGUS_ATP52B_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
} }
@ -99,7 +100,7 @@ static void __init argus_atp52b_init(void)
rt305x_register_flash(0, &argus_atp52b_flash_data); rt305x_register_flash(0, &argus_atp52b_flash_data);
ramips_register_gpio_leds(-1, ARRAY_SIZE(argus_atp52b_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(argus_atp52b_leds_gpio),
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), ARRAY_SIZE(argus_atp52b_gpio_buttons),
argus_atp52b_gpio_buttons); argus_atp52b_gpio_buttons);
rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL; rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;

View file

@ -25,7 +25,8 @@
#define BC2_GPIO_BUTTON_RESET 17 #define BC2_GPIO_BUTTON_RESET 17
#define BC2_GPIO_LED_USB 20 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = BC2_KEYS_DEBOUNCE_INTERVAL,
.gpio = BC2_GPIO_BUTTON_RESET, .gpio = BC2_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
} }
@ -93,7 +94,7 @@ static void __init bc2_init(void)
ramips_register_gpio_leds(-1, ARRAY_SIZE(bc2_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(bc2_leds_gpio),
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), ARRAY_SIZE(bc2_gpio_buttons),
bc2_gpio_buttons); bc2_gpio_buttons);

View file

@ -29,7 +29,8 @@
#define DIR_300B_GPIO_BUTTON_WPS 0 /* active low */ #define DIR_300B_GPIO_BUTTON_WPS 0 /* active low */
#define DIR_300B_GPIO_BUTTON_RESET 10 /* 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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = DIR_300B_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR_300B_GPIO_BUTTON_RESET, .gpio = DIR_300B_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = DIR_300B_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR_300B_GPIO_BUTTON_WPS, .gpio = DIR_300B_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -110,7 +111,7 @@ static void __init dir_300b_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_300b_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_300b_leds_gpio),
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), ARRAY_SIZE(dir_300b_gpio_buttons),
dir_300b_gpio_buttons); dir_300b_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -28,7 +28,8 @@
#define ESR_9753_GPIO_BUTTON_WPS 0 /* active low */ #define ESR_9753_GPIO_BUTTON_WPS 0 /* active low */
#define ESR_9753_GPIO_BUTTON_RESET 10 /* 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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = ESR_9753_KEYS_DEBOUNCE_INTERVAL,
.gpio = ESR_9753_GPIO_BUTTON_RESET, .gpio = ESR_9753_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = ESR_9753_KEYS_DEBOUNCE_INTERVAL,
.gpio = ESR_9753_GPIO_BUTTON_WPS, .gpio = ESR_9753_GPIO_BUTTON_WPS,
.active_low = 1, .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), ramips_register_gpio_leds(-1, ARRAY_SIZE(esr_9753_leds_gpio),
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), ARRAY_SIZE(esr_9753_gpio_buttons),
esr_9753_gpio_buttons); esr_9753_gpio_buttons);

View file

@ -29,7 +29,8 @@
#define FONERA20N_GPIO_LED_POWER 9 #define FONERA20N_GPIO_LED_POWER 9
#define FONERA20N_GPIO_LED_USB 14 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = FONERA20N_KEYS_DEBOUNCE_INTERVAL,
.gpio = FONERA20N_GPIO_BUTTON_RESET, .gpio = FONERA20N_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "switch", .desc = "switch",
.type = EV_KEY, .type = EV_KEY,
.code = BTN_1, .code = BTN_1,
.threshold = 3, .debounce_interval = FONERA20N_KEYS_DEBOUNCE_INTERVAL,
.gpio = FONERA20N_GPIO_SWITCH, .gpio = FONERA20N_GPIO_SWITCH,
.active_low = 1, .active_low = 1,
} }
@ -110,7 +111,7 @@ static void __init fonera20n_init(void)
ramips_register_gpio_leds(-1, ARRAY_SIZE(fonera20n_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(fonera20n_leds_gpio),
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), ARRAY_SIZE(fonera20n_gpio_buttons),
fonera20n_gpio_buttons); fonera20n_gpio_buttons);

View file

@ -31,7 +31,8 @@
#define HW550_3G_GPIO_BUTTON_CONNECT 7 #define HW550_3G_GPIO_BUTTON_CONNECT 7
#define HW550_3G_GPIO_BUTTON_WPS 0 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = HW550_3G_KEYS_DEBOUNCE_INTERVAL,
.gpio = HW550_3G_GPIO_BUTTON_RESET, .gpio = HW550_3G_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "connect", .desc = "connect",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_CONNECT, .code = KEY_CONNECT,
.threshold = 3, .debounce_interval = HW550_3G_KEYS_DEBOUNCE_INTERVAL,
.gpio = HW550_3G_GPIO_BUTTON_CONNECT, .gpio = HW550_3G_GPIO_BUTTON_CONNECT,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = HW550_3G_KEYS_DEBOUNCE_INTERVAL,
.gpio = HW550_3G_GPIO_BUTTON_WPS, .gpio = HW550_3G_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -127,7 +128,7 @@ static void __init hw550_3g_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(hw550_3g_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(hw550_3g_leds_gpio),
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), ARRAY_SIZE(hw550_3g_gpio_buttons),
hw550_3g_gpio_buttons); hw550_3g_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -31,7 +31,8 @@
#define MOFI3500_3GN_GPIO_BUTTON_CONNECT 7 #define MOFI3500_3GN_GPIO_BUTTON_CONNECT 7
#define MOFI3500_3GN_GPIO_BUTTON_WPS 0 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = MOFI3500_3GN_GPIO_BUTTON_RESET, .gpio = MOFI3500_3GN_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "connect", .desc = "connect",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_CONNECT, .code = KEY_CONNECT,
.threshold = 3, .debounce_interval = MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = MOFI3500_3GN_GPIO_BUTTON_CONNECT, .gpio = MOFI3500_3GN_GPIO_BUTTON_CONNECT,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = MOFI3500_3GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = MOFI3500_3GN_GPIO_BUTTON_WPS, .gpio = MOFI3500_3GN_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -127,7 +128,7 @@ static void __init mofi3500_3gn_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(mofi3500_3gn_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(mofi3500_3gn_leds_gpio),
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), ARRAY_SIZE(mofi3500_3gn_gpio_buttons),
mofi3500_3gn_gpio_buttons); mofi3500_3gn_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -28,7 +28,8 @@
#define NBG_419N_GPIO_BUTTON_WPS 0 /* active low */ #define NBG_419N_GPIO_BUTTON_WPS 0 /* active low */
#define NBG_419N_GPIO_BUTTON_RESET 10 /* 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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = NBG_419N_KEYS_DEBOUNCE_INTERVAL,
.gpio = NBG_419N_GPIO_BUTTON_RESET, .gpio = NBG_419N_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = NBG_419N_KEYS_DEBOUNCE_INTERVAL,
.gpio = NBG_419N_GPIO_BUTTON_WPS, .gpio = NBG_419N_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -97,7 +98,7 @@ static void __init nbg_419n_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(nbg_419n_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(nbg_419n_leds_gpio),
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), ARRAY_SIZE(nbg_419n_gpio_buttons),
nbg_419n_gpio_buttons); nbg_419n_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -32,7 +32,8 @@
#define NW718_GPIO_SPI_CS0 3 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = NW718_KEYS_DEBOUNCE_INTERVAL,
.gpio = NW718_GPIO_BUTTON_RESET, .gpio = NW718_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = NW718_KEYS_DEBOUNCE_INTERVAL,
.gpio = NW718_GPIO_BUTTON_WPS, .gpio = NW718_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -124,7 +125,7 @@ static void __init nw718_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(nw718_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(nw718_leds_gpio),
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), ARRAY_SIZE(nw718_gpio_buttons),
nw718_gpio_buttons); nw718_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -25,7 +25,8 @@
#define OMNI_EMB_GPIO_BUTTON_RESET 12 /* active low */ #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_STATUS 9
#define OMNI_EMB_GPIO_LED_WLAN 14 #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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = OMNI_EMB_KEYS_DEBOUNCE_INTERVAL,
.gpio = OMNI_EMB_GPIO_BUTTON_RESET, .gpio = OMNI_EMB_GPIO_BUTTON_RESET,
.active_low = 1, .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), ramips_register_gpio_leds(-1, ARRAY_SIZE(omni_emb_leds_gpio),
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), ARRAY_SIZE(omni_emb_gpio_buttons),
omni_emb_gpio_buttons); omni_emb_gpio_buttons);

View file

@ -25,7 +25,8 @@
#define PWH2004_GPIO_BUTTON_WPS 12 #define PWH2004_GPIO_BUTTON_WPS 12
#define PWH2004_GPIO_LED_POWER 9 #define PWH2004_GPIO_LED_POWER 9
#define PWH2004_GPIO_LED_WIFI 14 #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[] = { 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", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = PWH2004_KEYS_DEBOUNCE_INTERVAL,
.gpio = PWH2004_GPIO_BUTTON_WPS, .gpio = PWH2004_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -88,7 +89,7 @@ static void __init pwh2004_init(void)
rt305x_register_flash(0, &pwh2004_flash_data); rt305x_register_flash(0, &pwh2004_flash_data);
ramips_register_gpio_leds(-1, ARRAY_SIZE(pwh2004_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(pwh2004_leds_gpio),
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), ARRAY_SIZE(pwh2004_gpio_buttons),
pwh2004_gpio_buttons); pwh2004_gpio_buttons);
rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW; rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;

View file

@ -25,7 +25,8 @@
#define RT_G32B_GPIO_BUTTON_WPS 0 /* active low */ #define RT_G32B_GPIO_BUTTON_WPS 0 /* active low */
#define RT_G32B_GPIO_BUTTON_RESET 10 /* 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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = RT_G32B_KEYS_DEBOUNCE_INTERVAL,
.gpio = RT_G32B_GPIO_BUTTON_RESET, .gpio = RT_G32B_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = RT_G32B_KEYS_DEBOUNCE_INTERVAL,
.gpio = RT_G32B_GPIO_BUTTON_WPS, .gpio = RT_G32B_GPIO_BUTTON_WPS,
.active_low = 1, .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_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
rt305x_register_ethernet(); 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), ARRAY_SIZE(rt_g32b_gpio_buttons),
rt_g32b_gpio_buttons); rt_g32b_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -27,7 +27,8 @@
#define V22RW_2X2_GPIO_LED_SECURITY 13 #define V22RW_2X2_GPIO_LED_SECURITY 13
#define V22RW_2X2_GPIO_LED_WPS 14 #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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = V22RW_2X2_KEYS_DEBOUNCE_INTERVAL,
.gpio = V22RW_2X2_GPIO_BUTTON_SWRST, .gpio = V22RW_2X2_GPIO_BUTTON_SWRST,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = V22RW_2X2_KEYS_DEBOUNCE_INTERVAL,
.gpio = V22RW_2X2_GPIO_BUTTON_WPS, .gpio = V22RW_2X2_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -104,7 +105,7 @@ static void __init v22rw_2x2_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(v22rw_2x2_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(v22rw_2x2_leds_gpio),
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), ARRAY_SIZE(v22rw_2x2_gpio_buttons),
v22rw_2x2_gpio_buttons); v22rw_2x2_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -28,7 +28,8 @@
#define W502U_GPIO_BUTTON_WPS 0 #define W502U_GPIO_BUTTON_WPS 0
#define W502U_GPIO_BUTTON_RESET 10 #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[] = { 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", .desc = "Reset button",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = W502U_KEYS_DEBOUNCE_INTERVAL,
.gpio = W502U_GPIO_BUTTON_RESET, .gpio = W502U_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, },
@ -97,7 +98,7 @@ static struct gpio_button w502u_gpio_buttons[] __initdata = {
.desc = "WPS button", .desc = "WPS button",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = W502U_KEYS_DEBOUNCE_INTERVAL,
.gpio = W502U_GPIO_BUTTON_WPS, .gpio = W502U_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
}, },
@ -113,7 +114,7 @@ static void __init w502u_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(w502u_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(w502u_leds_gpio),
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), ARRAY_SIZE(w502u_gpio_buttons),
w502u_gpio_buttons); w502u_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -26,7 +26,8 @@
#define WCR150GN_GPIO_LED_POWER 8 #define WCR150GN_GPIO_LED_POWER 8
#define WCR150GN_GPIO_BUTTON_WPS 10 #define WCR150GN_GPIO_BUTTON_WPS 10
#define WCR150GN_GPIO_BUTTON_RESET 0 #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 = { 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", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = WCR150GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = WCR150GN_GPIO_BUTTON_WPS, .gpio = WCR150GN_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
}, },
@ -54,7 +55,7 @@ static struct gpio_button wcr150gn_gpio_buttons[] __initdata = {
.desc = "reset", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 10, .debounce_interval = WCR150GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = WCR150GN_GPIO_BUTTON_RESET, .gpio = WCR150GN_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
} }
@ -104,7 +105,7 @@ static void __init wcr150gn_init(void)
rt305x_register_flash(0, &wcr150gn_flash_data); rt305x_register_flash(0, &wcr150gn_flash_data);
ramips_register_gpio_leds(-1, ARRAY_SIZE(wcr150gn_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(wcr150gn_leds_gpio),
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), ARRAY_SIZE(wcr150gn_gpio_buttons),
wcr150gn_gpio_buttons); wcr150gn_gpio_buttons);
rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW; rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;

View file

@ -31,7 +31,8 @@
#define WHR_G300N_GPIO_BUTTON_ROUTER_ON 8 /* active low */ #define WHR_G300N_GPIO_BUTTON_ROUTER_ON 8 /* active low */
#define WHR_G300N_GPIO_BUTTON_ROUTER_OFF 11 /* 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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WHR_G300N_GPIO_BUTTON_RESET, .gpio = WHR_G300N_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "aoss", .desc = "aoss",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WHR_G300N_GPIO_BUTTON_AOSS, .gpio = WHR_G300N_GPIO_BUTTON_AOSS,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "router-off", .desc = "router-off",
.type = EV_KEY, .type = EV_KEY,
.code = BTN_2, .code = BTN_2,
.threshold = 3, .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WHR_G300N_GPIO_BUTTON_ROUTER_OFF, .gpio = WHR_G300N_GPIO_BUTTON_ROUTER_OFF,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "router-on", .desc = "router-on",
.type = EV_KEY, .type = EV_KEY,
.code = BTN_3, .code = BTN_3,
.threshold = 3, .debounce_interval = WHR_G300N_KEYS_DEBOUNCE_INTERVAL,
.gpio = WHR_G300N_GPIO_BUTTON_ROUTER_ON, .gpio = WHR_G300N_GPIO_BUTTON_ROUTER_ON,
.active_low = 1, .active_low = 1,
} }
@ -130,7 +131,7 @@ static void __init whr_g300n_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(whr_g300n_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(whr_g300n_leds_gpio),
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), ARRAY_SIZE(whr_g300n_gpio_buttons),
whr_g300n_gpio_buttons); whr_g300n_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -33,7 +33,8 @@
#define WL341V3_GPIO_BUTTON_WPS 5 /* active low */ #define WL341V3_GPIO_BUTTON_WPS 5 /* active low */
#define WL341V3_GPIO_BUTTON_RESET 7 /* 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[] = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = WL341V3_KEYS_DEBOUNCE_INTERVAL,
.gpio = WL341V3_GPIO_BUTTON_RESET, .gpio = WL341V3_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = WL341V3_KEYS_DEBOUNCE_INTERVAL,
.gpio = WL341V3_GPIO_BUTTON_WPS, .gpio = WL341V3_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -138,7 +139,7 @@ static void __init wl341v3_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(wl341v3_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(wl341v3_leds_gpio),
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), ARRAY_SIZE(wl341v3_gpio_buttons),
wl341v3_gpio_buttons); wl341v3_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -31,8 +31,8 @@
#define WL351_GPIO_BUTTON_RESET 10 #define WL351_GPIO_BUTTON_RESET 10
#define WL351_GPIO_BUTTON_WPS 0 #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 = { 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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = WL351_KEYS_DEBOUNCE_INTERVAL,
.gpio = WL351_GPIO_BUTTON_RESET, .gpio = WL351_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = WL351_KEYS_DEBOUNCE_INTERVAL,
.gpio = WL351_GPIO_BUTTON_WPS, .gpio = WL351_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -133,7 +133,7 @@ static void __init wl351_init(void)
rt305x_register_flash(0, &wl351_flash_data); rt305x_register_flash(0, &wl351_flash_data);
ramips_register_gpio_leds(-1, ARRAY_SIZE(wl351_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(wl351_leds_gpio),
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), ARRAY_SIZE(wl351_gpio_buttons),
wl351_gpio_buttons); wl351_gpio_buttons);
// external rtl8366rb // external rtl8366rb

View file

@ -42,7 +42,8 @@
#define WR512_3GN_GPIO_BUTTON_WPS 0 #define WR512_3GN_GPIO_BUTTON_WPS 0
#define WR512_3GN_GPIO_BUTTON_WPS2 8 #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[] = { 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", .desc = "reset_wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = WR512_3GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = WR512_3GN_GPIO_BUTTON_RESET, .gpio = WR512_3GN_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "mode", .desc = "mode",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_M, .code = KEY_M,
.threshold = 3, .debounce_interval = WR512_3GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = WR512_3GN_GPIO_BUTTON_CONNECT, .gpio = WR512_3GN_GPIO_BUTTON_CONNECT,
.active_low = 1, .active_low = 1,
} }
@ -135,7 +136,7 @@ static void __init wr512_3gn_init(void)
rt305x_register_ethernet(); rt305x_register_ethernet();
ramips_register_gpio_leds(-1, ARRAY_SIZE(wr512_3gn_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(wr512_3gn_leds_gpio),
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), ARRAY_SIZE(wr512_3gn_gpio_buttons),
wr512_3gn_gpio_buttons); wr512_3gn_gpio_buttons);
rt305x_register_wifi(); rt305x_register_wifi();

View file

@ -26,7 +26,8 @@
#define WR6202_GPIO_BUTTON_RESET 10 /* active low */ #define WR6202_GPIO_BUTTON_RESET 10 /* active low */
#define WR6202_GPIO_BUTTON_WPS 0 /* 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 #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", .desc = "reset",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_RESTART, .code = KEY_RESTART,
.threshold = 3, .debounce_interval = WR6202_KEYS_DEBOUNCE_INTERVAL,
.gpio = WR6202_GPIO_BUTTON_RESET, .gpio = WR6202_GPIO_BUTTON_RESET,
.active_low = 1, .active_low = 1,
}, { }, {
.desc = "wps", .desc = "wps",
.type = EV_KEY, .type = EV_KEY,
.code = KEY_WPS_BUTTON, .code = KEY_WPS_BUTTON,
.threshold = 3, .debounce_interval = WR6202_KEYS_DEBOUNCE_INTERVAL,
.gpio = WR6202_GPIO_BUTTON_WPS, .gpio = WR6202_GPIO_BUTTON_WPS,
.active_low = 1, .active_low = 1,
} }
@ -102,7 +103,7 @@ static void __init wr6202_init(void)
ramips_register_gpio_leds(-1, ARRAY_SIZE(wr6202_leds_gpio), ramips_register_gpio_leds(-1, ARRAY_SIZE(wr6202_leds_gpio),
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), ARRAY_SIZE(wr6202_gpio_buttons),
wr6202_gpio_buttons); wr6202_gpio_buttons);