From patchwork Thu Mar 11 11:56:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maulik Mankad X-Patchwork-Id: 84862 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2BBurca002631 for ; Thu, 11 Mar 2010 11:56:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757619Ab0CKL4t (ORCPT ); Thu, 11 Mar 2010 06:56:49 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:47316 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757614Ab0CKL4s (ORCPT ); Thu, 11 Mar 2010 06:56:48 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o2BBuXn8023694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Mar 2010 05:56:35 -0600 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o2BBuR2d011193; Thu, 11 Mar 2010 17:26:27 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id o2BBuR4p021642; Thu, 11 Mar 2010 17:26:27 +0530 Received: (from x0082077@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o2BBuPgx021639; Thu, 11 Mar 2010 17:26:25 +0530 From: Maulik Mankad To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, Maulik Mankad , Felipe Balbi , David Brownell , Greg Kroah-Hartman , Sergei Shtylyov , Olof Johansson Subject: [PATCH v2 1/3] USB: MUSB: Set transceiver interface type Date: Thu, 11 Mar 2010 17:26:25 +0530 Message-Id: <1268308585-21604-1-git-send-email-x0082077@ti.com> X-Mailer: git-send-email 1.5.5 USB: MUSB: Set transceiver interface type Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Mar 2010 11:56:53 +0000 (UTC) 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/musb_core.c =================================================================== --- mainline.orig/drivers/usb/musb/musb_core.c +++ mainline/drivers/usb/musb/musb_core.c @@ -1948,7 +1948,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 @@ -608,7 +608,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 musb_writel(musb->mregs, OTG_SYSCONFIG, l); l = musb_readl(musb->mregs, 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; + } + musb_writel(musb->mregs, OTG_INTERFSEL, l); pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, " 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;