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.
9 #include <mach/hardware.h>
10 #include <mach/devices-common.h>
12 #define imx_imx_udc_data_entry_single(soc, _size) \
14 .iobase = soc ## _USBD_BASE_ADDR, \
16 .irq0 = soc ## _INT_USBD0, \
17 .irq1 = soc ## _INT_USBD1, \
18 .irq2 = soc ## _INT_USBD2, \
19 .irq3 = soc ## _INT_USBD3, \
20 .irq4 = soc ## _INT_USBD4, \
21 .irq5 = soc ## _INT_USBD5, \
22 .irq6 = soc ## _INT_USBD6, \
25 #define imx_imx_udc_data_entry(soc, _size) \
26 [_id] = imx_imx_udc_data_entry_single(soc, _size)
28 #ifdef CONFIG_SOC_IMX1
29 const struct imx_imx_udc_data imx1_imx_udc_data __initconst
=
30 imx_imx_udc_data_entry_single(MX1
, SZ_4K
);
31 #endif /* ifdef CONFIG_SOC_IMX1 */
33 struct platform_device
*__init
imx_add_imx_udc(
34 const struct imx_imx_udc_data
*data
,
35 const struct imxusb_platform_data
*pdata
)
37 struct resource res
[] = {
39 .start
= data
->iobase
,
40 .end
= data
->iobase
+ data
->iosize
- 1,
41 .flags
= IORESOURCE_MEM
,
45 .flags
= IORESOURCE_IRQ
,
49 .flags
= IORESOURCE_IRQ
,
53 .flags
= IORESOURCE_IRQ
,
57 .flags
= IORESOURCE_IRQ
,
61 .flags
= IORESOURCE_IRQ
,
65 .flags
= IORESOURCE_IRQ
,
69 .flags
= IORESOURCE_IRQ
,
73 return imx_add_platform_device("imx_udc", 0,
74 res
, ARRAY_SIZE(res
), pdata
, sizeof(*pdata
));