platform-fsl-usb2-udc.c 1.92 KB
Newer Older
1
2
3
4
5
6
7
8
/*
 * Copyright (C) 2010 Pengutronix
 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License version 2 as published by the
 * Free Software Foundation.
 */
9
#include <linux/dma-mapping.h>
10
11

#include "../hardware.h"
12
#include "devices-common.h"
13

14
#define imx_fsl_usb2_udc_data_entry_single(soc, _devid)			\
15
	{								\
16
		.devid = _devid,					\
17
18
19
20
		.iobase = soc ## _USB_OTG_BASE_ADDR,			\
		.irq = soc ## _INT_USB_OTG,				\
	}

21
#ifdef CONFIG_SOC_IMX25
22
const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
23
	imx_fsl_usb2_udc_data_entry_single(MX25, "imx-udc-mx27");
24
#endif /* ifdef CONFIG_SOC_IMX25 */
25

26
27
#ifdef CONFIG_SOC_IMX27
const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
28
	imx_fsl_usb2_udc_data_entry_single(MX27, "imx-udc-mx27");
29
30
#endif /* ifdef CONFIG_SOC_IMX27 */

31
32
#ifdef CONFIG_SOC_IMX31
const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst =
33
	imx_fsl_usb2_udc_data_entry_single(MX31, "imx-udc-mx27");
34
35
36
37
#endif /* ifdef CONFIG_SOC_IMX31 */

#ifdef CONFIG_SOC_IMX35
const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
38
	imx_fsl_usb2_udc_data_entry_single(MX35, "imx-udc-mx27");
39
40
#endif /* ifdef CONFIG_SOC_IMX35 */

41
42
#ifdef CONFIG_SOC_IMX51
const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data __initconst =
43
	imx_fsl_usb2_udc_data_entry_single(MX51, "imx-udc-mx51");
44
45
#endif

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
struct platform_device *__init imx_add_fsl_usb2_udc(
		const struct imx_fsl_usb2_udc_data *data,
		const struct fsl_usb2_platform_data *pdata)
{
	struct resource res[] = {
		{
			.start = data->iobase,
			.end = data->iobase + SZ_512 - 1,
			.flags = IORESOURCE_MEM,
		}, {
			.start = data->irq,
			.end = data->irq,
			.flags = IORESOURCE_IRQ,
		},
	};
61
	return imx_add_platform_device_dmamask(data->devid, -1,
62
63
64
			res, ARRAY_SIZE(res),
			pdata, sizeof(*pdata), DMA_BIT_MASK(32));
}