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>
15 #include <mach/irqs.h>
17 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
18 static struct musb_hdrc_eps_bits musb_eps
[] = {
29 static struct musb_hdrc_config musb_config
= {
41 static struct musb_hdrc_platform_data usb_data
= {
42 #if defined(CONFIG_USB_MUSB_OTG)
43 /* OTG requires a Mini-AB connector */
45 #elif defined(CONFIG_USB_MUSB_PERIPHERAL)
46 .mode
= MUSB_PERIPHERAL
,
47 #elif defined(CONFIG_USB_MUSB_HOST)
51 .config
= &musb_config
,
54 static struct resource usb_resources
[] = {
56 /* physical address */
57 .start
= DAVINCI_USB_OTG_BASE
,
58 .end
= DAVINCI_USB_OTG_BASE
+ 0x5ff,
59 .flags
= IORESOURCE_MEM
,
63 .flags
= IORESOURCE_IRQ
,
67 static u64 usb_dmamask
= DMA_32BIT_MASK
;
69 static struct platform_device usb_dev
= {
73 .platform_data
= &usb_data
,
74 .dma_mask
= &usb_dmamask
,
75 .coherent_dma_mask
= DMA_32BIT_MASK
,
77 .resource
= usb_resources
,
78 .num_resources
= ARRAY_SIZE(usb_resources
),
81 void __init
setup_usb(unsigned mA
, unsigned potpgt_msec
)
83 usb_data
.power
= mA
/ 2;
84 usb_data
.potpgt
= potpgt_msec
/ 2;
85 platform_device_register(&usb_dev
);
90 void __init
setup_usb(unsigned mA
, unsigned potpgt_msec
)
94 #endif /* CONFIG_USB_MUSB_HDRC */