ARM: kirkwood: Trim excess #includes in board-dnskw.c
[deliverable/linux.git] / arch / arm / mach-mxs / devices / platform-mxs-mmc.c
CommitLineData
47babe69
SG
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License version 2 as published by the
9 * Free Software Foundation.
10 */
11
12#include <linux/compiler.h>
13#include <linux/err.h>
14#include <linux/init.h>
15
16#include <mach/mx23.h>
17#include <mach/mx28.h>
18#include <mach/devices-common.h>
19
ef9b4d39 20#define mxs_mxs_mmc_data_entry_single(soc, _devid, _id, hwid) \
47babe69 21 { \
ef9b4d39 22 .devid = _devid, \
47babe69
SG
23 .id = _id, \
24 .iobase = soc ## _SSP ## hwid ## _BASE_ADDR, \
25 .dma = soc ## _DMA_SSP ## hwid, \
26 .irq_err = soc ## _INT_SSP ## hwid ## _ERROR, \
27 .irq_dma = soc ## _INT_SSP ## hwid ## _DMA, \
28 }
29
ef9b4d39
SG
30#define mxs_mxs_mmc_data_entry(soc, _devid, _id, hwid) \
31 [_id] = mxs_mxs_mmc_data_entry_single(soc, _devid, _id, hwid)
47babe69
SG
32
33
34#ifdef CONFIG_SOC_IMX23
35const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst = {
ef9b4d39
SG
36 mxs_mxs_mmc_data_entry(MX23, "imx23-mmc", 0, 1),
37 mxs_mxs_mmc_data_entry(MX23, "imx23-mmc", 1, 2),
47babe69
SG
38};
39#endif
40
41#ifdef CONFIG_SOC_IMX28
42const struct mxs_mxs_mmc_data mx28_mxs_mmc_data[] __initconst = {
ef9b4d39
SG
43 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 0, 0),
44 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 1, 1),
45 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 2, 2),
46 mxs_mxs_mmc_data_entry(MX28, "imx28-mmc", 3, 3),
47babe69
SG
47};
48#endif
49
50struct platform_device *__init mxs_add_mxs_mmc(
51 const struct mxs_mxs_mmc_data *data,
52 const struct mxs_mmc_platform_data *pdata)
53{
54 struct resource res[] = {
55 {
56 .start = data->iobase,
57 .end = data->iobase + SZ_8K - 1,
58 .flags = IORESOURCE_MEM,
59 }, {
60 .start = data->dma,
61 .end = data->dma,
62 .flags = IORESOURCE_DMA,
63 }, {
64 .start = data->irq_err,
65 .end = data->irq_err,
66 .flags = IORESOURCE_IRQ,
67 }, {
68 .start = data->irq_dma,
69 .end = data->irq_dma,
70 .flags = IORESOURCE_IRQ,
71 },
72 };
73
ef9b4d39 74 return mxs_add_platform_device(data->devid, data->id,
47babe69
SG
75 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
76}
This page took 0.092003 seconds and 5 git commands to generate.