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.
#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
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);
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;
if (err)
goto err_put_pdev;
-
err = platform_device_add(pdev);
if (err)
goto err_put_pdev;
#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[] = {
{
}
};
-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,
}
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);
#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[] = {
{
}
};
-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,
}
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);
#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[] = {
{
},
};
-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,
},
.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,
},
.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,
},
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);
#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[] = {
{
},
};
-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,
}
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();
#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 = {
{
}
};
-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,
},
.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,
}
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;
#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[] = {
{
}
};
-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,
}
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);
#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[] = {
{
}
};
-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,
}
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();
#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[] = {
{
}
};
-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,
}
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);
#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[] = {
{
}
};
-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,
}
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);
#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[] = {
{
}
};
-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,
}
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();
#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[] = {
{
}
};
-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,
}
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();
#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[] = {
{
}
};
-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,
}
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();
#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 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,
}
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();
#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
}
};
-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,
}
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);
#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[] = {
{
}
};
-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,
}
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;
#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[] = {
{
},
};
-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,
}
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();
#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[] = {
{
}
};
-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,
}
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();
#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[] = {
{
},
};
-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,
},
.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,
},
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();
#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 = {
{
}
};
-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,
},
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 10,
+ .debounce_interval = WCR150GN_KEYS_DEBOUNCE_INTERVAL,
.gpio = WCR150GN_GPIO_BUTTON_RESET,
.active_low = 1,
}
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;
#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[] = {
{
}
};
-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,
}
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();
#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[] = {
{
}
};
-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,
}
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();
#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 = {
{
};
-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,
}
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
#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[] = {
{
}
};
-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,
}
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();
#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
}
};
-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,
}
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);