MUSB on OMAP3EVM uses ISP1504 phy and doesn't need twl4030.
OMAP35xx Beagle board MUSB uses twl4030 phy thus uses it and
it also sets xceiv global field using otg_set_transceiver().
As OMAP3EVM MUSB doesn't require twl4030 so otg_set_transceiver()
part is being done in this patch.

This is a temporary patch and the updated patch will come soon.

Signed-off-by: Manikandan Pillai <[EMAIL PROTECTED]>
---
 drivers/usb/musb/omap2430.c |   53 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 03fc864..9aa4518 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -215,13 +215,60 @@ void musb_platform_set_mode(struct musb *musb, u8 
musb_mode)
        }
 }
 
+#ifdef CONFIG_MACH_OMAP3EVM
+static int omap3_evm_otg_set_host(struct otg_transceiver *xceiv,
+                        struct usb_bus *host)
+{
+       if (!xceiv)
+               return -ENODEV;
+
+       if (!host) {
+               xceiv->host = NULL;
+               return -ENODEV;
+       }
+       DBG(2, "xceiv in host\n");
+       xceiv->host = host;
+       return 0;
+}
+static int omap3_evm_otg_set_peripheral(struct otg_transceiver *xceiv,
+               struct usb_gadget *gadget)
+{
+       if (!xceiv)
+               return -ENODEV;
+
+       if (!gadget) {
+               xceiv->gadget = NULL;
+               return -ENODEV;
+       }
+       DBG(2, "xceiv in peripheral\n");
+       xceiv->gadget = gadget;
+       xceiv->state = OTG_STATE_B_IDLE;
+       return 0;
+
+}
+static int omap3_evm_otg_set_suspend(struct otg_transceiver *x, int suspend)
+{
+       DBG(2, "xceiv suspend\n");
+       return 0;
+}
+#endif
+
 int __init musb_platform_init(struct musb *musb)
 {
-       struct otg_transceiver *x = otg_get_transceiver();
+       struct otg_transceiver *x;
        u32 l;
 
 #if defined(CONFIG_ARCH_OMAP2430)
        omap_cfg_reg(AE5_2430_USB0HS_STP);
+       x = otg_get_transceiver();
+#elif defined(CONFIG_MACH_OMAP3EVM)
+       x = kzalloc(sizeof *x, GFP_KERNEL);
+       if (!x)
+               return 0;
+       x->set_host = omap3_evm_otg_set_host;
+       x->set_peripheral = omap3_evm_otg_set_peripheral;
+       x->set_suspend = omap3_evm_otg_set_suspend;
+       otg_set_transceiver(x);
 #endif
 
        musb->xceiv = *x;
@@ -323,6 +370,8 @@ int musb_platform_exit(struct musb *musb)
 
        clk_put(musb->clock);
        musb->clock = 0;
-
+#if defined(CONFIG_MACH_OMAP3EVM)
+       kfree(&musb->xceiv);
+#endif
        return 0;
 }
-- 
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to