of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / arch / arm / mach-imx / devices / platform-mxc_rnga.c
blob851fbc8af7a9fd4bb20ec154deb6f1f79ca75e12
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 "../hardware.h"
10 #include "devices-common.h"
12 struct imx_mxc_rnga_data {
13 resource_size_t iobase;
16 #define imx_mxc_rnga_data_entry_single(soc) \
17 { \
18 .iobase = soc ## _RNGA_BASE_ADDR, \
21 #ifdef CONFIG_SOC_IMX31
22 static const struct imx_mxc_rnga_data imx31_mxc_rnga_data __initconst =
23 imx_mxc_rnga_data_entry_single(MX31);
24 #endif /* ifdef CONFIG_SOC_IMX31 */
26 static struct platform_device *__init imx_add_mxc_rnga(
27 const struct imx_mxc_rnga_data *data)
29 struct resource res[] = {
31 .start = data->iobase,
32 .end = data->iobase + SZ_16K - 1,
33 .flags = IORESOURCE_MEM,
36 return imx_add_platform_device("mxc_rnga", -1,
37 res, ARRAY_SIZE(res), NULL, 0);
40 static int __init imxXX_add_mxc_rnga(void)
42 struct platform_device *ret;
44 #if defined(CONFIG_SOC_IMX31)
45 if (cpu_is_mx31())
46 ret = imx_add_mxc_rnga(&imx31_mxc_rnga_data);
47 else
48 #endif /* if defined(CONFIG_SOC_IMX31) */
49 ret = ERR_PTR(-ENODEV);
51 return PTR_ERR_OR_ZERO(ret);
53 arch_initcall(imxXX_add_mxc_rnga);