ar71xx: add common m25p80 device
authorGabor Juhos <juhosg@openwrt.org>
Fri, 18 Dec 2009 12:56:55 +0000 (12:56 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Fri, 18 Dec 2009 12:56:55 +0000 (12:56 +0000)
SVN-Revision: 18817

22 files changed:
target/linux/ar71xx/config-2.6.30
target/linux/ar71xx/config-2.6.31
target/linux/ar71xx/config-2.6.32
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.c [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.h [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ar71xx/mach-ap81.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-aw-nr580.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-825-b1.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-mzk-w300nh.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-pb42.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr1043nd.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr941nd.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wnr2000.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt160nl.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wrt400n.c

index 66b1b8fb34fa80e830ebd1c0d30b24a3ee266cbb..842424de60c05ab1ae6d0a9bb085434f0577f417 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_32BIT=y
 CONFIG_AG71XX=y
 CONFIG_AG71XX_AR8216_SUPPORT=y
 # CONFIG_AG71XX_DEBUG is not set
+CONFIG_AR71XX_DEV_M25P80=y
 CONFIG_AR71XX_MACH_AP81=y
 CONFIG_AR71XX_MACH_AP83=y
 CONFIG_AR71XX_MACH_AW_NR580=y
index b699e4b81a1ad97ee9cf754bd3eb1a46838ec653..b506467e50be62fa56d31427357dbed066d577bd 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_AG71XX_AR8216_SUPPORT=y
 # CONFIG_AG71XX_DEBUG is not set
 # CONFIG_ALCHEMY_GPIO_INDIRECT is not set
 # CONFIG_AR7 is not set
+CONFIG_AR71XX_DEV_M25P80=y
 CONFIG_AR71XX_MACH_AP81=y
 CONFIG_AR71XX_MACH_AP83=y
 CONFIG_AR71XX_MACH_AW_NR580=y
index cedfa8e72faab6fce4891d1bb1cff69002d915b1..70cd31f482fc48d23e13a4f00d13929dceda7238 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_AG71XX_AR8216_SUPPORT=y
 # CONFIG_AG71XX_DEBUG is not set
 # CONFIG_ALCHEMY_GPIO_INDIRECT is not set
 # CONFIG_AR7 is not set
+CONFIG_AR71XX_DEV_M25P80=y
 CONFIG_AR71XX_MACH_AP81=y
 CONFIG_AR71XX_MACH_AP83=y
 CONFIG_AR71XX_MACH_AW_NR580=y
index c06038cada800668138c358eaf7b056d86c6568c..6ab6eefa9cfb5c658f88261649f7a84be52821e9 100644 (file)
@@ -4,6 +4,7 @@ menu "Atheros AR71xx machine selection"
 
 config AR71XX_MACH_AP81
        bool "Atheros AP81 board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_AP83
@@ -12,10 +13,12 @@ config AR71XX_MACH_AP83
 
 config AR71XX_MACH_DIR_825_B1
        bool "D-Link DIR-825 rev. B1 board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_PB42
        bool "Atheros PB42 board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_PB44
@@ -24,6 +27,7 @@ config AR71XX_MACH_PB44
 
 config AR71XX_MACH_AW_NR580
        bool "AzureWave AW-NR580 board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_GENERIC
@@ -33,14 +37,17 @@ config AR71XX_MACH_GENERIC
 config AR71XX_MACH_WP543
        bool "Compex WP543/WPJ543 board support"
        select MYLOADER
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_WRT160NL
        bool "Linksys WRT160NL board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_WRT400N
        bool "Linksys WRT400N board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_RB_4XX
@@ -49,40 +56,52 @@ config AR71XX_MACH_RB_4XX
 
 config AR71XX_MACH_WNDR3700
        bool "NETGEAR WNDR3700 board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_WNR2000
        bool "NETGEAR WNR2000 board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_MZK_W04NU
        bool "Planex MZK-W04NU board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_MZK_W300NH
        bool "Planex MZK-W300NH board support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_TL_WR741ND
        bool "TP-LINK TL-WR741ND support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_TL_WR941ND
        bool "TP-LINK TL-WR941ND support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_TL_WR1043ND
        bool "TP-LINK TL-WR1043ND support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_TEW_632BRP
        bool "TRENDnet TEW-632BRP support"
+       select AR71XX_DEV_M25P80
        default y
 
 config AR71XX_MACH_UBNT
        bool "Ubiquiti AR71xx based boards support"
+       select AR71XX_DEV_M25P80
        default y
 
 endmenu
 
+config AR71XX_DEV_M25P80
+       def_bool n
+
 endif
index a7871a22a1c261bd5bdc5cf37f4ce70b9e923609..1b9bdafd82fce197ae725b6b3241162c6b288d8f 100644 (file)
@@ -13,6 +13,8 @@ obj-y := prom.o irq.o setup.o devices.o gpio.o ar71xx.o
 obj-$(CONFIG_EARLY_PRINTK)             += early_printk.o
 obj-$(CONFIG_PCI)                      += pci.o
 
+obj-$(CONFIG_AR71XX_DEV_M25P80)                += dev-m25p80.o
+
 obj-$(CONFIG_AR71XX_MACH_AP81)         += mach-ap81.o
 obj-$(CONFIG_AR71XX_MACH_AP83)         += mach-ap83.o
 obj-$(CONFIG_AR71XX_MACH_AW_NR580)     += mach-aw-nr580.o
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.c
new file mode 100644 (file)
index 0000000..666b508
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+
+#include "devices.h"
+#include "dev-m25p80.h"
+
+static struct spi_board_info ar71xx_spi_info[] = {
+       {
+               .bus_num        = 0,
+               .chip_select    = 0,
+               .max_speed_hz   = 25000000,
+               .modalias       = "m25p80",
+       }
+};
+
+void __init ar71xx_add_device_m25p80(struct flash_platform_data *pdata)
+{
+       ar71xx_spi_info[0].platform_data = pdata;
+       ar71xx_add_device_spi(NULL, ar71xx_spi_info,
+                             ARRAY_SIZE(ar71xx_spi_info));
+}
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.h b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.h
new file mode 100644 (file)
index 0000000..0b8e56d
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _AR71XX_DEV_M25P80_H
+#define _AR71XX_DEV_M25P80_H
+
+#include <linux/spi/flash.h>
+
+void ar71xx_add_device_m25p80(struct flash_platform_data *pdata) __init;
+
+#endif /* _AR71XX_DEV_M25P80_H */
index 418631a3ba21f7ab57df62c36eb15e4002182867..c510f85487f70f2a3546fa7160b2d5bf76525c0f 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"
 
 #define AP81_GPIO_LED_STATUS   1
 #define AP81_GPIO_LED_AOSS     3
@@ -66,16 +65,6 @@ static struct flash_platform_data ap81_flash_data = {
 #endif
 };
 
-static struct spi_board_info ap81_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &ap81_flash_data,
-       }
-};
-
 static struct gpio_led ap81_leds_gpio[] __initdata = {
        {
                .name           = "ap81:green:status",
@@ -135,8 +124,7 @@ static void __init ap81_setup(void)
 
        ar71xx_add_device_usb();
 
-       ar71xx_add_device_spi(NULL, ap81_spi_info,
-                             ARRAY_SIZE(ap81_spi_info));
+       ar71xx_add_device_m25p80(&ap81_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
                                        ap81_leds_gpio);
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);
index 4fdb9fb5b491dbac1313889c77f192cad3fd2c98..620ccd1d71430179a88b4b844b80049f8ce55877 100644 (file)
@@ -13,8 +13,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 <linux/pci.h>
 #include <linux/ath9k_platform.h>
@@ -26,6 +24,7 @@
 #include <asm/mach-ar71xx/pci.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define DIR825B1_GPIO_LED_BLUE_USB             0
 #define DIR825B1_GPIO_LED_ORANGE_POWER         1
@@ -85,16 +84,6 @@ static struct flash_platform_data dir825b1_flash_data = {
 #endif
 };
 
-static struct spi_board_info dir825b1_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &dir825b1_flash_data,
-       }
-};
-
 static struct gpio_led dir825b1_leds_gpio[] __initdata = {
        {
                .name           = "dir825b1:blue:usb",
@@ -298,8 +287,7 @@ static void __init dir825b1_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
 
-       ar71xx_add_device_spi(NULL, dir825b1_spi_info,
-                             ARRAY_SIZE(dir825b1_spi_info));
+       ar71xx_add_device_m25p80(&dir825b1_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(dir825b1_leds_gpio),
                                        dir825b1_leds_gpio);
index 49cc2ac3f79b5b4fa1df560476c0d729fc24f00e..7dea748e05fb321ef706b505fbcc5cd51906da5f 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/ar71xx.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define MZK_W300NH_GPIO_LED_STATUS     1
 #define MZK_W300NH_GPIO_LED_WPS                3
@@ -77,16 +76,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 +145,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);
index 154a1e43dc5a00cb8ad0c726644bb97dd0970e64..9a4b7a1c306abf8c2728c8c381ee26155498be41 100644 (file)
 #include <linux/bitops.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/flash.h>
 
 #include <asm/mips_machine.h>
 #include <asm/mach-ar71xx/ar71xx.h>
 #include <asm/mach-ar71xx/pci.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define PB42_BUTTONS_POLL_INTERVAL     20
 
 #define PB42_GPIO_BTN_SW4      8
 #define PB42_GPIO_BTN_SW5      3
 
-static struct spi_board_info pb42_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-       }
-};
-
 static struct ar71xx_pci_irq pb42_pci_irqs[] __initdata = {
        {
                .slot   = 0,
@@ -76,8 +66,7 @@ static struct gpio_button pb42_gpio_buttons[] __initdata = {
 
 static void __init pb42_init(void)
 {
-       ar71xx_add_device_spi(NULL, pb42_spi_info,
-                               ARRAY_SIZE(pb42_spi_info));
+       ar71xx_add_device_m25p80(NULL);
 
        ar71xx_add_device_mdio(~PB42_MDIO_PHYMASK);
 
index afb8ceebd508412eafd0bdcdb4eb42d86dc79d0a..0c81ec190c52e1b59e10e7b2fc7adcfcb0cfef07 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"
 
 #define TEW_632BRP_GPIO_LED_STATUS     1
 #define TEW_632BRP_GPIO_LED_WPS                3
@@ -69,16 +67,6 @@ static struct flash_platform_data tew_632brp_flash_data = {
 #endif
 };
 
-static struct spi_board_info tew_632brp_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &tew_632brp_flash_data,
-       }
-};
-
 static struct gpio_led tew_632brp_leds_gpio[] __initdata = {
        {
                .name           = "tew-632brp:green:status",
@@ -126,8 +114,7 @@ static void __init tew_632brp_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
 
-       ar71xx_add_device_spi(NULL, tew_632brp_spi_info,
-                                       ARRAY_SIZE(tew_632brp_spi_info));
+       ar71xx_add_device_m25p80(&tew_632brp_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tew_632brp_leds_gpio),
                                        tew_632brp_leds_gpio);
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);
index 1d13ce94dcc94a30bed99aee08f8b38d99e368f5..859ef6afdbbd4cdf3a1eedd2a6b7e8b0bbd505c1 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 <linux/ath9k_platform.h>
 
@@ -23,6 +21,7 @@
 #include <asm/mach-ar71xx/pci.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define TL_WR741ND_GPIO_LED_QSS                0
 #define TL_WR741ND_GPIO_LED_SYSTEM     1
@@ -67,16 +66,6 @@ static struct flash_platform_data tl_wr741nd_flash_data = {
 #endif
 };
 
-static struct spi_board_info tl_wr741nd_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &tl_wr741nd_flash_data,
-       }
-};
-
 static struct gpio_led tl_wr741nd_leds_gpio[] __initdata = {
        {
                .name           = "tl-wr741nd:green:system",
@@ -167,8 +156,7 @@ static void __init tl_wr741nd_setup(void)
        ar71xx_add_device_eth(1);
        ar71xx_add_device_eth(0);
 
-       ar71xx_add_device_spi(NULL, tl_wr741nd_spi_info,
-                                       ARRAY_SIZE(tl_wr741nd_spi_info));
+       ar71xx_add_device_m25p80(&tl_wr741nd_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr741nd_leds_gpio),
                                        tl_wr741nd_leds_gpio);
index 580ae19d9240ab9a0fe30248f14037880b946602..fb42cb006a3b0de93be775e3a2ffd01367b4d905 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_WR941ND_GPIO_LED_SYSTEM     2
 #define TL_WR941ND_GPIO_LED_QSS                5
@@ -64,16 +63,6 @@ static struct flash_platform_data tl_wr941nd_flash_data = {
 #endif
 };
 
-static struct spi_board_info tl_wr941nd_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &tl_wr941nd_flash_data,
-       }
-};
-
 static struct gpio_led tl_wr941nd_leds_gpio[] __initdata = {
        {
                .name           = "tl-wr941nd:green:system",
@@ -134,8 +123,7 @@ static void __init tl_wr941nd_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data);
 
-       ar71xx_add_device_spi(NULL, tl_wr941nd_spi_info,
-                                       ARRAY_SIZE(tl_wr941nd_spi_info));
+       ar71xx_add_device_m25p80(&tl_wr941nd_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_leds_gpio),
                                        tl_wr941nd_leds_gpio);
