This source file includes following definitions.
- imx_add_fsl_usb2_udc
1
2
3
4
5
6 #include <linux/dma-mapping.h>
7
8 #include "../hardware.h"
9 #include "devices-common.h"
10
11 #define imx_fsl_usb2_udc_data_entry_single(soc, _devid) \
12 { \
13 .devid = _devid, \
14 .iobase = soc ## _USB_OTG_BASE_ADDR, \
15 .irq = soc ## _INT_USB_OTG, \
16 }
17
18 #ifdef CONFIG_SOC_IMX27
19 const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
20 imx_fsl_usb2_udc_data_entry_single(MX27, "imx-udc-mx27");
21 #endif
22
23 #ifdef CONFIG_SOC_IMX31
24 const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst =
25 imx_fsl_usb2_udc_data_entry_single(MX31, "imx-udc-mx27");
26 #endif
27
28 #ifdef CONFIG_SOC_IMX35
29 const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
30 imx_fsl_usb2_udc_data_entry_single(MX35, "imx-udc-mx27");
31 #endif
32
33 struct platform_device *__init imx_add_fsl_usb2_udc(
34 const struct imx_fsl_usb2_udc_data *data,
35 const struct fsl_usb2_platform_data *pdata)
36 {
37 struct resource res[] = {
38 {
39 .start = data->iobase,
40 .end = data->iobase + SZ_512 - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq,
44 .end = data->irq,
45 .flags = IORESOURCE_IRQ,
46 },
47 };
48 return imx_add_platform_device_dmamask(data->devid, -1,
49 res, ARRAY_SIZE(res),
50 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
51 }