aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-09-15 02:26:14 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-10-14 22:03:16 -0400
commitbb1d34a20d537e2f2342db8b5918512f05b0f852 (patch)
treef98a0ccfd5a959a4638715df601cdd9561765771 /arch
parent4d62435f0601ecec379fdc48749a10353fee8217 (diff)
rtc: mxc_rtc: remove cpu_is_xxx by using platform_device_id
It changes the driver to use platform_device_id rather than cpu_is_xxx to determine the controller type, and updates the platform code accordingly. As the result, mach/hardware.h inclusion gets removed from the driver. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: rtc-linux@googlegroups.com
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/clk-imx1.c2
-rw-r--r--arch/arm/mach-imx/clk-imx27.c2
-rw-r--r--arch/arm/mach-imx/clk-imx31.c2
-rw-r--r--arch/arm/mach-imx/devices/devices-common.h1
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_rtc.c9
5 files changed, 9 insertions, 7 deletions
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 198238859446..1cc7a735ed19 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -106,7 +106,7 @@ int __init mx1_clocks_init(unsigned long fref)
106 clk_register_clkdev(clk[dummy], "ahb", "imx-fb.0"); 106 clk_register_clkdev(clk[dummy], "ahb", "imx-fb.0");
107 clk_register_clkdev(clk[hclk], "mshc", NULL); 107 clk_register_clkdev(clk[hclk], "mshc", NULL);
108 clk_register_clkdev(clk[per3], "ssi", NULL); 108 clk_register_clkdev(clk[per3], "ssi", NULL);
109 clk_register_clkdev(clk[clk32], NULL, "mxc_rtc.0"); 109 clk_register_clkdev(clk[clk32], NULL, "imx1-rtc.0");
110 clk_register_clkdev(clk[clko], "clko", NULL); 110 clk_register_clkdev(clk[clko], "clko", NULL);
111 111
112 mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT); 112 mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT);
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 100e38c48f9f..86a0c4262471 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -259,7 +259,7 @@ int __init mx27_clocks_init(unsigned long fref)
259 clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL); 259 clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
260 clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL); 260 clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
261 clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL); 261 clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
262 clk_register_clkdev(clk[rtc_ipg_gate], NULL, "mxc_rtc"); 262 clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc");
263 clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL); 263 clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
264 clk_register_clkdev(clk[cpu_div], "cpu", NULL); 264 clk_register_clkdev(clk[cpu_div], "cpu", NULL);
265 clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL); 265 clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 729d1a9dbf6a..d9ff16e2b1e2 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -124,7 +124,7 @@ int __init mx31_clocks_init(unsigned long fref)
124 clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2"); 124 clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
125 clk_register_clkdev(clk[pwm_gate], "pwm", NULL); 125 clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
126 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 126 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
127 clk_register_clkdev(clk[rtc_gate], NULL, "mxc_rtc"); 127 clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
128 clk_register_clkdev(clk[epit1_gate], "epit", NULL); 128 clk_register_clkdev(clk[epit1_gate], "epit", NULL);
129 clk_register_clkdev(clk[epit2_gate], "epit", NULL); 129 clk_register_clkdev(clk[epit2_gate], "epit", NULL);
130 clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0"); 130 clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 30a842ffc553..1472f0fc325c 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -292,6 +292,7 @@ struct platform_device *__init imx_add_mxc_pwm(
292 292
293/* mxc_rtc */ 293/* mxc_rtc */
294struct imx_mxc_rtc_data { 294struct imx_mxc_rtc_data {
295 const char *devid;
295 resource_size_t iobase; 296 resource_size_t iobase;
296 resource_size_t irq; 297 resource_size_t irq;
297}; 298};
diff --git a/arch/arm/mach-imx/devices/platform-mxc_rtc.c b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
index daaf9795db18..f35f848b0d5a 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
@@ -9,20 +9,21 @@
9#include <mach/hardware.h> 9#include <mach/hardware.h>
10#include "devices-common.h" 10#include "devices-common.h"
11 11
12#define imx_mxc_rtc_data_entry_single(soc) \ 12#define imx_mxc_rtc_data_entry_single(soc, _devid) \
13 { \ 13 { \
14 .devid = _devid, \
14 .iobase = soc ## _RTC_BASE_ADDR, \ 15 .iobase = soc ## _RTC_BASE_ADDR, \
15 .irq = soc ## _INT_RTC, \ 16 .irq = soc ## _INT_RTC, \
16 } 17 }
17 18
18#ifdef CONFIG_SOC_IMX31 19#ifdef CONFIG_SOC_IMX31
19const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst = 20const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst =
20 imx_mxc_rtc_data_entry_single(MX31); 21 imx_mxc_rtc_data_entry_single(MX31, "imx21-rtc");
21#endif /* ifdef CONFIG_SOC_IMX31 */ 22#endif /* ifdef CONFIG_SOC_IMX31 */
22 23
23#ifdef CONFIG_SOC_IMX35 24#ifdef CONFIG_SOC_IMX35
24const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst = 25const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst =
25 imx_mxc_rtc_data_entry_single(MX35); 26 imx_mxc_rtc_data_entry_single(MX35, "imx21-rtc");
26#endif /* ifdef CONFIG_SOC_IMX35 */ 27#endif /* ifdef CONFIG_SOC_IMX35 */
27 28
28struct platform_device *__init imx_add_mxc_rtc( 29struct platform_device *__init imx_add_mxc_rtc(
@@ -40,6 +41,6 @@ struct platform_device *__init imx_add_mxc_rtc(
40 }, 41 },
41 }; 42 };
42 43
43 return imx_add_platform_device("mxc_rtc", -1, 44 return imx_add_platform_device(data->devid, -1,
44 res, ARRAY_SIZE(res), NULL, 0); 45 res, ARRAY_SIZE(res), NULL, 0);
45} 46}