index 371ac0fc317da668ed060e2107b2095d7aac7a2a..5182cbfc45fba06922be1f461f1420e0b56b3e64 100644 (file)
@@ -12,8 +12,6 @@
 
 #include <linux/pci.h>
 #include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/flash.h>
 #include <linux/input.h>
 #include <linux/ath9k_platform.h>
 
@@ -22,6 +20,7 @@
 #include <asm/mach-ar71xx/pci.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define UBNT_RS_GPIO_LED_RF    2
 #define UBNT_RS_GPIO_SW4       8
 
 #define UBNT_BUTTONS_POLL_INTERVAL     20
 
-static struct spi_board_info ubnt_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-       }
-};
-
 static struct ar71xx_pci_irq ubnt_pci_irqs[] __initdata = {
        {
                .slot   = 0,
@@ -151,8 +141,7 @@ static struct gpio_button ubnt_m_gpio_buttons[] __initdata = {
 
 static void __init ubnt_generic_setup(void)
 {
-       ar71xx_add_device_spi(NULL, ubnt_spi_info,
-                                   ARRAY_SIZE(ubnt_spi_info));
+       ar71xx_add_device_m25p80(NULL);
 
        ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
                                        ARRAY_SIZE(ubnt_gpio_buttons),
@@ -285,8 +274,7 @@ static void __init ubnt_m_setup(void)
 
        ar71xx_set_mac_base(mac);
 
-       ar71xx_add_device_spi(NULL, ubnt_spi_info,
-                                   ARRAY_SIZE(ubnt_spi_info));
+       ar71xx_add_device_m25p80(NULL);
 
        ar71xx_add_device_mdio(~0);
 
index 729267ac461488bd668dea8db83cd3bd623b9e83..e408ef6eb09431e66bcd56b51e59d2d108fc3031 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 <linux/pci.h>
 #include <linux/ath9k_platform.h>
@@ -25,6 +23,7 @@
 #include <asm/mach-ar71xx/pci.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define WNDR3700_GPIO_LED_WPS_ORANGE   0
 #define WNDR3700_GPIO_LED_POWER_ORANGE 1
@@ -226,16 +225,6 @@ static void __init wndr3700_pci_init(void)
 static inline void wndr3700_pci_init(void) { };
 #endif /* CONFIG_PCI */
 
-static struct spi_board_info wndr3700_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &wndr3700_flash_data,
-       }
-};
-
 static struct gpio_led wndr3700_leds_gpio[] __initdata = {
        {
                .name           = "wndr3700:green:power",
@@ -314,8 +303,7 @@ static void __init wndr3700_setup(void)
 
        ar71xx_add_device_usb();
 
-       ar71xx_add_device_spi(NULL, wndr3700_spi_info,
-                             ARRAY_SIZE(wndr3700_spi_info));
+       ar71xx_add_device_m25p80(&wndr3700_flash_data);
 
         ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wndr3700_leds_gpio),
                                    wndr3700_leds_gpio);
index d766fef711e4f9012be39dfbbd36abe54d73f914..c1674e4690870cd5390d5552ea0a622ed4f2c9a4 100644 (file)
@@ -13,8 +13,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>
@@ -22,6 +20,7 @@
 #include <asm/mach-ar71xx/ar71xx.h>
 
 #include "devices.h"
+#include "dev-m25p80.h"
 
 #define WNR2000_GPIO_LED_PWR_GREEN     14
 #define WNR2000_GPIO_LED_PWR_AMBER     7
@@ -79,16 +78,6 @@ static struct flash_platform_data wnr2000_flash_data = {
 #endif
 };
 
-static struct spi_board_info wnr2000_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &wnr2000_flash_data,
-       }
-};
-
 static struct gpio_led wnr2000_leds_gpio[] __initdata = {
        {
                .name           = "wnr2000:green:power",
@@ -144,8 +133,7 @@ static void __init wnr2000_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
 
-       ar71xx_add_device_spi(NULL, wnr2000_spi_info,
-                                       ARRAY_SIZE(wnr2000_spi_info));
+       ar71xx_add_device_m25p80(&wnr2000_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wnr2000_leds_gpio),
                                        wnr2000_leds_gpio);
index 9f1111dae1b370c295ec3fc5b6660c28760f319a..04d344650209b0a17bb9a20198a44ab4c011866e 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 WP543_GPIO_SW6         2
 #define WP543_GPIO_LED_1       3
 
 #define WP543_BUTTONS_POLL_INTERVAL    20
 
-static struct spi_board_info wp543_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-       }
-};
-
 static struct ar71xx_pci_irq wp543_pci_irqs[] __initdata = {
        {
                .slot   = 0,
@@ -99,7 +89,7 @@ static struct gpio_button wp543_gpio_buttons[] __initdata = {
 
 static void __init wp543_setup(void)
 {
-       ar71xx_add_device_spi(NULL, wp543_spi_info, ARRAY_SIZE(wp543_spi_info));
+       ar71xx_add_device_m25p80(NULL);
 
        ar71xx_add_device_mdio(0xfffffff7);
 
index ca811d3566dbd8b55f26a7b4d73387b3e68c872b..da8bd9bbe2c8f4ea635374a8f94ad967ba447d91 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"
 
 #define WRT160NL_GPIO_LED_POWER                14
 #define WRT160NL_GPIO_LED_WPS_AMBER    9
@@ -70,16 +69,6 @@ static struct flash_platform_data wrt160nl_flash_data = {
 #endif
 };
 
-static struct spi_board_info wrt160nl_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &wrt160nl_flash_data,
-       }
-};
-
 static struct gpio_led wrt160nl_leds_gpio[] __initdata = {
        {
                .name           = "wrt160nl:blue:power",
@@ -132,8 +121,7 @@ static void __init wrt160nl_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
 
-       ar71xx_add_device_spi(NULL, wrt160nl_spi_info,
-                             ARRAY_SIZE(wrt160nl_spi_info));
+       ar71xx_add_device_m25p80(&wrt160nl_flash_data);
 
        ar71xx_add_device_usb();
        ar91xx_add_device_wmac();
index 0298b1a6bf5fe35d0fc93a541fa28c84709eccd1..91de9adbc60a4b57d4fba32c9e3c3f3ba3b85037 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"
 
 #define WRT400N_GPIO_LED_ORANGE        5
 #define WRT400N_GPIO_LED_GREEN 4
@@ -86,16 +85,6 @@ static struct flash_platform_data wrt400n_flash_data = {
 #endif
 };
 
-static struct spi_board_info wrt400n_spi_info[] = {
-       {
-               .bus_num        = 0,
-               .chip_select    = 0,
-               .max_speed_hz   = 25000000,
-               .modalias       = "m25p80",
-               .platform_data  = &wrt400n_flash_data,
-       }
-};
-
 static struct gpio_led wrt400n_leds_gpio[] __initdata = {
        {
                .name           = "wrt400n:green:status",
@@ -150,8 +139,7 @@ static void __init wrt400n_setup(void)
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
 
-       ar71xx_add_device_spi(NULL, wrt400n_spi_info,
-                             ARRAY_SIZE(wrt400n_spi_info));
+       ar71xx_add_device_m25p80(&wrt400n_flash_data);
 
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wrt400n_leds_gpio),
                                        wrt400n_leds_gpio);