From patchwork Tue Mar 12 11:09:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 2255291 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A8DFFDF23A for ; Tue, 12 Mar 2013 11:09:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932486Ab3CLLJO (ORCPT ); Tue, 12 Mar 2013 07:09:14 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:42909 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752623Ab3CLLJM (ORCPT ); Tue, 12 Mar 2013 07:09:12 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2CB96sB022067; Tue, 12 Mar 2013 06:09:06 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2CB95DI011521; Tue, 12 Mar 2013 06:09:05 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 12 Mar 2013 06:09:05 -0500 Received: from localhost.localdomain (h115-205.vpn.ti.com [172.24.115.205]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2CB92Uo018141; Tue, 12 Mar 2013 06:09:03 -0500 From: Roger Quadros To: CC: , , , , , , , , , Subject: [PATCH v2 12/12] USB: ehci-omap: Fix detection in HSIC mode Date: Tue, 12 Mar 2013 13:09:00 +0200 Message-ID: <1363086540-30567-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1363085090-24676-13-git-send-email-rogerq@ti.com> References: <1363085090-24676-13-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The HSIC devices need to be kept in reset while the EHCI controller is being initialized and only brought out of reset after the initialization is complete, else HSIC devices will not be detected. Also remove outdated TODO list from header. Signed-off-by: Roger Quadros CC: Alan Stern --- drivers/usb/host/ehci-omap.c | 38 +++++++++++++++----------------------- 1 files changed, 15 insertions(+), 23 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 1ba1df8..dc2de47 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -29,12 +29,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * TODO (last updated Feb 27, 2010): - * - add kernel-doc - * - enable AUTOIDLE - * - add suspend/resume - * - add HSIC and TLL support - * - convert to use hwmod and runtime PM */ #include @@ -90,26 +84,13 @@ static inline u32 ehci_read(void __iomem *base, u32 reg) static int omap_ehci_init(struct usb_hcd *hcd) { struct ehci_hcd *ehci = hcd_to_ehci(hcd); - struct omap_hcd *omap = (struct omap_hcd *)ehci->priv; - int rc, i; - - /* Hold PHYs in reset while initializing EHCI controller */ - for (i = 0; i < omap->nports; i++) { - if (omap->phy[i]) - usb_phy_shutdown(omap->phy[i]); - } + int rc; /* we know this is the memory we want, no need to ioremap again */ ehci->caps = hcd->regs; rc = ehci_setup(hcd); - /* Bring PHYs out of reset */ - for (i = 0; i < omap->nports; i++) { - if (omap->phy[i]) - usb_phy_init(omap->phy[i]); - } - return rc; } @@ -219,9 +200,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) } omap->phy[i] = phy; - usb_phy_init(omap->phy[i]); - /* bring PHY out of suspend */ - usb_phy_set_suspend(omap->phy[i], 0); } pm_runtime_enable(dev); @@ -245,6 +223,20 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) goto err_pm_runtime; } + /* + * Bring PHYs out of reset. + * Even though HSIC mode is a PHY-less mode, the reset + * line exists between the chips and can be modelled + * as a PHY device for reset control. + */ + for (i = 0; i < omap->nports; i++) { + if (!omap->phy[i]) + continue; + + usb_phy_init(omap->phy[i]); + /* bring PHY out of suspend */ + usb_phy_set_suspend(omap->phy[i], 0); + } return 0;