]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
tweak musb_hdrc SOC init code
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 2 Sep 2008 19:05:00 +0000 (12:05 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 10 Sep 2008 23:50:21 +0000 (16:50 -0700)
Minor cleanups to omap 2430/34xx/35x musb_hdrc init:

 - num_eps is 16; here, each one is bidirectional
 - use DMA_32BIT_MASK to prevent confusion/errors
 - initialize root port power to reflect 100 mA limit

This still hard-wires some board-specific data, since there
are no hooks through which different boards can provide the
right data to the init code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/usb-musb.c

index 3f90a933ab2af446f81f6d10dac4ede2757707c7..61c5709dcbd65714085b38b6f7f52713582f1727 100644 (file)
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/dma-mapping.h>
+
 #include <asm/io.h>
-#include <mach/mux.h>
+
 #include <linux/usb/musb.h>
 
 #include <mach/hardware.h>
 #include <mach/pm.h>
+#include <mach/mux.h>
 #include <mach/usb.h>
 
 #ifdef CONFIG_USB_MUSB_SOC
@@ -109,7 +112,7 @@ static struct musb_hdrc_config musb_config = {
        .dyn_fifo       = 1,
        .soft_con       = 1,
        .dma            = 1,
-       .num_eps        = 32,
+       .num_eps        = 16,
        .dma_channels   = 7,
        .dma_req_chan   = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
        .ram_bits       = 12,
@@ -129,16 +132,22 @@ static struct musb_hdrc_platform_data musb_plat = {
                        : "usbhs_ick",
        .set_clock      = musb_set_clock,
        .config         = &musb_config,
+
+       /* REVISIT charge pump on TWL4030 can supply up to
+        * 100 mA ... but this value is board-specific, like
+        * "mode", and should be passed to usb_musb_init().
+        */
+       .power          = 50,                   /* up to 100 mA */
 };
 
-static u64 musb_dmamask = ~(u32)0;
+static u64 musb_dmamask = DMA_32BIT_MASK;
 
 static struct platform_device musb_device = {
        .name           = "musb_hdrc",
        .id             = -1,
        .dev = {
                .dma_mask               = &musb_dmamask,
-               .coherent_dma_mask      = 0xffffffff,
+               .coherent_dma_mask      = DMA_32BIT_MASK,
                .platform_data          = &musb_plat,
        },
        .num_resources  = ARRAY_SIZE(musb_resources),