ar71xx: move gpio-buttons support into a spearate file
[librecmc/librecmc.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-mzk-w300nh.c
index 4d363c84d97b969fa849449b6efcc93ac529339c..bf72ccb9c9d077201090fa6673847f1b830abede 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/flash.h>
-#include <linux/input.h>
 
 #include <asm/mips_machine.h>
-
 #include <asm/mach-ar71xx/ar71xx.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
+#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
 
 #define MZK_W300NH_GPIO_LED_STATUS     1
 #define MZK_W300NH_GPIO_LED_WPS                3
@@ -63,7 +63,7 @@ static struct mtd_partition mzk_w300nh_partitions[] = {
                .size           = 0x020000,
                .mask_flags     = MTD_WRITEABLE,
        } , {
-               .name           = "firmare",
+               .name           = "firmware",
                .offset         = 0x050000,
                .size           = 0x770000,
        }
@@ -77,16 +77,6 @@ static struct flash_platform_data mzk_w300nh_flash_data = {
 #endif
 };
 
-static struct spi_board_info mzk_w300nh_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &mzk_w300nh_flash_data,
-       }
-};
-
 static struct gpio_led mzk_w300nh_leds_gpio[] __initdata = {
        {
                .name           = "mzk-w300nh:green:status",
@@ -156,8 +146,7 @@ static void __init mzk_w300nh_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
 
-       ar71xx_add_device_spi(NULL, mzk_w300nh_spi_info,
-                             ARRAY_SIZE(mzk_w300nh_spi_info));
+       ar71xx_add_device_m25p80(&mzk_w300nh_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(mzk_w300nh_leds_gpio),
                                    mzk_w300nh_leds_gpio);
@@ -165,7 +154,7 @@ static void __init mzk_w300nh_setup(void)
        ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
                                       ARRAY_SIZE(mzk_w300nh_gpio_buttons),
                                       mzk_w300nh_gpio_buttons);
-       ar91xx_add_device_wmac();
+       ar913x_add_device_wmac();
 }
 
 MIPS_MACHINE(AR71XX_MACH_MZK_W300NH, "Planex MZK-W300NH", mzk_w300nh_setup);