ar71xx: add common m25p80 device
[openwrt-10.03/.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-tl-wr1043nd.c
index d4dcd5a33327af00d8eee8a604425cb95bae9c91..d612335f9a47bf7b2278bd345ef73d4a9f8f7d40 100644 (file)
@@ -11,8 +11,6 @@
 #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>
@@ -20,6 +18,7 @@
 #include <asm/mach-ar71xx/ar71xx.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define TL_WR1043ND_GPIO_LED_SYSTEM     2
 #define TL_WR1043ND_GPIO_LED_QSS        5
@@ -64,16 +63,6 @@ static struct flash_platform_data tl_wr1043nd_flash_data = {
 #endif
 };
 
-static struct spi_board_info tl_wr1043nd_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &tl_wr1043nd_flash_data,
-       }
-};
-
 static struct gpio_led tl_wr1043nd_leds_gpio[] __initdata = {
        {
                .name           = "tl-wr1043nd:green:system",
@@ -121,8 +110,7 @@ static void __init tl_wr1043nd_setup(void)
 
        ar71xx_add_device_usb();
 
-       ar71xx_add_device_spi(NULL, tl_wr1043nd_spi_info,
-                                       ARRAY_SIZE(tl_wr1043nd_spi_info));
+       ar71xx_add_device_m25p80(&tl_wr1043nd_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr1043nd_leds_gpio),
                                        tl_wr1043nd_leds_gpio);