Commit ccd0e42c authored by Uwe Kleine-König's avatar Uwe Kleine-König

arm/mx2: use cpp magic to create imx-mmc devices

This makes the source shorter and easier to verify.  While at it switch
to use the SoC-prefixed constants.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 9309b2ba
...@@ -261,63 +261,38 @@ struct platform_device mxc_pwm_device = { ...@@ -261,63 +261,38 @@ struct platform_device mxc_pwm_device = {
/* /*
* Resource definition for the MXC SDHC * Resource definition for the MXC SDHC
*/ */
static struct resource mxc_sdhc1_resources[] = { #define DEFINE_MXC_MMC_DEVICE(n, baseaddr, irq, dmareq) \
{ static struct resource mxc_sdhc_resources ## n[] = { \
.start = SDHC1_BASE_ADDR, { \
.end = SDHC1_BASE_ADDR + SZ_4K - 1, .start = baseaddr, \
.flags = IORESOURCE_MEM, .end = baseaddr + SZ_4K - 1, \
}, { .flags = IORESOURCE_MEM, \
.start = MXC_INT_SDHC1, }, { \
.end = MXC_INT_SDHC1, .start = irq, \
.flags = IORESOURCE_IRQ, .end = irq, \
}, { .flags = IORESOURCE_IRQ, \
.start = DMA_REQ_SDHC1, }, { \
.end = DMA_REQ_SDHC1, .start = dmareq, \
.flags = IORESOURCE_DMA, .end = dmareq, \
}, .flags = IORESOURCE_DMA, \
}; }, \
}; \
static u64 mxc_sdhc1_dmamask = 0xffffffffUL; \
static u64 mxc_sdhc ## n ## _dmamask = 0xffffffffUL; \
struct platform_device mxc_sdhc_device0 = { \
.name = "mxc-mmc", struct platform_device mxc_sdhc_device ## n = { \
.id = 0, .name = "mxc-mmc", \
.dev = { .id = n, \
.dma_mask = &mxc_sdhc1_dmamask, .dev = { \
.coherent_dma_mask = 0xffffffff, .dma_mask = &mxc_sdhc ## n ## _dmamask, \
}, .coherent_dma_mask = 0xffffffff, \
.num_resources = ARRAY_SIZE(mxc_sdhc1_resources), }, \
.resource = mxc_sdhc1_resources, .num_resources = ARRAY_SIZE(mxc_sdhc_resources ## n), \
}; .resource = mxc_sdhc_resources ## n, \
}
static struct resource mxc_sdhc2_resources[] = {
{
.start = SDHC2_BASE_ADDR,
.end = SDHC2_BASE_ADDR + SZ_4K - 1,
.flags = IORESOURCE_MEM,
}, {
.start = MXC_INT_SDHC2,
.end = MXC_INT_SDHC2,
.flags = IORESOURCE_IRQ,
}, {
.start = DMA_REQ_SDHC2,
.end = DMA_REQ_SDHC2,
.flags = IORESOURCE_DMA,
},
};
static u64 mxc_sdhc2_dmamask = 0xffffffffUL; DEFINE_MXC_MMC_DEVICE(0, MX2x_SDHC1_BASE_ADDR, MX2x_INT_SDHC1, MX2x_DMA_REQ_SDHC1);
DEFINE_MXC_MMC_DEVICE(1, MX2x_SDHC2_BASE_ADDR, MX2x_INT_SDHC2, MX2x_DMA_REQ_SDHC2);
struct platform_device mxc_sdhc_device1 = {
.name = "mxc-mmc",
.id = 1,
.dev = {
.dma_mask = &mxc_sdhc2_dmamask,
.coherent_dma_mask = 0xffffffff,
},
.num_resources = ARRAY_SIZE(mxc_sdhc2_resources),
.resource = mxc_sdhc2_resources,
};
#ifdef CONFIG_MACH_MX27 #ifdef CONFIG_MACH_MX27
static struct resource otg_resources[] = { static struct resource otg_resources[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment