ar71xx: add common m25p80 device
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-aw-nr580.c
index 1e8c2baec986f4303d9379ca498c1076f7461fd9..d8bed69340f07505947d2bd8b779cc5ef9e38c98 100644 (file)
@@ -12,8 +12,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>
@@ -21,6 +19,7 @@
 #include <asm/mach-ar71xx/pci.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define AW_NR580_GPIO_LED_READY_RED    0
 #define AW_NR580_GPIO_LED_WLAN         1
 
 #define AW_NR580_BUTTONS_POLL_INTERVAL 20
 
-static struct spi_board_info aw_nr580_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-       }
-};
-
 static struct gpio_led aw_nr580_leds_gpio[] __initdata = {
        {
                .name           = "aw-nr580:red:ready",
@@ -105,8 +95,7 @@ static void __init aw_nr580_setup(void)
 
        ar71xx_pci_init(ARRAY_SIZE(aw_nr580_pci_irqs), aw_nr580_pci_irqs);
 
-       ar71xx_add_device_spi(NULL, aw_nr580_spi_info,
-                                       ARRAY_SIZE(aw_nr580_spi_info));
+       ar71xx_add_device_m25p80(NULL);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(aw_nr580_leds_gpio),
                                        aw_nr580_leds_gpio);