diff mbox

[1/4] USB: MUSB: Set transceiver interface type

Message ID 1267079703-14316-1-git-send-email-x0082077@ti.com (mailing list archive)
State Awaiting Upstream, archived
Delegated to: Felipe Balbi
Headers show

Commit Message

Maulik Mankad Feb. 25, 2010, 6:35 a.m. UTC
None
diff mbox

Patch

Index: mainline/drivers/usb/musb/musb_core.c
===================================================================
--- mainline.orig/drivers/usb/musb/musb_core.c
+++ mainline/drivers/usb/musb/musb_core.c
@@ -1959,7 +1959,7 @@  bad_config:
 	 * isp1504, non-OTG, etc) mostly hooking up through ULPI.
 	 */
 	musb->isr = generic_interrupt;
-	status = musb_platform_init(musb);
+	status = musb_platform_init(musb, plat->board_data);
 
 	if (status < 0)
 		goto fail;
Index: mainline/drivers/usb/musb/musb_core.h
===================================================================
--- mainline.orig/drivers/usb/musb/musb_core.h
+++ mainline/drivers/usb/musb/musb_core.h
@@ -567,7 +567,7 @@  extern int musb_platform_get_vbus_status
 #define musb_platform_get_vbus_status(x)	0
 #endif
 
-extern int __init musb_platform_init(struct musb *musb);
+extern int __init musb_platform_init(struct musb *musb, void *board_data);
 extern int musb_platform_exit(struct musb *musb);
 
 #endif	/* __MUSB_CORE_H__ */
Index: mainline/drivers/usb/musb/omap2430.c
===================================================================
--- mainline.orig/drivers/usb/musb/omap2430.c
+++ mainline/drivers/usb/musb/omap2430.c
@@ -200,9 +200,10 @@  int musb_platform_set_mode(struct musb *
 	return 0;
 }
 
-int __init musb_platform_init(struct musb *musb)
+int __init musb_platform_init(struct musb *musb, void *board_data)
 {
 	u32 l;
+	struct omap_musb_board_data *data = board_data;
 
 #if defined(CONFIG_ARCH_OMAP2430)
 	omap_cfg_reg(AE5_2430_USB0HS_STP);
@@ -236,7 +237,15 @@  int __init musb_platform_init(struct mus
 	omap_writel(l, OTG_SYSCONFIG);
 
 	l = omap_readl(OTG_INTERFSEL);
-	l |= ULPI_12PIN;
+
+	if (data->interface_type == MUSB_INTERFACE_UTMI) {
+		/* OMAP4 uses Internal PHY GS70 which uses UTMI interface */
+		l &= ~ULPI_12PIN;       /* Disable ULPI */
+		l |= UTMI_8BIT;         /* Enable UTMI  */
+	} else {
+		l |= ULPI_12PIN;
+	}
+
 	omap_writel(l, OTG_INTERFSEL);
 
 	pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, "
Index: mainline/drivers/usb/musb/blackfin.c
===================================================================
--- mainline.orig/drivers/usb/musb/blackfin.c
+++ mainline/drivers/usb/musb/blackfin.c
@@ -277,7 +277,7 @@  int musb_platform_set_mode(struct musb *
 	return -EIO;
 }
 
-int __init musb_platform_init(struct musb *musb)
+int __init musb_platform_init(struct musb *musb, void *board_data)
 {
 
 	/*
Index: mainline/drivers/usb/musb/davinci.c
===================================================================
--- mainline.orig/drivers/usb/musb/davinci.c
+++ mainline/drivers/usb/musb/davinci.c
@@ -377,7 +377,7 @@  int musb_platform_set_mode(struct musb *
 	return -EIO;
 }
 
-int __init musb_platform_init(struct musb *musb)
+int __init musb_platform_init(struct musb *musb, void *board_data)
 {
 	void __iomem	*tibase = musb->ctrl_base;
 	u32		revision;
Index: mainline/drivers/usb/musb/tusb6010.c
===================================================================
--- mainline.orig/drivers/usb/musb/tusb6010.c
+++ mainline/drivers/usb/musb/tusb6010.c
@@ -1091,7 +1091,7 @@  err:
 	return -ENODEV;
 }
 
-int __init musb_platform_init(struct musb *musb)
+int __init musb_platform_init(struct musb *musb, void *board_data)
 {
 	struct platform_device	*pdev;
 	struct resource		*mem;