ar71xx: use the gpio_keys_polled driver instead of gpio_buttons
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-dir-825-b1.c
index 6b4bc7608571108941182b9dfa0d595c1ee1576c..84fb184c0bc424343050654e9d46c28ff0bec58b 100644 (file)
@@ -39,7 +39,8 @@
 #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
@@ -112,19 +113,19 @@ static struct gpio_led dir825b1_leds_gpio[] __initdata = {
        }
 };
 
-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,
        }
@@ -176,9 +177,9 @@ static void __init dir825b1_setup(void)
        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();