From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 52/61] ARM: imx: dynamically register spi_imx devices (imx31)
Date: Thu, 24 Jun 2010 15:49:48 +0200 [thread overview]
Message-ID: <1277387397-3467-53-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1277387397-3467-1-git-send-email-u.kleine-koenig@pengutronix.de>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
arch/arm/mach-mx3/Kconfig | 4 ++++
arch/arm/mach-mx3/devices-imx31.h | 7 +++++++
arch/arm/mach-mx3/devices.c | 2 +-
arch/arm/mach-mx3/devices.h | 2 ++
arch/arm/mach-mx3/mach-mx31_3ds.c | 5 ++---
arch/arm/mach-mx3/mach-mx31lilly.c | 10 +++++-----
arch/arm/mach-mx3/mach-mx31lite.c | 5 ++---
arch/arm/mach-mx3/mach-mx31moboard.c | 8 ++++----
arch/arm/mach-mx3/mx31lite-db.c | 6 +++---
9 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index b8a7610..60d58a6 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -55,6 +55,7 @@ config MACH_MX31LITE
select ARCH_MX31
select MXC_ULPI if USB_ULPI
select IMX_HAVE_PLATFORM_MXC_NAND
+ select IMX_HAVE_PLATFORM_SPI_IMX
help
Include support for MX31 LITEKIT platform. This includes specific
configurations for the board and its peripherals.
@@ -63,6 +64,7 @@ config MACH_MX31_3DS
bool "Support MX31PDK (3DS)"
select ARCH_MX31
select IMX_HAVE_PLATFORM_MXC_NAND
+ select IMX_HAVE_PLATFORM_SPI_IMX
help
Include support for MX31PDK (3DS) platform. This includes specific
configurations for the board and its peripherals.
@@ -80,6 +82,7 @@ config MACH_MX31MOBOARD
bool "Support mx31moboard platforms (EPFL Mobots group)"
select ARCH_MX31
select IMX_HAVE_PLATFORM_IMX_I2C
+ select IMX_HAVE_PLATFORM_SPI_IMX
select MXC_ULPI if USB_ULPI
help
Include support for mx31moboard platform. This includes specific
@@ -88,6 +91,7 @@ config MACH_MX31MOBOARD
config MACH_MX31LILLY
bool "Support MX31 LILLY-1131 platforms (INCO startec)"
select ARCH_MX31
+ select IMX_HAVE_PLATFORM_SPI_IMX
select MXC_ULPI if USB_ULPI
help
Include support for mx31 based LILLY1131 modules. This includes
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h
index 56bc1e1..1cf96ca 100644
--- a/arch/arm/mach-mx3/devices-imx31.h
+++ b/arch/arm/mach-mx3/devices-imx31.h
@@ -18,3 +18,10 @@
#define imx31_add_mxc_nand(pdata) \
imx_add_mxc_nand_v1(MX31_NFC_BASE_ADDR, MX31_INT_NANDFC, pdata)
+
+#define imx31_add_spi_imx0(pdata) \
+ imx_add_spi_imx(0, MX31_CSPI1_BASE_ADDR, SZ_4K, MX31_INT_CSPI1, pdata)
+#define imx31_add_spi_imx1(pdata) \
+ imx_add_spi_imx(1, MX31_CSPI2_BASE_ADDR, SZ_4K, MX31_INT_CSPI2, pdata)
+#define imx31_add_spi_imx2(pdata) \
+ imx_add_spi_imx(2, MX31_CSPI3_BASE_ADDR, SZ_4K, MX31_INT_CSPI3, pdata)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index a285b16..02d05ea 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -379,6 +379,7 @@ struct platform_device mxc_usbh2 = {
.num_resources = ARRAY_SIZE(mxc_usbh2_resources),
};
+#if defined(CONFIG_ARCH_MX35)
/*
* SPI master controller
* 3 channels
@@ -440,7 +441,6 @@ struct platform_device mxc_spi_device2 = {
.resource = mxc_spi_2_resources,
};
-#ifdef CONFIG_ARCH_MX35
static struct resource mxc_fec_resources[] = {
{
.start = MXC_FEC_BASE_ADDR,
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index c50596a..d22a327 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -16,9 +16,11 @@ extern struct platform_device mxc_otg_host;
extern struct platform_device mxc_usbh1;
extern struct platform_device mxc_usbh2;
extern struct platform_device mxc_rnga_device;
+#if defined(CONFIG_ARCH_MX35)
extern struct platform_device mxc_spi_device0;
extern struct platform_device mxc_spi_device1;
extern struct platform_device mxc_spi_device2;
+#endif
extern struct platform_device imx_ssi_device0;
extern struct platform_device imx_ssi_device1;
extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index c730c09..2aa3e58 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -35,7 +35,6 @@
#include <mach/common.h>
#include <mach/imx-uart.h>
#include <mach/iomux-mx3.h>
-#include <mach/spi.h>
#include "devices-imx31.h"
#include "devices.h"
@@ -170,7 +169,7 @@ static int spi1_internal_chipselect[] = {
MXC_SPI_CS(2),
};
-static struct spi_imx_master spi1_pdata = {
+static const struct spi_imx_master spi1_pdata __initconst = {
.chipselect = spi1_internal_chipselect,
.num_chipselect = ARRAY_SIZE(spi1_internal_chipselect),
};
@@ -419,7 +418,7 @@ static void __init mxc_board_init(void)
mxc_register_device(&mxc_uart_device0, &uart_pdata);
imx31_add_mxc_nand(&mx31_3ds_nand_board_info);
- mxc_register_device(&mxc_spi_device1, &spi1_pdata);
+ imx31_add_spi_imx0(&spi1_pdata);
spi_register_board_info(mx31_3ds_spi_devs,
ARRAY_SIZE(mx31_3ds_spi_devs));
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c
index b4cfbe0..9d6a6cc 100644
--- a/arch/arm/mach-mx3/mach-mx31lilly.c
+++ b/arch/arm/mach-mx3/mach-mx31lilly.c
@@ -42,10 +42,10 @@
#include <mach/common.h>
#include <mach/iomux-mx3.h>
#include <mach/board-mx31lilly.h>
-#include <mach/spi.h>
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>
+#include "devices-imx31.h"
#include "devices.h"
/*
@@ -265,12 +265,12 @@ static int spi_internal_chipselect[] = {
MXC_SPI_CS(2),
};
-static struct spi_imx_master spi0_pdata = {
+static const struct spi_imx_master spi0_pdata __initconst = {
.chipselect = spi_internal_chipselect,
.num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
};
-static struct spi_imx_master spi1_pdata = {
+static const struct spi_imx_master spi1_pdata __initconst = {
.chipselect = spi_internal_chipselect,
.num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
};
@@ -327,8 +327,8 @@ static void __init mx31lilly_board_init(void)
mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1");
mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2");
- mxc_register_device(&mxc_spi_device0, &spi0_pdata);
- mxc_register_device(&mxc_spi_device1, &spi1_pdata);
+ imx31_add_spi_imx0(&spi0_pdata);
+ imx31_add_spi_imx1(&spi1_pdata);
spi_register_board_info(&mc13783_dev, 1);
platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c
index f0a68e6..634b855 100644
--- a/arch/arm/mach-mx3/mach-mx31lite.c
+++ b/arch/arm/mach-mx3/mach-mx31lite.c
@@ -41,7 +41,6 @@
#include <mach/imx-uart.h>
#include <mach/iomux-mx3.h>
#include <mach/irqs.h>
-#include <mach/spi.h>
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>
@@ -109,7 +108,7 @@ static int spi_internal_chipselect[] = {
MXC_SPI_CS(0),
};
-static struct spi_imx_master spi1_pdata = {
+static const struct spi_imx_master spi1_pdata __initconst = {
.chipselect = spi_internal_chipselect,
.num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
};
@@ -252,7 +251,7 @@ static void __init mxc_board_init(void)
platform_device_register(&physmap_flash_device);
imx31_add_mxc_nand(&mx31lite_nand_board_info);
- mxc_register_device(&mxc_spi_device1, &spi1_pdata);
+ imx31_add_spi_imx1(&spi1_pdata);
spi_register_board_info(&mc13783_spi_dev, 1);
#if defined(CONFIG_USB_ULPI)
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c
index dd51d08..689b068 100644
--- a/arch/arm/mach-mx3/mach-mx31moboard.c
+++ b/arch/arm/mach-mx3/mach-mx31moboard.c
@@ -152,7 +152,7 @@ static int moboard_spi1_cs[] = {
MXC_SPI_CS(2),
};
-static struct spi_imx_master moboard_spi1_master = {
+static const struct spi_imx_master moboard_spi1_pdata __initconst = {
.chipselect = moboard_spi1_cs,
.num_chipselect = ARRAY_SIZE(moboard_spi1_cs),
};
@@ -282,7 +282,7 @@ static int moboard_spi2_cs[] = {
MXC_SPI_CS(1),
};
-static struct spi_imx_master moboard_spi2_master = {
+static const struct spi_imx_master moboard_spi2_pdata __initconst = {
.chipselect = moboard_spi2_cs,
.num_chipselect = ARRAY_SIZE(moboard_spi2_cs),
};
@@ -502,8 +502,8 @@ static void __init mxc_board_init(void)
imx31_add_imx_i2c0(&moboard_i2c0_data);
imx31_add_imx_i2c1(&moboard_i2c1_data);
- mxc_register_device(&mxc_spi_device1, &moboard_spi1_master);
- mxc_register_device(&mxc_spi_device2, &moboard_spi2_master);
+ imx31_add_spi_imx1(&moboard_spi1_pdata);
+ imx31_add_spi_imx2(&moboard_spi2_pdata);
gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq");
gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
index e35d2eb..3786e29 100644
--- a/arch/arm/mach-mx3/mx31lite-db.c
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -37,8 +37,8 @@
#include <mach/iomux-mx3.h>
#include <mach/board-mx31lite.h>
#include <mach/mmc.h>
-#include <mach/spi.h>
+#include "devices-imx31.h"
#include "devices.h"
/*
@@ -157,7 +157,7 @@ static int spi_internal_chipselect[] = {
MXC_SPI_CS(2),
};
-static struct spi_imx_master spi0_pdata = {
+static const struct spi_imx_master spi0_pdata __initconst = {
.chipselect = spi_internal_chipselect,
.num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
};
@@ -199,7 +199,7 @@ void __init mx31lite_db_init(void)
"development board pins");
mxc_register_device(&mxc_uart_device0, &uart_pdata);
mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
- mxc_register_device(&mxc_spi_device0, &spi0_pdata);
+ imx31_add_spi_imx0(&spi0_pdata);
platform_device_register(&litekit_led_device);
mxc_register_device(&imx_wdt_device0, NULL);
mxc_register_device(&imx_rtc_device0, NULL);
--
1.7.1
next prev parent reply other threads:[~2010-06-24 13:49 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 13:48 No subject Uwe Kleine-König
2010-06-24 13:48 ` [PATCH 01/61] ARM: mx3: rename mach-mx35pdk.c to mach-mx35_3ds.c matching its arch number Uwe Kleine-König
2010-06-24 13:48 ` [PATCH 02/61] ARM: mx25: rename mach-mx25pdk.c to mach-mx25_3ds.c " Uwe Kleine-König
2010-06-24 13:48 ` [PATCH 03/61] ARM: mx1: don't use deprecated symbol names Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 04/61] ARM: mx1/scb9328: fix type of uart1_mxc_exit to make compiler happy Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 05/61] ARM: mx2/mx27_3ds: document alternative names and remove empty header Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 06/61] ARM: imx: remove empty and unused board headers Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 07/61] ARM: mx3/kzm_arm11_01: fold board header in its only user Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 08/61] ARM: mx2/mx21ads: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 09/61] ARM: mx2/mx27ads: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 10/61] ARM: mx3/qong: get rid of nearly empty header Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 11/61] ARM: mx3/mx31_3ds: fold board header in its only user Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 12/61] ARM: mx3/mx31ads: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 13/61] ARM: mxc: grammar fix Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 15/61] ARM: imx/mx1: fold crm_regs.h into its only consumer Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 16/61] ARM: imx: get rid of mxc_gpio_init Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 17/61] ARM: imx: fold serial.c into devices.c Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 18/61] ARM: imx1: rename imx_csi_device to match its .name Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 19/61] ARM: imx1: rename imx_i2c_device to follow a common naming scheme Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 20/61] ARM: imx1: rename imx_uart[12]_device " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 21/61] ARM: mx3: mx31lilly: fix build error for !CONFIG_USB_ULPI Uwe Kleine-König
2010-06-30 7:37 ` Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 22/61] ARM: imx: rename mxc_uart_devicex to follow a common naming scheme Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 23/61] ARM: imx: move mx1 support to mach-imx Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 24/61] ARM: imx: Kconfig: use an if block instead of a depend for many symbols Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 25/61] ARM: imx: prepare deprecating ARCH_MX1, MACH_MX2, MACH_MX21 and MACH_MX27 Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 26/61] " Uwe Kleine-König
2010-06-30 7:18 ` Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 27/61] ARM: imx: new Kconfig symbol and feature test macro for DMA on mx1 and mx2 Uwe Kleine-König
2010-06-29 6:04 ` Baruch Siach
2010-06-30 7:17 ` [PATCH 27/61] ARM: imx: new Kconfig symbol and feature test macro for?DMA " Uwe Kleine-König
2010-07-01 4:51 ` Baruch Siach
2010-07-01 5:03 ` Uwe Kleine-König
2010-07-01 5:24 ` Baruch Siach
2010-07-01 6:33 ` Uwe Kleine-König
2010-07-01 6:46 ` Baruch Siach
2010-06-24 13:49 ` [PATCH 28/61] ARM: imx: new helper function imx_add_platform_device Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 29/61] MTD: mxc_nand: make bit fields unsigned to please sparse Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 30/61] ARM: imx: remove paragraphs with old address of the FSF Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 31/61] ARM: mx25: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 32/61] ARM: mx3: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 33/61] ARM: mxc91231: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 34/61] ARM: mxc: " Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 35/61] ARM: imx: Change the way nand devices are registered (generic part) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 36/61] ARM: imx: Change the way nand devices are registered (imx21) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 37/61] ARM: imx: Change the way nand devices are registered (imx25) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 38/61] ARM: imx: Change the way nand devices are registered (imx27) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 39/61] ARM: imx: Change the way nand devices are registered (imx31) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 40/61] ARM: imx: Change the way nand devices are registered (imx35) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 41/61] ARM: imx: dynamically register imx-i2c devices (generic part) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 42/61] ARM: imx: dynamically register imx-i2c devices (imx1) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 43/61] ARM: imx: dynamically register imx-i2c devices (imx21) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 44/61] ARM: imx: dynamically register imx-i2c devices (imx25) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 45/61] ARM: imx: dynamically register imx-i2c devices (imx27) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 46/61] ARM: imx: dynamically register imx-i2c devices (imx31) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 47/61] ARM: imx: dynamically register imx-i2c devices (imx35) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 48/61] ARM: imx: dynamically register spi_imx devices (generic part) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 49/61] ARM: imx: dynamically register spi_imx devices (imx21) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 50/61] ARM: imx: dynamically register spi_imx devices (imx25) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 51/61] ARM: imx: dynamically register spi_imx devices (imx27) Uwe Kleine-König
2010-08-10 20:18 ` [PATCH] ARM: imx/pca100: Fix name of spi platform data Uwe Kleine-König
2010-06-24 13:49 ` Uwe Kleine-König [this message]
2010-06-24 13:49 ` [PATCH 53/61] ARM: imx: dynamically register spi_imx devices (imx35) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 54/61] ARM: imx: dynamically register imx-uart devices (generic part) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 55/61] ARM: imx: dynamically register imx-uart devices (imx1) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 56/61] ARM: imx: dynamically register imx-uart devices (imx21) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 57/61] ARM: imx: dynamically register imx-uart devices (imx25) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 58/61] ARM: imx: dynamically register imx-uart devices (imx27) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 59/61] ARM: imx: dynamically register imx-uart devices (imx31) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 60/61] ARM: imx: dynamically register imx-uart devices (imx35) Uwe Kleine-König
2010-06-24 13:49 ` [PATCH 61/61] ARM: mx3: complement uart init routine with an exit routine Uwe Kleine-König
2010-06-24 14:42 ` Eric Bénard
2010-06-24 17:55 ` Uwe Kleine-König
2010-06-24 19:48 ` Eric Bénard
2010-06-25 5:10 ` Uwe Kleine-König
2010-06-25 6:52 ` Eric Bénard
2010-06-25 7:17 ` Uwe Kleine-König
2010-06-25 7:23 ` Eric Bénard
2010-06-24 17:59 ` [PATCH 14/61] ARM: imx: rename mach dir for mx21 and mx27 to mach-imx Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277387397-3467-53-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).