public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] musb: Remvoing twl4030 dependency for OMAP3EVM MUSB
@ 2008-11-28  5:28 Manikandan Pillai
  2008-11-28  6:46 ` Felipe Balbi
  2008-11-28  7:02 ` David Brownell
  0 siblings, 2 replies; 10+ messages in thread
From: Manikandan Pillai @ 2008-11-28  5:28 UTC (permalink / raw)
  To: linux-omap; +Cc: Manikandan Pillai

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 <mani.pillai@ti.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-11-28 19:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-28  5:28 [PATCH 3/3] musb: Remvoing twl4030 dependency for OMAP3EVM MUSB Manikandan Pillai
2008-11-28  6:46 ` Felipe Balbi
2008-11-28  6:51   ` Gupta, Ajay Kumar
2008-11-28  7:08     ` Felipe Balbi
2008-11-28  7:02 ` David Brownell
2008-11-28  7:58   ` Gupta, Ajay Kumar
2008-11-28 17:25     ` David Brownell
2008-11-28 17:59       ` Felipe Balbi
2008-11-28 18:37         ` David Brownell
2008-11-28 19:43           ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox