1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <linux/dma-mapping.h>
22#include <linux/platform_device.h>
23#include <linux/usb/tilegx.h>
24#include <linux/types.h>
25
26static u64 ehci_dmamask = DMA_BIT_MASK(32);
27
28#define USB_HOST_DEF(unit, type, dmamask) \
29 static struct \
30 tilegx_usb_platform_data tilegx_usb_platform_data_ ## type ## \
31 hci ## unit = { \
32 .dev_index = unit, \
33 }; \
34 \
35 static struct platform_device tilegx_usb_ ## type ## hci ## unit = { \
36 .name = "tilegx-" #type "hci", \
37 .id = unit, \
38 .dev = { \
39 .dma_mask = dmamask, \
40 .coherent_dma_mask = DMA_BIT_MASK(32), \
41 .platform_data = \
42 &tilegx_usb_platform_data_ ## type ## hci ## \
43 unit, \
44 }, \
45 };
46
47USB_HOST_DEF(0, e, &ehci_dmamask)
48USB_HOST_DEF(0, o, NULL)
49USB_HOST_DEF(1, e, &ehci_dmamask)
50USB_HOST_DEF(1, o, NULL)
51
52#undef USB_HOST_DEF
53
54static struct platform_device *tilegx_usb_devices[] __initdata = {
55 &tilegx_usb_ehci0,
56 &tilegx_usb_ehci1,
57 &tilegx_usb_ohci0,
58 &tilegx_usb_ohci1,
59};
60
61
62static int __init tilegx_usb_init(void)
63{
64 platform_add_devices(tilegx_usb_devices,
65 ARRAY_SIZE(tilegx_usb_devices));
66
67 return 0;
68}
69arch_initcall(tilegx_usb_init);
70