diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-04 05:09:10 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-17 04:01:25 -0500 |
commit | e0a1961df8ad898b661cf0adcf3519254f135a44 (patch) | |
tree | bc663100b851b8cf06157fa6a967393bef39a8a9 /arch/arm/plat-mxc/devices/platform-imx2-wdt.c | |
parent | b2997cb12b302ee6d233808e32214d00afdcf128 (diff) |
ARM: imx: dynamically allocate imx2-wdt devices
Currently there is no platform data used in the driver. In case this
changes and for consistency NULL is passed unused to the soc specific
functions.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-imx2-wdt.c')
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx2-wdt.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c new file mode 100644 index 000000000000..86eb7f128168 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c | |||
@@ -0,0 +1,40 @@ | |||
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_imx2_wdt_data_entry_single(soc) \ | ||
14 | { \ | ||
15 | .iobase = soc ## _WDOG_BASE_ADDR, \ | ||
16 | } | ||
17 | |||
18 | #ifdef CONFIG_SOC_IMX21 | ||
19 | const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst = | ||
20 | imx_imx2_wdt_data_entry_single(MX21); | ||
21 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX27 | ||
24 | const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst = | ||
25 | imx_imx2_wdt_data_entry_single(MX27); | ||
26 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
27 | |||
28 | struct platform_device *__init imx_add_imx2_wdt( | ||
29 | const struct imx_imx2_wdt_data *data) | ||
30 | { | ||
31 | struct resource res[] = { | ||
32 | { | ||
33 | .start = data->iobase, | ||
34 | .end = data->iobase + SZ_4K - 1, | ||
35 | .flags = IORESOURCE_MEM, | ||
36 | }, | ||
37 | }; | ||
38 | return imx_add_platform_device("imx2-wdt", 0, | ||
39 | res, ARRAY_SIZE(res), NULL, 0); | ||
40 | } | ||