aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArnaud Patard (Rtp) <arnaud.patard@rtp-net.org>2011-07-26 10:54:25 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2011-08-23 02:55:01 -0400
commita45adf1ce8012f67fe6014175f666ab2960e0350 (patch)
tree330dd02c0e794c779d8b158a4a54b1c90a0b740f /arch/arm
parent322a8b034003c0d46d39af85bf24fee27b902f48 (diff)
imx51: add pata device
Declare the pata device found on mx51 Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx5/devices-imx51.h4
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig3
-rw-r--r--arch/arm/plat-mxc/devices/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices/platform-pata_imx.c38
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h7
5 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h
index e11bc0e0ec49..89fe77ffb4d4 100644
--- a/arch/arm/mach-mx5/devices-imx51.h
+++ b/arch/arm/mach-mx5/devices-imx51.h
@@ -52,3 +52,7 @@ extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[];
52extern const struct imx_imx_keypad_data imx51_imx_keypad_data; 52extern const struct imx_imx_keypad_data imx51_imx_keypad_data;
53#define imx51_add_imx_keypad(pdata) \ 53#define imx51_add_imx_keypad(pdata) \
54 imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) 54 imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
55
56extern const struct imx_pata_imx_data imx51_pata_imx_data;
57#define imx51_add_pata_imx() \
58 imx_add_pata_imx(&imx51_pata_imx_data)
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index bd294add932c..c55916ce3d2a 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -31,6 +31,9 @@ config IMX_HAVE_PLATFORM_IMX_I2C
31config IMX_HAVE_PLATFORM_IMX_KEYPAD 31config IMX_HAVE_PLATFORM_IMX_KEYPAD
32 bool 32 bool
33 33
34config IMX_HAVE_PLATFORM_PATA_IMX
35 bool
36
34config IMX_HAVE_PLATFORM_IMX_SSI 37config IMX_HAVE_PLATFORM_IMX_SSI
35 bool 38 bool
36 39
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index b41bf972b54b..a093b454541d 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -10,6 +10,7 @@ obj-y += platform-imx-dma.o
10obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o 10obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
11obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o 11obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
12obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o 12obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o
13obj-$(CONFIG_IMX_HAVE_PLATFORM_PATA_IMX) += platform-pata_imx.o
13obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o 14obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
14obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o 15obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
15obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o 16obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
diff --git a/arch/arm/plat-mxc/devices/platform-pata_imx.c b/arch/arm/plat-mxc/devices/platform-pata_imx.c
new file mode 100644
index 000000000000..c1cbaf92e359
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-pata_imx.c
@@ -0,0 +1,38 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it under
3 * the terms of the GNU General Public License version 2 as published by the
4 * Free Software Foundation.
5 */
6#include <mach/hardware.h>
7#include <mach/devices-common.h>
8
9#define imx_pata_imx_data_entry_single(soc) \
10 { \
11 .iobase = soc ## _ATA_BASE_ADDR, \
12 .irq = soc ## _MXC_INT_ATA, \
13 }
14
15#ifdef CONFIG_SOC_IMX51
16const struct imx_pata_imx_data imx51_pata_imx_data __initconst =
17 imx_pata_imx_data_entry_single(MX51);
18#endif /* ifdef CONFIG_SOC_IMX51 */
19
20struct platform_device *__init imx_add_pata_imx(
21 const struct imx_pata_imx_data *data)
22{
23 struct resource res[] = {
24 {
25 .start = data->iobase,
26 .end = data->iobase + SZ_16K - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 {
30 .start = data->irq,
31 .end = data->irq,
32 .flags = IORESOURCE_IRQ,
33 },
34 };
35 return imx_add_platform_device("pata_imx", -1,
36 res, ARRAY_SIZE(res), NULL, 0);
37}
38
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 524538aabc4b..1b76c67d5d3f 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -251,6 +251,13 @@ struct platform_device *__init imx_add_mxc_nand(
251 const struct imx_mxc_nand_data *data, 251 const struct imx_mxc_nand_data *data,
252 const struct mxc_nand_platform_data *pdata); 252 const struct mxc_nand_platform_data *pdata);
253 253
254struct imx_pata_imx_data {
255 resource_size_t iobase;
256 resource_size_t irq;
257};
258struct platform_device *__init imx_add_pata_imx(
259 const struct imx_pata_imx_data *data);
260
254struct imx_mxc_pwm_data { 261struct imx_mxc_pwm_data {
255 int id; 262 int id;
256 resource_size_t iobase; 263 resource_size_t iobase;