Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / arch / arm / mach-imx / devices / platform-imx2-wdt.c
blobec75d6413686d7f2004a83b96c16a4683bc630a1
1 /*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
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>
11 #include "../hardware.h"
12 #include "devices-common.h"
14 #define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
15 { \
16 .id = _id, \
17 .iobase = soc ## _WDOG ## _hwid ## _BASE_ADDR, \
18 .iosize = _size, \
20 #define imx_imx2_wdt_data_entry(soc, _id, _hwid, _size) \
21 [_id] = imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size)
23 #ifdef CONFIG_SOC_IMX21
24 const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst =
25 imx_imx2_wdt_data_entry_single(MX21, 0, , SZ_4K);
26 #endif /* ifdef CONFIG_SOC_IMX21 */
28 #ifdef CONFIG_SOC_IMX25
29 const struct imx_imx2_wdt_data imx25_imx2_wdt_data __initconst =
30 imx_imx2_wdt_data_entry_single(MX25, 0, , SZ_16K);
31 #endif /* ifdef CONFIG_SOC_IMX25 */
33 #ifdef CONFIG_SOC_IMX27
34 const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
35 imx_imx2_wdt_data_entry_single(MX27, 0, , SZ_4K);
36 #endif /* ifdef CONFIG_SOC_IMX27 */
38 #ifdef CONFIG_SOC_IMX31
39 const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst =
40 imx_imx2_wdt_data_entry_single(MX31, 0, , SZ_16K);
41 #endif /* ifdef CONFIG_SOC_IMX31 */
43 #ifdef CONFIG_SOC_IMX35
44 const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst =
45 imx_imx2_wdt_data_entry_single(MX35, 0, , SZ_16K);
46 #endif /* ifdef CONFIG_SOC_IMX35 */
48 #ifdef CONFIG_SOC_IMX51
49 const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = {
50 #define imx51_imx2_wdt_data_entry(_id, _hwid) \
51 imx_imx2_wdt_data_entry(MX51, _id, _hwid, SZ_16K)
52 imx51_imx2_wdt_data_entry(0, 1),
53 imx51_imx2_wdt_data_entry(1, 2),
55 #endif /* ifdef CONFIG_SOC_IMX51 */
57 #ifdef CONFIG_SOC_IMX53
58 const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst = {
59 #define imx53_imx2_wdt_data_entry(_id, _hwid) \
60 imx_imx2_wdt_data_entry(MX53, _id, _hwid, SZ_16K)
61 imx53_imx2_wdt_data_entry(0, 1),
62 imx53_imx2_wdt_data_entry(1, 2),
64 #endif /* ifdef CONFIG_SOC_IMX53 */
66 struct platform_device *__init imx_add_imx2_wdt(
67 const struct imx_imx2_wdt_data *data)
69 struct resource res[] = {
71 .start = data->iobase,
72 .end = data->iobase + data->iosize - 1,
73 .flags = IORESOURCE_MEM,
76 return imx_add_platform_device("imx2-wdt", data->id,
77 res, ARRAY_SIZE(res), NULL, 0);