ar71xx: move gpio-buttons support into a spearate file
[librecmc/librecmc.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-ap83.c
index 111ea4a3dd55a1c47fbcac5d1efa1bbfd5ef6d66..93072a36015c1fef51eb146ebefdfe86b84d8084 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <linux/delay.h>
 #include <linux/platform_device.h>
-#include <linux/input.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
@@ -23,6 +22,9 @@
 #include <asm/mach-ar71xx/ar91xx_flash.h>
 
 #include "devices.h"
+#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
 
 #define AP83_GPIO_LED_WLAN     6
 #define AP83_GPIO_LED_POWER    14
@@ -35,6 +37,8 @@
 #define AP83_050_GPIO_VSC7385_MOSI     16
 #define AP83_050_GPIO_VSC7385_SCK      17
 
+#define AP83_BUTTONS_POLL_INTERVAL     20
+
 #ifdef CONFIG_MTD_PARTITIONS
 static struct mtd_partition ap83_flash_partitions[] = {
        {
@@ -169,6 +173,11 @@ static void ap83_vsc7385_reset(void)
 static struct vsc7385_platform_data ap83_vsc7385_data = {
        .reset          = ap83_vsc7385_reset,
        .ucode_name     = "vsc7385_ucode_ap83.bin",
+       .mac_cfg = {
+               .tx_ipg         = 6,
+               .bit2           = 0,
+               .clk_sel        = 3,
+       },
 };
 
 static struct spi_board_info ap83_spi_info[] = {
@@ -207,12 +216,13 @@ static void __init ap83_generic_setup(void)
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
                                        ap83_leds_gpio);
 
-       ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons),
+       ar71xx_add_device_gpio_buttons(-1, AP83_BUTTONS_POLL_INTERVAL,
+                                       ARRAY_SIZE(ap83_gpio_buttons),
                                        ap83_gpio_buttons);
 
        ar71xx_add_device_usb();
 
-       ar91xx_add_device_wmac();
+       ar913x_add_device_wmac();
 
        platform_device_register(&ap83_flash_device);