aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-19 15:03:33 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-19 15:59:51 -0500
commit124bf94a9f9b52341562628cd56b252e7d820ee8 (patch)
tree73aa0be3bc6229ac63e12fe92e7b4f206d77bb5b /arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
parentc496fa6bd5324ddce11e5e42670618ffb4d8f58d (diff)
ARM: imx: fix name for functions adding sdhci-esdhc-imx devices
and restore alphabetic ordering. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c')
-rw-r--r--arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
new file mode 100644
index 00000000000..167cce89e7c
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
@@ -0,0 +1,74 @@
1/*
2 * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#include <mach/hardware.h>
10#include <mach/devices-common.h>
11#include <mach/esdhc.h>
12
13#define imx_sdhci_esdhc_imx_data_entry_single(soc, _id, hwid) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _ESDHC ## hwid ## _BASE_ADDR, \
17 .irq = soc ## _INT_ESDHC ## hwid, \
18 }
19
20#define imx_sdhci_esdhc_imx_data_entry(soc, id, hwid) \
21 [id] = imx_sdhci_esdhc_imx_data_entry_single(soc, id, hwid)
22
23#ifdef CONFIG_SOC_IMX25
24const struct imx_sdhci_esdhc_imx_data
25imx25_sdhci_esdhc_imx_data[] __initconst = {
26#define imx25_sdhci_esdhc_imx_data_entry(_id, _hwid) \
27 imx_sdhci_esdhc_imx_data_entry(MX25, _id, _hwid)
28 imx25_sdhci_esdhc_imx_data_entry(0, 1),
29 imx25_sdhci_esdhc_imx_data_entry(1, 2),
30};
31#endif /* ifdef CONFIG_SOC_IMX25 */
32
33#ifdef CONFIG_SOC_IMX35
34const struct imx_sdhci_esdhc_imx_data
35imx35_sdhci_esdhc_imx_data[] __initconst = {
36#define imx35_sdhci_esdhc_imx_data_entry(_id, _hwid) \
37 imx_sdhci_esdhc_imx_data_entry(MX35, _id, _hwid)
38 imx35_sdhci_esdhc_imx_data_entry(0, 1),
39 imx35_sdhci_esdhc_imx_data_entry(1, 2),
40 imx35_sdhci_esdhc_imx_data_entry(2, 3),
41};
42#endif /* ifdef CONFIG_SOC_IMX35 */
43
44#ifdef CONFIG_ARCH_MX51
45const struct imx_sdhci_esdhc_imx_data
46imx51_sdhci_esdhc_imx_data[] __initconst = {
47#define imx51_sdhci_esdhc_imx_data_entry(_id, _hwid) \
48 imx_sdhci_esdhc_imx_data_entry(MX51, _id, _hwid)
49 imx51_sdhci_esdhc_imx_data_entry(0, 1),
50 imx51_sdhci_esdhc_imx_data_entry(1, 2),
51 imx51_sdhci_esdhc_imx_data_entry(2, 3),
52 imx51_sdhci_esdhc_imx_data_entry(3, 4),
53};
54#endif /* ifdef CONFIG_ARCH_MX51 */
55
56struct platform_device *__init imx_add_sdhci_esdhc_imx(
57 const struct imx_sdhci_esdhc_imx_data *data,
58 const struct esdhc_platform_data *pdata)
59{
60 struct resource res[] = {
61 {
62 .start = data->iobase,
63 .end = data->iobase + SZ_16K - 1,
64 .flags = IORESOURCE_MEM,
65 }, {
66 .start = data->irq,
67 .end = data->irq,
68 .flags = IORESOURCE_IRQ,
69 },
70 };
71
72 return imx_add_platform_device("sdhci-esdhc-imx", data->id, res,
73 ARRAY_SIZE(res), pdata, sizeof(*pdata));
74}