aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c
index 219b832ee3..59802d4b8d 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb44.c
@@ -54,6 +54,9 @@
#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,
@@ -90,19 +93,19 @@ static struct gpio_led pb44_leds_gpio[] __initdata = {
},
};
-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,
}
@@ -202,8 +205,9 @@ static void __init pb44_init(void)
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);