ar71xx: use the gpio_keys_polled driver instead of gpio_buttons
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / dev-gpio-buttons.c
index df7416de1f701c50185d11edd6aa6d2eeb0228df..c22e652f190e7be1286076f444a7e5bf286bb7c5 100644 (file)
  */
 
 #include "linux/init.h"
+#include "linux/slab.h"
 #include <linux/platform_device.h>
 
 #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);
@@ -30,7 +31,7 @@ void __init ar71xx_add_device_gpio_buttons(int id,
 
        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;
 
@@ -43,7 +44,6 @@ void __init ar71xx_add_device_gpio_buttons(int id,
        if (err)
                goto err_put_pdev;
 
-
        err = platform_device_add(pdev);
        if (err)
                goto err_put_pdev;