4 #include <linux/kernel.h>
5 #include <linux/module.h>
6 #include <linux/init.h>
7 #include <linux/platform_device.h>
8 #include <linux/dma-mapping.h>
10 #include <linux/usb/musb.h>
11 #include <linux/usb/otg.h>
13 #include <mach/common.h>
14 #include <mach/hardware.h>
16 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
17 static struct musb_hdrc_eps_bits musb_eps[] = {
28 static struct musb_hdrc_config musb_config = {
40 static struct musb_hdrc_platform_data usb_data = {
41 #if defined(CONFIG_USB_MUSB_OTG)
42 /* OTG requires a Mini-AB connector */
44 #elif defined(CONFIG_USB_MUSB_PERIPHERAL)
45 .mode = MUSB_PERIPHERAL,
46 #elif defined(CONFIG_USB_MUSB_HOST)
49 .config = &musb_config,
52 static struct resource usb_resources[] = {
54 /* physical address */
55 .start = DAVINCI_USB_OTG_BASE,
56 .end = DAVINCI_USB_OTG_BASE + 0x5ff,
57 .flags = IORESOURCE_MEM,
61 .flags = IORESOURCE_IRQ,
65 static u64 usb_dmamask = DMA_32BIT_MASK;
67 static struct platform_device usb_dev = {
71 .platform_data = &usb_data,
72 .dma_mask = &usb_dmamask,
73 .coherent_dma_mask = DMA_32BIT_MASK,
75 .resource = usb_resources,
76 .num_resources = ARRAY_SIZE(usb_resources),
79 #ifdef CONFIG_USB_MUSB_OTG
81 static struct otg_transceiver *xceiv;
83 struct otg_transceiver *otg_get_transceiver(void)
86 get_device(xceiv->dev);
89 EXPORT_SYMBOL(otg_get_transceiver);
91 int otg_set_transceiver(struct otg_transceiver *x)
98 EXPORT_SYMBOL(otg_set_transceiver);
102 void __init setup_usb(unsigned mA, unsigned potpgt_msec)
104 usb_data.power = mA / 2;
105 usb_data.potpgt = potpgt_msec / 2;
106 platform_device_register(&usb_dev);
111 void __init setup_usb(unsigned mA, unsigned potpgt_msec)
115 #endif /* CONFIG_USB_MUSB_HDRC */