aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-03-01 05:04:34 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-19 07:11:16 -0400
commit83422671c3e93b8ef77805fbad74173a1636d5f1 (patch)
treea79df1808e6aabe5dac7bb59da23c42e11894b2b /arch/arm/plat-mxc
parent3da25ccee303add545e49cef5c6cdeb0c1d94300 (diff)
ARM: mx3: dynamically allocate "mxc_rtc" devices
LAKML-Reference: 1299271882-2130-2-git-send-email-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-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-mxc_rtc.c40
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h9
4 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index b9ab1d58b5e7..0e8d7ab7898a 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -63,6 +63,9 @@ config IMX_HAVE_PLATFORM_MXC_RNGA
63 bool 63 bool
64 select ARCH_HAS_RNGA 64 select ARCH_HAS_RNGA
65 65
66config IMX_HAVE_PLATFORM_MXC_RTC
67 bool
68
66config IMX_HAVE_PLATFORM_MXC_W1 69config IMX_HAVE_PLATFORM_MXC_W1
67 bool 70 bool
68 71
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
index 75cd2ece9053..ca227eaea7cc 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/plat-mxc/devices/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
19obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o 19obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o
20obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o 20obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o
21obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o 21obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o
22obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o
22obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o 23obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
23obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o 24obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o
24obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o 25obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
new file mode 100644
index 000000000000..16d0ec4df5f6
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2010-2011 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 <mach/hardware.h>
10#include <mach/devices-common.h>
11
12#define imx_mxc_rtc_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _RTC_BASE_ADDR, \
15 .irq = soc ## _INT_RTC, \
16 }
17
18#ifdef CONFIG_SOC_IMX31
19const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst =
20 imx_mxc_rtc_data_entry_single(MX31);
21#endif /* ifdef CONFIG_SOC_IMX31 */
22
23struct platform_device *__init imx_add_mxc_rtc(
24 const struct imx_mxc_rtc_data *data)
25{
26 struct resource res[] = {
27 {
28 .start = data->iobase,
29 .end = data->iobase + SZ_16K - 1,
30 .flags = IORESOURCE_MEM,
31 }, {
32 .start = data->irq,
33 .end = data->irq,
34 .flags = IORESOURCE_IRQ,
35 },
36 };
37
38 return imx_add_platform_device("mxc_rtc", -1,
39 res, ARRAY_SIZE(res), NULL, 0);
40}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 8658c9caa650..b0bc1987c1d3 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -237,6 +237,15 @@ struct imx_mxc_pwm_data {
237struct platform_device *__init imx_add_mxc_pwm( 237struct platform_device *__init imx_add_mxc_pwm(
238 const struct imx_mxc_pwm_data *data); 238 const struct imx_mxc_pwm_data *data);
239 239
240/* mxc_rtc */
241struct imx_mxc_rtc_data {
242 resource_size_t iobase;
243 resource_size_t irq;
244};
245struct platform_device *__init imx_add_mxc_rtc(
246 const struct imx_mxc_rtc_data *data);
247
248/* mxc_w1 */
240struct imx_mxc_w1_data { 249struct imx_mxc_w1_data {
241 resource_size_t iobase; 250 resource_size_t iobase;
242}; 251};