Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / arch / arm / plat-mxc / devices / platform-fsl-usb2-udc.c
blob23ce08e6ffd25d9bacb48b2698e2905c5a0350b3
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 <mach/hardware.h>
11 #include <mach/devices-common.h>
13 #define imx_fsl_usb2_udc_data_entry_single(soc) \
14 { \
15 .iobase = soc ## _USB_OTG_BASE_ADDR, \
16 .irq = soc ## _INT_USB_OTG, \
19 #ifdef CONFIG_SOC_IMX25
20 const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
21 imx_fsl_usb2_udc_data_entry_single(MX25);
22 #endif /* ifdef CONFIG_SOC_IMX25 */
24 #ifdef CONFIG_SOC_IMX27
25 const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
26 imx_fsl_usb2_udc_data_entry_single(MX27);
27 #endif /* ifdef CONFIG_SOC_IMX27 */
29 #ifdef CONFIG_SOC_IMX31
30 const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst =
31 imx_fsl_usb2_udc_data_entry_single(MX31);
32 #endif /* ifdef CONFIG_SOC_IMX31 */
34 #ifdef CONFIG_SOC_IMX35
35 const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
36 imx_fsl_usb2_udc_data_entry_single(MX35);
37 #endif /* ifdef CONFIG_SOC_IMX35 */
39 struct platform_device *__init imx_add_fsl_usb2_udc(
40 const struct imx_fsl_usb2_udc_data *data,
41 const struct fsl_usb2_platform_data *pdata)
43 struct resource res[] = {
45 .start = data->iobase,
46 .end = data->iobase + SZ_512 - 1,
47 .flags = IORESOURCE_MEM,
48 }, {
49 .start = data->irq,
50 .end = data->irq,
51 .flags = IORESOURCE_IRQ,
54 return imx_add_platform_device_dmamask("fsl-usb2-udc", -1,
55 res, ARRAY_SIZE(res),
56 pdata, sizeof(*pdata), DMA_BIT_MASK(32));