of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / arch / arm / mach-imx / devices / platform-fec.c
blobb403a4fe2892b3773f3b92ea6f8520b077269588
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 <linux/dma-mapping.h>
10 #include <asm/sizes.h>
12 #include "../hardware.h"
13 #include "devices-common.h"
15 #define imx_fec_data_entry_single(soc, _devid) \
16 { \
17 .devid = _devid, \
18 .iobase = soc ## _FEC_BASE_ADDR, \
19 .irq = soc ## _INT_FEC, \
22 #ifdef CONFIG_SOC_IMX27
23 const struct imx_fec_data imx27_fec_data __initconst =
24 imx_fec_data_entry_single(MX27, "imx27-fec");
25 #endif /* ifdef CONFIG_SOC_IMX27 */
27 #ifdef CONFIG_SOC_IMX35
28 /* i.mx35 has the i.mx27 type fec */
29 const struct imx_fec_data imx35_fec_data __initconst =
30 imx_fec_data_entry_single(MX35, "imx27-fec");
31 #endif
33 struct platform_device *__init imx_add_fec(
34 const struct imx_fec_data *data,
35 const struct fec_platform_data *pdata)
37 struct resource res[] = {
39 .start = data->iobase,
40 .end = data->iobase + SZ_4K - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq,
44 .end = data->irq,
45 .flags = IORESOURCE_IRQ,
49 return imx_add_platform_device_dmamask(data->devid, 0,
50 res, ARRAY_SIZE(res),
51 pdata, sizeof(*pdata), DMA_BIT_MASK(32));