aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-11 05:57:21 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 04:01:40 -0500
commite7c74b343091e0c6b7bb67c12f9f7fb345aa6a50 (patch)
tree08b808dad98c3b098eaa49c6588b6b16d46d7bd8
parentab9cee4b2167f8bf01d85b537df5b9cbe342c780 (diff)
ARM: mx25: dynamically allocate imxdi_rtc devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-mx25/Kconfig2
-rw-r--r--arch/arm/mach-mx25/devices-imx25.h4
-rw-r--r--arch/arm/mach-mx25/devices.c19
-rw-r--r--arch/arm/mach-mx25/devices.h1
-rw-r--r--arch/arm/mach-mx25/mach-cpuimx25.c2
-rw-r--r--arch/arm/mach-mx25/mach-mx25_3ds.c2
-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-imxdi_rtc.c41
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h7
10 files changed, 60 insertions, 22 deletions
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig
index e9d445649d4..baa75fecf2f 100644
--- a/arch/arm/mach-mx25/Kconfig
+++ b/arch/arm/mach-mx25/Kconfig
@@ -5,6 +5,7 @@ comment "MX25 platforms:"
5config MACH_MX25_3DS 5config MACH_MX25_3DS
6 bool "Support MX25PDK (3DS) Platform" 6 bool "Support MX25PDK (3DS) Platform"
7 select IMX_HAVE_PLATFORM_ESDHC 7 select IMX_HAVE_PLATFORM_ESDHC
8 select IMX_HAVE_PLATFORM_IMXDI_RTC
8 select IMX_HAVE_PLATFORM_IMX_KEYPAD 9 select IMX_HAVE_PLATFORM_IMX_KEYPAD
9 select IMX_HAVE_PLATFORM_IMX_UART 10 select IMX_HAVE_PLATFORM_IMX_UART
10 select IMX_HAVE_PLATFORM_MXC_EHCI 11 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -15,6 +16,7 @@ config MACH_EUKREA_CPUIMX25
15 select IMX_HAVE_PLATFORM_ESDHC 16 select IMX_HAVE_PLATFORM_ESDHC
16 select IMX_HAVE_PLATFORM_FLEXCAN 17 select IMX_HAVE_PLATFORM_FLEXCAN
17 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 18 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
19 select IMX_HAVE_PLATFORM_IMXDI_RTC
18 select IMX_HAVE_PLATFORM_IMX_I2C 20 select IMX_HAVE_PLATFORM_IMX_I2C
19 select IMX_HAVE_PLATFORM_IMX_UART 21 select IMX_HAVE_PLATFORM_IMX_UART
20 select IMX_HAVE_PLATFORM_MXC_EHCI 22 select IMX_HAVE_PLATFORM_MXC_EHCI
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h
index a35123fef39..a4980ecd394 100644
--- a/arch/arm/mach-mx25/devices-imx25.h
+++ b/arch/arm/mach-mx25/devices-imx25.h
@@ -23,6 +23,10 @@ extern const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst;
23#define imx25_add_fsl_usb2_udc(pdata) \ 23#define imx25_add_fsl_usb2_udc(pdata) \
24 imx_add_fsl_usb2_udc(&imx25_fsl_usb2_udc_data, pdata) 24 imx_add_fsl_usb2_udc(&imx25_fsl_usb2_udc_data, pdata)
25 25
26extern struct imx_imxdi_rtc_data imx25_imxdi_rtc_data __initconst;
27#define imx25_add_imxdi_rtc(pdata) \
28 imx_add_imxdi_rtc(&imx25_imxdi_rtc_data)
29
26extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst; 30extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst;
27#define imx25_add_imx_i2c(id, pdata) \ 31#define imx25_add_imx_i2c(id, pdata) \
28 imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata) 32 imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
index 052adbbb3de..12743969222 100644
--- a/arch/arm/mach-mx25/devices.c
+++ b/arch/arm/mach-mx25/devices.c
@@ -22,25 +22,6 @@
22#include <mach/mx25.h> 22#include <mach/mx25.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24 24
25static struct resource mx25_rtc_resources[] = {
26 {
27 .start = MX25_DRYICE_BASE_ADDR,
28 .end = MX25_DRYICE_BASE_ADDR + 0x40,
29 .flags = IORESOURCE_MEM,
30 },
31 {
32 .start = MX25_INT_DRYICE,
33 .flags = IORESOURCE_IRQ
34 },
35};
36
37struct platform_device mx25_rtc_device = {
38 .name = "imxdi_rtc",
39 .id = 0,
40 .num_resources = ARRAY_SIZE(mx25_rtc_resources),
41 .resource = mx25_rtc_resources,
42};
43
44static struct resource mx25_fb_resources[] = { 25static struct resource mx25_fb_resources[] = {
45 { 26 {
46 .start = MX25_LCDC_BASE_ADDR, 27 .start = MX25_LCDC_BASE_ADDR,
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h
index dd1fdeddb83..f37f9a2d8ee 100644
--- a/arch/arm/mach-mx25/devices.h
+++ b/arch/arm/mach-mx25/devices.h
@@ -1,4 +1,3 @@
1extern struct platform_device mx25_rtc_device;
2extern struct platform_device mx25_fb_device; 1extern struct platform_device mx25_fb_device;
3extern struct platform_device mxc_wdt; 2extern struct platform_device mxc_wdt;
4extern struct platform_device mx25_csi_device; 3extern struct platform_device mx25_csi_device;
diff --git a/arch/arm/mach-mx25/mach-cpuimx25.c b/arch/arm/mach-mx25/mach-cpuimx25.c
index 2094bddb3e4..d1a04bafb43 100644
--- a/arch/arm/mach-mx25/mach-cpuimx25.c
+++ b/arch/arm/mach-mx25/mach-cpuimx25.c
@@ -124,7 +124,7 @@ static void __init eukrea_cpuimx25_init(void)
124 124
125 imx25_add_imx_uart0(&uart_pdata); 125 imx25_add_imx_uart0(&uart_pdata);
126 imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); 126 imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info);
127 mxc_register_device(&mx25_rtc_device, NULL); 127 imx25_add_imxdi_rtc(NULL);
128 imx25_add_fec(&mx25_fec_pdata); 128 imx25_add_fec(&mx25_fec_pdata);
129 129
130 i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, 130 i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices,
diff --git a/arch/arm/mach-mx25/mach-mx25_3ds.c b/arch/arm/mach-mx25/mach-mx25_3ds.c
index 1d07cfbd8ff..0566d3cb10c 100644
--- a/arch/arm/mach-mx25/mach-mx25_3ds.c
+++ b/arch/arm/mach-mx25/mach-mx25_3ds.c
@@ -194,7 +194,7 @@ static void __init mx25pdk_init(void)
194 imx25_add_imx_uart0(&uart_pdata); 194 imx25_add_imx_uart0(&uart_pdata);
195 imx25_add_mxc_ehci_hs(NULL); 195 imx25_add_mxc_ehci_hs(NULL);
196 imx25_add_mxc_nand(&mx25pdk_nand_board_info); 196 imx25_add_mxc_nand(&mx25pdk_nand_board_info);
197 mxc_register_device(&mx25_rtc_device, NULL); 197 imx25_add_imxdi_rtc(NULL);
198 mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata); 198 mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata);
199 mxc_register_device(&mxc_wdt, NULL); 199 mxc_register_device(&mxc_wdt, NULL);
200 200
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index a0be2df71a0..81d7a545692 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -22,6 +22,9 @@ config IMX_HAVE_PLATFORM_IMX21_HCD
22config IMX_HAVE_PLATFORM_IMX2_WDT 22config IMX_HAVE_PLATFORM_IMX2_WDT
23 bool 23 bool
24 24
25config IMX_HAVE_PLATFORM_IMXDI_RTC
26 bool
27
25config IMX_HAVE_PLATFORM_IMX_FB 28config IMX_HAVE_PLATFORM_IMX_FB
26 bool 29 bool
27 30
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index 14b228e9d58..f1c3767d29d 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
5obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o 5obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
6obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o 6obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o
7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o 7obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
8obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o
8obj-y += platform-imx-dma.o 9obj-y += platform-imx-dma.o
9obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o 10obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
10obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o 11obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
new file mode 100644
index 00000000000..387f65032c1
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12
13#define imx_imxdi_rtc_data_entry_single(soc) \
14 { \
15 .iobase = soc ## _DRYICE_BASE_ADDR, \
16 .irq = soc ## _INT_DRYICE, \
17 }
18
19#ifdef CONFIG_ARCH_MX25
20const struct imx_imxdi_rtc_data imx25_imxdi_rtc_data __initconst =
21 imx_imxdi_rtc_data_entry_single(MX25);
22#endif /* ifdef CONFIG_ARCH_MX25 */
23
24struct platform_device *__init imx_add_imxdi_rtc(
25 const struct imx_imxdi_rtc_data *data)
26{
27 struct resource res[] = {
28 {
29 .start = data->iobase,
30 .end = data->iobase + SZ_16K,
31 .flags = IORESOURCE_MEM,
32 }, {
33 .start = data->irq,
34 .end = data->irq,
35 .flags = IORESOURCE_IRQ,
36 },
37 };
38
39 return imx_add_platform_device("imxdi_rtc", 0,
40 res, ARRAY_SIZE(res), NULL, 0);
41}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 8482613e972..4d4b28b5495 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -72,6 +72,13 @@ struct imx_imx2_wdt_data {
72struct platform_device *__init imx_add_imx2_wdt( 72struct platform_device *__init imx_add_imx2_wdt(
73 const struct imx_imx2_wdt_data *data); 73 const struct imx_imx2_wdt_data *data);
74 74
75struct imx_imxdi_rtc_data {
76 resource_size_t iobase;
77 resource_size_t irq;
78};
79struct platform_device *__init imx_add_imxdi_rtc(
80 const struct imx_imxdi_rtc_data *data);
81
75#include <mach/imxfb.h> 82#include <mach/imxfb.h>
76struct imx_imx_fb_data { 83struct imx_imx_fb_data {
77 resource_size_t iobase; 84 resource_size_t iobase;