X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Farm%2Fmach-omap2%2Fusb-musb.c;h=927c2d91a036c15ec7d741bb1d822bc1be8f770b;hb=4311ae5aa39c5cb942afc4d4e2a1a08e8d2b0d04;hp=5d79f898248ce9fadb121d02bb30980ad328675f;hpb=96584c6afee1ab7ea408e6f9331ab64399f821d3;p=linux-2.6-omap-h63xx.git diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 5d79f898248..927c2d91a03 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c @@ -22,8 +22,7 @@ #include #include #include - -#include +#include #include @@ -33,15 +32,8 @@ #include #include -#ifdef CONFIG_USB_MUSB_SOC static struct resource musb_resources[] = { - [0] = { - .start = cpu_is_omap34xx() - ? OMAP34XX_HSUSB_OTG_BASE - : OMAP243X_HS_BASE, - .end = cpu_is_omap34xx() - ? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1 - : OMAP243X_HS_BASE + SZ_8K - 1, + [0] = { /* start and end set dynamically */ .flags = IORESOURCE_MEM, }, [1] = { /* general IRQ */ @@ -128,9 +120,7 @@ static struct musb_hdrc_platform_data musb_plat = { #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) .mode = MUSB_PERIPHERAL, #endif - .clock = cpu_is_omap34xx() - ? "hsotgusb_ick" - : "usbhs_ick", + /* .clock is set dynamically */ .set_clock = musb_set_clock, .config = &musb_config, @@ -154,16 +144,42 @@ static struct platform_device musb_device = { .num_resources = ARRAY_SIZE(musb_resources), .resource = musb_resources, }; -#endif +#ifdef CONFIG_NOP_USB_XCEIV +static u64 nop_xceiv_dmamask = DMA_32BIT_MASK; + +static struct platform_device nop_xceiv_device = { + .name = "nop_usb_xceiv", + .id = -1, + .dev = { + .dma_mask = &nop_xceiv_dmamask, + .coherent_dma_mask = DMA_32BIT_MASK, + .platform_data = NULL, + }, +}; +#endif void __init usb_musb_init(void) { -#ifdef CONFIG_USB_MUSB_SOC + if (cpu_is_omap243x()) { + musb_resources[0].start = OMAP243X_HS_BASE; + musb_plat.clock = "usbhs_ick"; + } else { + musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; + musb_plat.clock = "hsotgusb_ick"; + } + + musb_resources[0].end = musb_resources[0].start + SZ_8K - 1; + +#ifdef CONFIG_NOP_USB_XCEIV + if (platform_device_register(&nop_xceiv_device) < 0) { + printk(KERN_ERR "Unable to register NOP-XCEIV device\n"); + return; + } +#endif + if (platform_device_register(&musb_device) < 0) { printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); return; } -#endif } -