DEFAULT_PACKAGES += \
kmod-leds-gpio kmod-input-core kmod-input-polldev \
- kmod-input-gpio-buttons kmod-button-hotplug swconfig
+ kmod-input-gpio-keys-polled kmod-button-hotplug swconfig
define Target/Description
Build firmware images for Atheros AR71xx/AR913x/AR934x based boards.
preinit_enable_reset_button() {
insmod input-core
insmod input-polldev
- insmod gpio_buttons
+ insmod gpio_keys_polled
insmod button-hotplug
}
#include "dev-gpio-buttons.h"
-void __init ar71xx_add_device_gpio_buttons(int id,
- unsigned poll_interval,
- unsigned nbuttons,
- struct gpio_button *buttons)
+void __init ar71xx_register_gpio_keys_polled(int id,
+ unsigned poll_interval,
+ unsigned nbuttons,
+ 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 _AR71XX_DEV_GPIO_BUTTONS_H
#include <linux/input.h>
-#include <linux/gpio_buttons.h>
+#include <linux/gpio_keys.h>
-#include <asm/mach-ar71xx/platform.h>
-
-void ar71xx_add_device_gpio_buttons(int id,
- unsigned poll_interval,
- unsigned nbuttons,
- struct gpio_button *buttons) __init;
+void ar71xx_register_gpio_keys_polled(int id,
+ unsigned poll_interval,
+ unsigned nbuttons,
+ struct gpio_keys_button *buttons);
#endif /* _AR71XX_DEV_GPIO_BUTTONS_H */
#define AP81_GPIO_BTN_SW4 12
#define AP81_GPIO_BTN_SW1 21
-#define AP81_BUTTONS_POLL_INTERVAL 20
+#define AP81_KEYS_POLL_INTERVAL 20 /* msecs */
+#define AP81_KEYS_DEBOUNCE_INTERVAL (3 * AP81_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition ap81_partitions[] = {
}
};
-static struct gpio_button ap81_gpio_buttons[] __initdata = {
+static struct gpio_keys_button ap81_gpio_keys[] __initdata = {
{
.desc = "sw1",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
.gpio = AP81_GPIO_BTN_SW1,
.active_low = 1,
}, {
.desc = "sw4",
.type = EV_KEY,
.code = BTN_1,
- .threshold = 3,
+ .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
.gpio = AP81_GPIO_BTN_SW4,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
ap81_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, AP81_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(ap81_gpio_buttons),
- ap81_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ap81_gpio_keys),
+ ap81_gpio_keys);
ar9xxx_add_device_wmac(eeprom, NULL);
}
#define AP83_050_GPIO_VSC7385_MOSI 16
#define AP83_050_GPIO_VSC7385_SCK 17
-#define AP83_BUTTONS_POLL_INTERVAL 20
+#define AP83_KEYS_POLL_INTERVAL 20 /* msecs */
+#define AP83_KEYS_DEBOUNCE_INTERVAL (3 * AP83_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition ap83_flash_partitions[] = {
},
};
-static struct gpio_button ap83_gpio_buttons[] __initdata = {
+static struct gpio_keys_button ap83_gpio_keys[] __initdata = {
{
.desc = "soft_reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = AP83_KEYS_DEBOUNCE_INTERVAL,
.gpio = AP83_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "jumpstart",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = AP83_KEYS_DEBOUNCE_INTERVAL,
.gpio = AP83_GPIO_BTN_JUMPSTART,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
ap83_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, AP83_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(ap83_gpio_buttons),
- ap83_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, AP83_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ap83_gpio_keys),
+ ap83_gpio_keys);
ar71xx_add_device_usb();
/* WPS button - next to a led on right */
#define AP96_GPIO_BTN_WPS 8
-#define AP96_BUTTONS_POLL_INTERVAL 20
+#define AP96_KEYS_POLL_INTERVAL 20 /* msecs */
+#define AP96_KEYS_DEBOUNCE_INTERVAL (3 * AP96_KEYS_POLL_INTERVAL)
#define AP96_WMAC0_MAC_OFFSET 0x120c
#define AP96_WMAC1_MAC_OFFSET 0x520c
}
};
-static struct gpio_button ap96_gpio_buttons[] __initdata = {
+static struct gpio_keys_button ap96_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = AP96_KEYS_DEBOUNCE_INTERVAL,
.gpio = AP96_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = AP96_KEYS_DEBOUNCE_INTERVAL,
.gpio = AP96_GPIO_BTN_WPS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap96_leds_gpio),
ap96_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, AP96_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(ap96_gpio_buttons),
- ap96_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, AP96_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ap96_gpio_keys),
+ ap96_gpio_keys);
ap94_pci_init(art + AP96_CALDATA0_OFFSET,
art + AP96_WMAC0_MAC_OFFSET,
#define AW_NR580_GPIO_BTN_WPS 3
#define AW_NR580_GPIO_BTN_RESET 11
-#define AW_NR580_BUTTONS_POLL_INTERVAL 20
+#define AW_NR580_KEYS_POLL_INTERVAL 20 /* msecs */
+#define AW_NR580_KEYS_DEBOUNCE_INTERVAL (3 * AW_NR580_KEYS_POLL_INTERVAL)
static struct gpio_led aw_nr580_leds_gpio[] __initdata = {
{
}
};
-static struct gpio_button aw_nr580_gpio_buttons[] __initdata = {
+static struct gpio_keys_button aw_nr580_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = AW_NR580_KEYS_DEBOUNCE_INTERVAL,
.gpio = AW_NR580_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = AW_NR580_KEYS_DEBOUNCE_INTERVAL,
.gpio = AW_NR580_GPIO_BTN_WPS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(aw_nr580_leds_gpio),
aw_nr580_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, AW_NR580_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(aw_nr580_gpio_buttons),
- aw_nr580_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, AW_NR580_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(aw_nr580_gpio_keys),
+ aw_nr580_gpio_keys);
}
MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AW-NR580", "AzureWave AW-NR580",
#define DB120_CALDATA_OFFSET 0x1000
#define DB120_WMAC_MAC_OFFSET 0x1002
-#define DB120_BUTTONS_POLL_INTERVAL 20
+#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
+#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition db120_partitions[] = {
}
};
-static struct gpio_button db120_gpio_buttons[] __initdata = {
+static struct gpio_keys_button db120_gpio_keys[] __initdata = {
{
.desc = "sw1",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = DB120_KEYS_DEBOUNCE_INTERVAL,
.gpio = DB120_GPIO_BTN_SW1,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
db120_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, DB120_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(db120_gpio_buttons),
- db120_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, DB120_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(db120_gpio_keys),
+ db120_gpio_keys);
ar9xxx_add_device_wmac(art + DB120_CALDATA_OFFSET,
art + DB120_WMAC_MAC_OFFSET);
#define DIR_600_A1_GPIO_BTN_RESET 8
#define DIR_600_A1_GPIO_BTN_WPS 12
-#define DIR_600_A1_BUTTONS_POLL_INTERVAL 20
+#define DIR_600_A1_KEYS_POLL_INTERVAL 20 /* msecs */
+#define DIR_600_A1_KEYS_DEBOUNCE_INTERVAL (3 * DIR_600_A1_KEYS_POLL_INTERVAL)
#define DIR_600_A1_NVRAM_ADDR 0x1f030000
#define DIR_600_A1_NVRAM_SIZE 0x10000
}
};
-static struct gpio_button dir_600_a1_gpio_buttons[] __initdata = {
+static struct gpio_keys_button dir_600_a1_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = DIR_600_A1_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR_600_A1_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = DIR_600_A1_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR_600_A1_GPIO_BTN_WPS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(dir_600_a1_leds_gpio),
dir_600_a1_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, DIR_600_A1_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(dir_600_a1_gpio_buttons),
- dir_600_a1_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, DIR_600_A1_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(dir_600_a1_gpio_keys),
+ dir_600_a1_gpio_keys);
ar71xx_eth1_data.has_ar7240_switch = 1;
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
#define DIR_615C1_GPIO_BTN_WPS 12
#define DIR_615C1_GPIO_BTN_RESET 21
-#define DIR_615C1_BUTTONS_POLL_INTERVAL 20
+#define DIR_615C1_KEYS_POLL_INTERVAL 20 /* msecs */
+#define DIR_615C1_KEYS_DEBOUNCE_INTERVAL (3 * DIR_615C1_KEYS_POLL_INTERVAL)
#define DIR_615C1_CONFIG_ADDR 0x1f020000
#define DIR_615C1_CONFIG_SIZE 0x10000
};
-static struct gpio_button dir_615c1_gpio_buttons[] __initdata = {
+static struct gpio_keys_button dir_615c1_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = DIR_615C1_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR_615C1_GPIO_BTN_RESET,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = DIR_615C1_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR_615C1_GPIO_BTN_WPS,
}
};
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(dir_615c1_leds_gpio),
dir_615c1_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, DIR_615C1_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(dir_615c1_gpio_buttons),
- dir_615c1_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, DIR_615C1_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(dir_615c1_gpio_keys),
+ dir_615c1_gpio_keys);
ar9xxx_add_device_wmac(eeprom, wlan_mac);
}
#define DIR825B1_GPIO_RTL8366_SDA 5
#define DIR825B1_GPIO_RTL8366_SCK 7
-#define DIR825B1_BUTTONS_POLL_INTERVAL 20
+#define DIR825B1_KEYS_POLL_INTERVAL 20 /* msecs */
+#define DIR825B1_KEYS_DEBOUNCE_INTERVAL (3 * DIR825B1_KEYS_POLL_INTERVAL)
#define DIR825B1_CAL_LOCATION_0 0x1f661000
#define DIR825B1_CAL_LOCATION_1 0x1f665000
}
};
-static struct gpio_button dir825b1_gpio_buttons[] __initdata = {
+static struct gpio_keys_button dir825b1_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = DIR825B1_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR825B1_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = DIR825B1_KEYS_DEBOUNCE_INTERVAL,
.gpio = DIR825B1_GPIO_BTN_WPS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(dir825b1_leds_gpio),
dir825b1_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, DIR825B1_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(dir825b1_gpio_buttons),
- dir825b1_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, DIR825B1_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(dir825b1_gpio_keys),
+ dir825b1_gpio_keys);
ar71xx_add_device_usb();
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
-#define EAP7660D_BUTTONS_POLL_INTERVAL 20
+#define EAP7660D_KEYS_POLL_INTERVAL 20 /* msecs */
+#define EAP7660D_KEYS_DEBOUNCE_INTERVAL (3 * EAP7660D_KEYS_POLL_INTERVAL)
+
#define EAP7660D_GPIO_DS4 7
#define EAP7660D_GPIO_DS5 2
#define EAP7660D_GPIO_DS7 0
}
};
-static struct gpio_button eap7660d_gpio_buttons[] __initdata = {
+static struct gpio_keys_button eap7660d_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = EAP7660D_KEYS_DEBOUNCE_INTERVAL,
.gpio = EAP7660D_GPIO_SW1,
.active_low = 1,
},
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = EAP7660D_KEYS_DEBOUNCE_INTERVAL,
.gpio = EAP7660D_GPIO_SW3,
.active_low = 1,
}
ar71xx_add_device_m25p80(NULL);
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(eap7660d_leds_gpio),
eap7660d_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, EAP7660D_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(eap7660d_gpio_buttons),
- eap7660d_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, EAP7660D_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(eap7660d_gpio_keys),
+ eap7660d_gpio_keys);
eap7660d_pci_init(boardconfig + EAP7660D_WMAC0_CALDATA_OFFSET,
boardconfig + EAP7660D_WMAC0_MAC_OFFSET,
boardconfig + EAP7660D_WMAC1_CALDATA_OFFSET,
#include "dev-usb.h"
#include "dev-leds-gpio.h"
-#define JA76PF_BUTTONS_POLL_INTERVAL 20
+#define JA76PF_KEYS_POLL_INTERVAL 20 /* msecs */
+#define JA76PF_KEYS_DEBOUNCE_INTERVAL (3 * JA76PF_KEYS_POLL_INTERVAL)
#define JA76PF_GPIO_I2C_SCL 0
#define JA76PF_GPIO_I2C_SDA 1
}
};
-static struct gpio_button ja76pf_gpio_buttons[] __initdata = {
+static struct gpio_keys_button ja76pf_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = JA76PF_KEYS_DEBOUNCE_INTERVAL,
.gpio = JA76PF_GPIO_BTN_RESET,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ja76pf_leds_gpio),
ja76pf_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, JA76PF_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(ja76pf_gpio_buttons),
- ja76pf_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, JA76PF_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ja76pf_gpio_keys),
+ ja76pf_gpio_keys);
ar71xx_add_device_usb();
pb42_pci_init();
#include "dev-pb42-pci.h"
#include "dev-usb.h"
-#define JWAP003_BUTTONS_POLL_INTERVAL 20
+#define JWAP003_KEYS_POLL_INTERVAL 20 /* msecs */
+#define JWAP003_KEYS_DEBOUNCE_INTERVAL (3 * JWAP003_KEYS_POLL_INTERVAL)
+
#define JWAP003_GPIO_WPS 11
#define JWAP003_GPIO_I2C_SCL 0
#define JWAP003_GPIO_I2C_SDA 1
-static struct gpio_button jwap003_gpio_buttons[] __initdata = {
+static struct gpio_keys_button jwap003_gpio_keys[] __initdata = {
{
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = JWAP003_KEYS_DEBOUNCE_INTERVAL,
.gpio = JWAP003_GPIO_WPS,
.active_low = 1,
}
ar71xx_add_device_usb();
- ar71xx_add_device_gpio_buttons(-1, JWAP003_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(jwap003_gpio_buttons),
- jwap003_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, JWAP003_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(jwap003_gpio_keys),
+ jwap003_gpio_keys);
pb42_pci_init();
}
#define MZK_W04NU_GPIO_BTN_WPS 12
#define MZK_W04NU_GPIO_BTN_RESET 21
-#define MZK_W04NU_BUTTONS_POLL_INTERVAL 20
+#define MZK_W04NU_KEYS_POLL_INTERVAL 20 /* msecs */
+#define MZK_W04NU_KEYS_DEBOUNCE_INTERVAL (3 * MZK_W04NU_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition mzk_w04nu_partitions[] = {
}
};
-static struct gpio_button mzk_w04nu_gpio_buttons[] __initdata = {
+static struct gpio_keys_button mzk_w04nu_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = MZK_W04NU_KEYS_DEBOUNCE_INTERVAL,
.gpio = MZK_W04NU_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = MZK_W04NU_KEYS_DEBOUNCE_INTERVAL,
.gpio = MZK_W04NU_GPIO_BTN_WPS,
.active_low = 1,
}, {
.desc = "aprouter",
.type = EV_KEY,
.code = BTN_2,
- .threshold = 3,
+ .debounce_interval = MZK_W04NU_KEYS_DEBOUNCE_INTERVAL,
.gpio = MZK_W04NU_GPIO_BTN_APROUTER,
.active_low = 0,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(mzk_w04nu_leds_gpio),
mzk_w04nu_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(mzk_w04nu_gpio_buttons),
- mzk_w04nu_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, MZK_W04NU_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(mzk_w04nu_gpio_keys),
+ mzk_w04nu_gpio_keys);
ar71xx_add_device_usb();
ar9xxx_add_device_wmac(eeprom, NULL);
#define MZK_W300NH_GPIO_BTN_WPS 12
#define MZK_W300NH_GPIO_BTN_RESET 21
-#define MZK_W04NU_BUTTONS_POLL_INTERVAL 20
+#define MZK_W300NH_KEYS_POLL_INTERVAL 20 /* msecs */
+#define MZK_W300NH_KEYS_DEBOUNCE_INTERVAL (3 * MZK_W300NH_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition mzk_w300nh_partitions[] = {
}
};
-static struct gpio_button mzk_w300nh_gpio_buttons[] __initdata = {
+static struct gpio_keys_button mzk_w300nh_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = MZK_W300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = MZK_W300NH_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = MZK_W300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = MZK_W300NH_GPIO_BTN_WPS,
.active_low = 1,
}, {
.desc = "aprouter",
.type = EV_KEY,
.code = BTN_2,
- .threshold = 3,
+ .debounce_interval = MZK_W300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = MZK_W300NH_GPIO_BTN_APROUTER,
.active_low = 0,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(mzk_w300nh_leds_gpio),
mzk_w300nh_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(mzk_w300nh_gpio_buttons),
- mzk_w300nh_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, MZK_W300NH_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(mzk_w300nh_gpio_keys),
+ mzk_w300nh_gpio_keys);
ar9xxx_add_device_wmac(eeprom, NULL);
}
/* Buttons */
#define NBG460N_GPIO_BTN_WPS 12
#define NBG460N_GPIO_BTN_RESET 21
-#define NBG460N_BUTTONS_POLL_INTERVAL 20
+
+#define NBG460N_KEYS_POLL_INTERVAL 20 /* msecs */
+#define NBG460N_KEYS_DEBOUNCE_INTERVAL (3 * NBG460N_KEYS_POLL_INTERVAL)
/* RTC chip PCF8563 I2C interface */
#define NBG460N_GPIO_PCF8563_SDA 8
}
};
-static struct gpio_button nbg460n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button nbg460n_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = NBG460N_KEYS_DEBOUNCE_INTERVAL,
.gpio = NBG460N_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = NBG460N_KEYS_DEBOUNCE_INTERVAL,
.gpio = NBG460N_GPIO_BTN_WPS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(nbg460n_leds_gpio),
nbg460n_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, NBG460N_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(nbg460n_gpio_buttons),
- nbg460n_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, NBG460N_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(nbg460n_gpio_keys),
+ nbg460n_gpio_keys);
}
MIPS_MACHINE(AR71XX_MACH_NBG460N, "NBG460N", "Zyxel NBG460N/550N/550NH",
#include "dev-pb42-pci.h"
#include "dev-usb.h"
-#define PB42_BUTTONS_POLL_INTERVAL 20
+#define PB42_KEYS_POLL_INTERVAL 20 /* msecs */
+#define PB42_KEYS_DEBOUNCE_INTERVAL (3 * PB42_KEYS_POLL_INTERVAL)
#define PB42_GPIO_BTN_SW4 8
#define PB42_GPIO_BTN_SW5 3
-static struct gpio_button pb42_gpio_buttons[] __initdata = {
+static struct gpio_keys_button pb42_gpio_keys[] __initdata = {
{
.desc = "sw4",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = PB42_KEYS_DEBOUNCE_INTERVAL,
.gpio = PB42_GPIO_BTN_SW4,
.active_low = 1,
}, {
.desc = "sw5",
.type = EV_KEY,
.code = BTN_1,
- .threshold = 3,
+ .debounce_interval = PB42_KEYS_DEBOUNCE_INTERVAL,
.gpio = PB42_GPIO_BTN_SW5,
.active_low = 1,
}
ar71xx_add_device_eth(0);
ar71xx_add_device_eth(1);
- ar71xx_add_device_gpio_buttons(-1, PB42_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(pb42_gpio_buttons),
- pb42_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, PB42_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(pb42_gpio_keys),
+ pb42_gpio_keys);
pb42_pci_init();
}
#define PB44_GPIO_LED_JUMP1 (PB44_GPIO_EXP_BASE + PB44_PCF8757_LED_JUMP1)
#define PB44_GPIO_LED_JUMP2 (PB44_GPIO_EXP_BASE + PB44_PCF8757_LED_JUMP2)
+#define PB44_KEYS_POLL_INTERVAL 20 /* msecs */
+#define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL)
+
static struct i2c_gpio_platform_data pb44_i2c_gpio_data = {
.sda_pin = PB44_GPIO_I2C_SDA,
.scl_pin = PB44_GPIO_I2C_SCL,
},
};
-static struct gpio_button pb44_gpio_buttons[] __initdata = {
+static struct gpio_keys_button pb44_gpio_keys[] __initdata = {
{
.desc = "soft_reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
.gpio = PB44_GPIO_SW_RESET,
.active_low = 1,
}, {
.desc = "jumpstart",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
.gpio = PB44_GPIO_SW_JUMP,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio),
pb44_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(pb44_gpio_buttons),
- pb44_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(pb44_gpio_keys),
+ pb44_gpio_keys);
}
MIPS_MACHINE(AR71XX_MACH_PB44, "PB44", "Atheros PB44", pb44_init);
#endif
};
-
-#define PB92_BUTTONS_POLL_INTERVAL 20
+#define PB92_KEYS_POLL_INTERVAL 20 /* msecs */
+#define PB92_KEYS_DEBOUNCE_INTERVAL (3 * PB92_KEYS_POLL_INTERVAL)
#define PB92_GPIO_BTN_SW4 8
#define PB92_GPIO_BTN_SW5 3
-static struct gpio_button pb92_gpio_buttons[] __initdata = {
+static struct gpio_keys_button pb92_gpio_keys[] __initdata = {
{
.desc = "sw4",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = PB92_KEYS_DEBOUNCE_INTERVAL,
.gpio = PB92_GPIO_BTN_SW4,
.active_low = 1,
}, {
.desc = "sw5",
.type = EV_KEY,
.code = BTN_1,
- .threshold = 3,
+ .debounce_interval = PB92_KEYS_DEBOUNCE_INTERVAL,
.gpio = PB92_GPIO_BTN_SW5,
.active_low = 1,
}
ar71xx_add_device_eth(0);
ar71xx_add_device_eth(1);
- ar71xx_add_device_gpio_buttons(-1, PB92_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(pb92_gpio_buttons),
- pb92_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, PB92_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(pb92_gpio_keys),
+ pb92_gpio_keys);
pb9x_pci_init();
}
#define RB4XX_GPIO_CPLD_LED4 (RB4XX_GPIO_CPLD_BASE + CPLD_GPIO_nLED4)
#define RB4XX_GPIO_CPLD_LED5 (RB4XX_GPIO_CPLD_BASE + CPLD_GPIO_nLED5)
-#define RB4XX_BUTTONS_POLL_INTERVAL 20
+#define RB4XX_KEYS_POLL_INTERVAL 20 /* msecs */
+#define RB4XX_KEYS_DEBOUNCE_INTERVAL (3 * RB4XX_KEYS_POLL_INTERVAL)
static struct gpio_led rb4xx_leds_gpio[] __initdata = {
{
},
};
-static struct gpio_button rb4xx_gpio_buttons[] __initdata = {
+static struct gpio_keys_button rb4xx_gpio_keys[] __initdata = {
{
.desc = "reset_switch",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = RB4XX_KEYS_DEBOUNCE_INTERVAL,
.gpio = RB4XX_GPIO_RESET_SWITCH,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
rb4xx_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(rb4xx_gpio_buttons),
- rb4xx_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, RB4XX_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(rb4xx_gpio_keys),
+ rb4xx_gpio_keys);
spi_register_board_info(rb4xx_spi_info, ARRAY_SIZE(rb4xx_spi_info));
platform_device_register(&rb4xx_spi_device);
#define TEW_632BRP_GPIO_BTN_WPS 12
#define TEW_632BRP_GPIO_BTN_RESET 21
-#define TEW_632BRP_BUTTONS_POLL_INTERVAL 20
+#define TEW_632BRP_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TEW_632BRP_KEYS_DEBOUNCE_INTERVAL (3 * TEW_632BRP_KEYS_POLL_INTERVAL)
#define TEW_632BRP_CONFIG_ADDR 0x1f020000
#define TEW_632BRP_CONFIG_SIZE 0x10000
}
};
-static struct gpio_button tew_632brp_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tew_632brp_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TEW_632BRP_KEYS_DEBOUNCE_INTERVAL,
.gpio = TEW_632BRP_GPIO_BTN_RESET,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TEW_632BRP_KEYS_DEBOUNCE_INTERVAL,
.gpio = TEW_632BRP_GPIO_BTN_WPS,
}
};
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tew_632brp_leds_gpio),
tew_632brp_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TEW_632BRP_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tew_632brp_gpio_buttons),
- tew_632brp_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TEW_632BRP_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tew_632brp_gpio_keys),
+ tew_632brp_gpio_keys);
ar9xxx_add_device_wmac(eeprom, wlan_mac);
}
#define TL_MR3X20_GPIO_USB_POWER 6
-#define TL_MR3X20_BUTTONS_POLL_INTERVAL 20
+#define TL_MR3X20_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_MR3X20_KEYS_DEBOUNCE_INTERVAL (3 * TL_MR3X20_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_mr3x20_partitions[] = {
}
};
-static struct gpio_button tl_mr3x20_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_mr3x20_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TL_MR3X20_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_MR3X20_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TL_MR3X20_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_MR3X20_GPIO_BTN_QSS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_mr3x20_leds_gpio),
tl_mr3x20_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TL_MR3X20_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_mr3x20_gpio_buttons),
- tl_mr3x20_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_MR3X20_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_mr3x20_gpio_keys),
+ tl_mr3x20_gpio_keys);
ar71xx_eth1_data.has_ar7240_switch = 1;
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
#define TL_WA901ND_V2_GPIO_BTN_RESET 3
#define TL_WA901ND_V2_GPIO_BTN_QSS 7
-#define TL_WA901ND_V2_BUTTONS_POLL_INTERVAL 20
-
+#define TL_WA901ND_V2_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WA901ND_V2_KEYS_DEBOUNCE_INTERVAL \
+ (3 * TL_WA901ND_V2_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_wa901nd_v2_partitions[] = {
{
}
};
-static struct gpio_button tl_wa901nd_v2_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_wa901nd_v2_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TL_WA901ND_V2_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WA901ND_V2_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TL_WA901ND_V2_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WA901ND_V2_GPIO_BTN_QSS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wa901nd_v2_leds_gpio),
tl_wa901nd_v2_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TL_WA901ND_V2_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wa901nd_v2_gpio_buttons),
- tl_wa901nd_v2_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_WA901ND_V2_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wa901nd_v2_gpio_keys),
+ tl_wa901nd_v2_gpio_keys);
ar9xxx_add_device_wmac(eeprom, mac);
}
#define TL_WA901ND_GPIO_BTN_RESET 11
#define TL_WA901ND_GPIO_BTN_QSS 12
-#define TL_WA901ND_BUTTONS_POLL_INTERVAL 20
+#define TL_WA901ND_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WA901ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WA901ND_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_wa901nd_partitions[] = {
}
};
-static struct gpio_button tl_wa901nd_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_wa901nd_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = TL_WA901ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WA901ND_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = BTN_1,
- .threshold = 3,
+ .debounce_interval = TL_WA901ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WA901ND_GPIO_BTN_QSS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wa901nd_leds_gpio),
tl_wa901nd_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TL_WA901ND_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wa901nd_gpio_buttons),
- tl_wa901nd_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_WA901ND_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wa901nd_gpio_keys),
+ tl_wa901nd_gpio_keys);
ap91_pci_init(ee, mac);
}
#define TL_WR1043ND_GPIO_RTL8366_SDA 18
#define TL_WR1043ND_GPIO_RTL8366_SCK 19
-#define TL_WR1043ND_BUTTONS_POLL_INTERVAL 20
+#define TL_WR1043ND_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WR1043ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR1043ND_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_wr1043nd_partitions[] = {
}
};
-static struct gpio_button tl_wr1043nd_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_wr1043nd_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TL_WR1043ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR1043ND_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TL_WR1043ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR1043ND_GPIO_BTN_QSS,
.active_low = 1,
}
platform_device_register(&tl_wr1043nd_rtl8366rb_device);
- ar71xx_add_device_gpio_buttons(-1, TL_WR1043ND_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wr1043nd_gpio_buttons),
- tl_wr1043nd_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_WR1043ND_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr1043nd_gpio_keys),
+ tl_wr1043nd_gpio_keys);
ar9xxx_add_device_wmac(eeprom, mac);
}
#define TL_WR741ND_GPIO_BTN_RESET 11
#define TL_WR741ND_GPIO_BTN_QSS 12
-#define TL_WR741ND_BUTTONS_POLL_INTERVAL 20
+#define TL_WR741ND_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WR741ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR741ND_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_wr741nd_partitions[] = {
}
};
-static struct gpio_button tl_wr741nd_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_wr741nd_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TL_WR741ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR741ND_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TL_WR741ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR741ND_GPIO_BTN_QSS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr741nd_leds_gpio),
tl_wr741nd_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TL_WR741ND_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wr741nd_gpio_buttons),
- tl_wr741nd_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_WR741ND_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr741nd_gpio_keys),
+ tl_wr741nd_gpio_keys);
ar71xx_eth1_data.has_ar7240_switch = 1;
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
#define TL_WR841ND_V1_GPIO_BTN_RESET 3
#define TL_WR841ND_V1_GPIO_BTN_QSS 7
-#define TL_WR841ND_V1_BUTTONS_POLL_INTERVAL 20
+#define TL_WR841ND_V1_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WR841ND_V1_KEYS_DEBOUNCE_INTERVAL \
+ (3 * TL_WR841ND_V1_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_wr841n_v1_partitions[] = {
}
};
-static struct gpio_button tl_wr841n_v1_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_wr841n_v1_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TL_WR841ND_V1_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR841ND_V1_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TL_WR841ND_V1_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR841ND_V1_GPIO_BTN_QSS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr841n_v1_leds_gpio),
tl_wr841n_v1_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TL_WR841ND_V1_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wr841n_v1_gpio_buttons),
- tl_wr841n_v1_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_WR841ND_V1_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr841n_v1_gpio_keys),
+ tl_wr841n_v1_gpio_keys);
pb42_pci_init();
}
#define TL_WR941ND_GPIO_BTN_RESET 3
#define TL_WR941ND_GPIO_BTN_QSS 7
-#define TL_WR941ND_BUTTONS_POLL_INTERVAL 20
+#define TL_WR941ND_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WR941ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition tl_wr941nd_partitions[] = {
}
};
-static struct gpio_button tl_wr941nd_gpio_buttons[] __initdata = {
+static struct gpio_keys_button tl_wr941nd_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = TL_WR941ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR941ND_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "qss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = TL_WR941ND_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WR941ND_GPIO_BTN_QSS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_leds_gpio),
tl_wr941nd_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, TL_WR941ND_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(tl_wr941nd_gpio_buttons),
- tl_wr941nd_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, TL_WR941ND_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr941nd_gpio_keys),
+ tl_wr941nd_gpio_keys);
ar9xxx_add_device_wmac(eeprom, mac);
}
#define UBNT_M_GPIO_LED_L4 7
#define UBNT_M_GPIO_BTN_RESET 12
-#define UBNT_BUTTONS_POLL_INTERVAL 20
+#define UBNT_KEYS_POLL_INTERVAL 20 /* msecs */
+#define UBNT_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_KEYS_POLL_INTERVAL)
static struct gpio_led ubnt_rs_leds_gpio[] __initdata = {
{
}
};
-static struct gpio_button ubnt_gpio_buttons[] __initdata = {
+static struct gpio_keys_button ubnt_gpio_keys[] __initdata = {
{
.desc = "sw4",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = UBNT_KEYS_DEBOUNCE_INTERVAL,
.gpio = UBNT_RS_GPIO_SW4,
.active_low = 1,
}
};
-static struct gpio_button ubnt_m_gpio_buttons[] __initdata = {
+static struct gpio_keys_button ubnt_m_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = UBNT_KEYS_DEBOUNCE_INTERVAL,
.gpio = UBNT_M_GPIO_BTN_RESET,
.active_low = 1,
}
{
ar71xx_add_device_m25p80(NULL);
- ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(ubnt_gpio_buttons),
- ubnt_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, UBNT_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ubnt_gpio_keys),
+ ubnt_gpio_keys);
pb42_pci_init();
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_m_leds_gpio),
ubnt_m_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(ubnt_m_gpio_buttons),
- ubnt_m_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, UBNT_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(ubnt_m_gpio_keys),
+ ubnt_m_gpio_keys);
}
static void __init ubnt_rocket_m_setup(void)
#define WNDR3700_GPIO_RTL8366_SDA 5
#define WNDR3700_GPIO_RTL8366_SCK 7
-#define WNDR3700_BUTTONS_POLL_INTERVAL 20
+#define WNDR3700_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WNDR3700_KEYS_DEBOUNCE_INTERVAL (3 * WNDR3700_KEYS_POLL_INTERVAL)
#define WNDR3700_ETH0_MAC_OFFSET 0
#define WNDR3700_ETH1_MAC_OFFSET 0x6
}
};
-static struct gpio_button wndr3700_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wndr3700_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = WNDR3700_KEYS_DEBOUNCE_INTERVAL,
.gpio = WNDR3700_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = WNDR3700_KEYS_DEBOUNCE_INTERVAL,
.gpio = WNDR3700_GPIO_BTN_WPS,
.active_low = 1,
}, {
.desc = "wifi",
.type = EV_KEY,
.code = BTN_2,
- .threshold = 3,
+ .debounce_interval = WNDR3700_KEYS_DEBOUNCE_INTERVAL,
.gpio = WNDR3700_GPIO_BTN_WIFI,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wndr3700_leds_gpio),
wndr3700_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, WNDR3700_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(wndr3700_gpio_buttons),
- wndr3700_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, WNDR3700_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wndr3700_gpio_keys),
+ wndr3700_gpio_keys);
platform_device_register(&wndr3700_rtl8366s_device);
platform_device_register_simple("wndr3700-led-usb", -1, NULL, 0);
#define WNR2000_GPIO_BTN_RESET 21
#define WNR2000_GPIO_BTN_WPS 8
-#define WNR2000_BUTTONS_POLL_INTERVAL 20
+#define WNR2000_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WNR2000_KEYS_DEBOUNCE_INTERVAL (3 * WNR2000_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition wnr2000_partitions[] = {
}
};
-static struct gpio_button wnr2000_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wnr2000_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = WNR2000_KEYS_DEBOUNCE_INTERVAL,
.gpio = WNR2000_GPIO_BTN_RESET,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = WNR2000_KEYS_DEBOUNCE_INTERVAL,
.gpio = WNR2000_GPIO_BTN_WPS,
}
};
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wnr2000_leds_gpio),
wnr2000_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, WNR2000_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(wnr2000_gpio_buttons),
- wnr2000_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, WNR2000_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wnr2000_gpio_keys),
+ wnr2000_gpio_keys);
ar9xxx_add_device_wmac(eeprom, NULL);
#define WP543_GPIO_LED_DIAG 7
#define WP543_GPIO_SW4 8
-#define WP543_BUTTONS_POLL_INTERVAL 20
+#define WP543_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WP543_KEYS_DEBOUNCE_INTERVAL (3 * WP543_KEYS_POLL_INTERVAL)
static struct gpio_led wp543_leds_gpio[] __initdata = {
{
}
};
-static struct gpio_button wp543_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wp543_gpio_keys[] __initdata = {
{
.desc = "sw6",
.type = EV_KEY,
.code = BTN_0,
- .threshold = 3,
+ .debounce_interval = WP543_KEYS_DEBOUNCE_INTERVAL,
.gpio = WP543_GPIO_SW6,
}, {
.desc = "sw4",
.type = EV_KEY,
.code = BTN_1,
- .threshold = 3,
+ .debounce_interval = WP543_KEYS_DEBOUNCE_INTERVAL,
.gpio = WP543_GPIO_SW4,
}
};
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wp543_leds_gpio),
wp543_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, WP543_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(wp543_gpio_buttons),
- wp543_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, WP543_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wp543_gpio_keys),
+ wp543_gpio_keys);
}
MIPS_MACHINE(AR71XX_MACH_WP543, "WP543", "Compex WP543", wp543_setup);
#define WRT160NL_GPIO_BTN_WPS 7
#define WRT160NL_GPIO_BTN_RESET 21
-#define WRT160NL_BUTTONS_POLL_INTERVAL 20
+#define WRT160NL_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WRT160NL_KEYS_DEBOUNCE_INTERVAL (3 * WRT160NL_KEYS_POLL_INTERVAL)
#define WRT160NL_NVRAM_ADDR 0x1f7e0000
#define WRT160NL_NVRAM_SIZE 0x10000
}
};
-static struct gpio_button wrt160nl_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wrt160nl_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = WRT160NL_KEYS_DEBOUNCE_INTERVAL,
.gpio = WRT160NL_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wps",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = WRT160NL_KEYS_DEBOUNCE_INTERVAL,
.gpio = WRT160NL_GPIO_BTN_WPS,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wrt160nl_leds_gpio),
wrt160nl_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, WRT160NL_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(wrt160nl_gpio_buttons),
- wrt160nl_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, WRT160NL_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wrt160nl_gpio_keys),
+ wrt160nl_gpio_keys);
}
#define WRT400N_GPIO_BTN_RESET 8
#define WRT400N_GPIO_BTN_WLSEC 3
-#define WRT400N_BUTTONS_POLL_INTERVAL 20
+#define WRT400N_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WRT400N_KEYS_DEBOUNE_INTERVAL (3 * WRT400N_KEYS_POLL_INTERVAL)
#define WRT400N_MAC_ADDR_OFFSET 0x120c
#define WRT400N_CALDATA0_OFFSET 0x1000
}
};
-static struct gpio_button wrt400n_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wrt400n_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = WRT400N_KEYS_DEBOUNE_INTERVAL,
.gpio = WRT400N_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "wlsec",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = WRT400N_KEYS_DEBOUNE_INTERVAL,
.gpio = WRT400N_GPIO_BTN_WLSEC,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wrt400n_leds_gpio),
wrt400n_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, WRT400N_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(wrt400n_gpio_buttons),
- wrt400n_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, WRT400N_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wrt400n_gpio_keys),
+ wrt400n_gpio_keys);
ap94_pci_init(art + WRT400N_CALDATA0_OFFSET, NULL,
art + WRT400N_CALDATA1_OFFSET, NULL);
#define WZRHPG300NH_GPIO_BTN_ROUTER_AUTO (WZRHPG300NH_GPIO_EXP_BASE + 6)
#define WZRHPG300NH_GPIO_BTN_QOS_OFF (WZRHPG300NH_GPIO_EXP_BASE + 7)
-#define WZRHPG300NH_BUTTONS_POLL_INTERVAL 20
+#define WZRHPG300NH_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL (3 * WZRHPG300NH_KEYS_POLL_INTERVAL)
#define WZRHPG300NH_MAC_OFFSET 0x20c
}
};
-static struct gpio_button wzrhpg300nh_gpio_buttons[] __initdata = {
+static struct gpio_keys_button wzrhpg300nh_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_RESET,
.active_low = 1,
}, {
.desc = "aoss",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_AOSS,
.active_low = 1,
}, {
.desc = "usb",
.type = EV_KEY,
.code = BTN_2,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_USB,
.active_low = 1,
}, {
.desc = "qos_on",
.type = EV_KEY,
.code = BTN_3,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_QOS_ON,
.active_low = 0,
}, {
.desc = "qos_off",
.type = EV_KEY,
.code = BTN_4,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_QOS_OFF,
.active_low = 0,
}, {
.desc = "router_on",
.type = EV_KEY,
.code = BTN_5,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_ROUTER_ON,
.active_low = 0,
}, {
.desc = "router_auto",
.type = EV_KEY,
.code = BTN_6,
- .threshold = 3,
+ .debounce_interval = WZRHPG300NH_KEYS_DEBOUNCE_INTERVAL,
.gpio = WZRHPG300NH_GPIO_BTN_ROUTER_AUTO,
.active_low = 0,
}
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh_leds_gpio),
wzrhpg300nh_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, WZRHPG300NH_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(wzrhpg300nh_gpio_buttons),
- wzrhpg300nh_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, WZRHPG300NH_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(wzrhpg300nh_gpio_keys),
+ wzrhpg300nh_gpio_keys);
}
#define ZCN_1523H_5_GPIO_LED_MEDIUM 15
#define ZCN_1523H_5_GPIO_LED_STRONG 16
-#define ZCN_1523H_BUTTONS_POLL_INTERVAL 20
+#define ZCN_1523H_KEYS_POLL_INTERVAL 20 /* msecs */
+#define ZCN_1523H_KEYS_DEBOUNCE_INTERVAL (3 * ZCN_1523H_KEYS_POLL_INTERVAL)
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition zcn_1523h_partitions[] = {
#endif
};
-static struct gpio_button zcn_1523h_gpio_buttons[] __initdata = {
+static struct gpio_keys_button zcn_1523h_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
- .threshold = 3,
+ .debounce_interval = ZCN_1523H_KEYS_DEBOUNCE_INTERVAL,
.gpio = ZCN_1523H_GPIO_BTN_RESET,
.active_low = 1,
}
ar71xx_add_device_leds_gpio(0, ARRAY_SIZE(zcn_1523h_leds_gpio),
zcn_1523h_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, ZCN_1523H_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(zcn_1523h_gpio_buttons),
- zcn_1523h_gpio_buttons);
+ ar71xx_register_gpio_keys_polled(-1, ZCN_1523H_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(zcn_1523h_gpio_keys),
+ zcn_1523h_gpio_keys);
ap91_pci_init(ee, mac);