From patchwork Wed Aug 18 02:55:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Munegowda, Keshava" X-Patchwork-Id: 120178 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7IEtlCC011710 for ; Wed, 18 Aug 2010 14:55:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753758Ab0HROz2 (ORCPT ); Wed, 18 Aug 2010 10:55:28 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:51795 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753751Ab0HROz1 (ORCPT ); Wed, 18 Aug 2010 10:55:27 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o7IEtRwv020866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Aug 2010 09:55:27 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o7IEtO2k013356; Wed, 18 Aug 2010 09:55:24 -0500 (CDT) Received: from localhost (a0393220-desktop.apr.dhcp.ti.com [172.24.137.6]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o7IEtMf17198; Wed, 18 Aug 2010 09:55:22 -0500 (CDT) From: Keshava Munegowda To: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Cc: Keshava Munegowda , Anand Gadiyar Subject: [PATCH 3/5] usb: ehci: relocate PHY reset code Date: Wed, 18 Aug 2010 08:25:43 +0530 Message-Id: <1282100145-27485-4-git-send-email-keshava_mgowda@ti.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1282100145-27485-3-git-send-email-keshava_mgowda@ti.com> References: <1282100145-27485-1-git-send-email-keshava_mgowda@ti.com> <1282100145-27485-2-git-send-email-keshava_mgowda@ti.com> <1282100145-27485-3-git-send-email-keshava_mgowda@ti.com> 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]); Wed, 18 Aug 2010 14:55:48 +0000 (UTC) Index: linux-2.6/drivers/usb/host/ehci-omap.c =================================================================== --- linux-2.6.orig/drivers/usb/host/ehci-omap.c +++ linux-2.6/drivers/usb/host/ehci-omap.c @@ -279,6 +279,24 @@ static int omap_start_ehc(struct ehci_hc dev_dbg(omap->dev, "starting TI EHCI USB Controller\n"); + if (omap->phy_reset) { + /* Refer: ISSUE1 */ + if (gpio_is_valid(omap->reset_gpio_port[0])) { + gpio_request(omap->reset_gpio_port[0], + "USB1 PHY reset"); + gpio_direction_output(omap->reset_gpio_port[0], 0); + } + + if (gpio_is_valid(omap->reset_gpio_port[1])) { + gpio_request(omap->reset_gpio_port[1], + "USB2 PHY reset"); + gpio_direction_output(omap->reset_gpio_port[1], 0); + } + + /* Hold the PHY in RESET for enough time till DIR is high */ + udelay(10); + } + /* Enable Clocks for USBHOST */ omap->usbhost_ick = clk_get(omap->dev, "usbhost_ick"); if (IS_ERR(omap->usbhost_ick)) { @@ -301,24 +319,6 @@ static int omap_start_ehc(struct ehci_hc } clk_enable(omap->usbhost_fs_fck); - if (omap->phy_reset) { - /* Refer: ISSUE1 */ - if (gpio_is_valid(omap->reset_gpio_port[0])) { - gpio_request(omap->reset_gpio_port[0], - "USB1 PHY reset"); - gpio_direction_output(omap->reset_gpio_port[0], 0); - } - - if (gpio_is_valid(omap->reset_gpio_port[1])) { - gpio_request(omap->reset_gpio_port[1], - "USB2 PHY reset"); - gpio_direction_output(omap->reset_gpio_port[1], 0); - } - - /* Hold the PHY in RESET for enough time till DIR is high */ - udelay(10); - } - /* Configure TLL for 60Mhz clk for ULPI */ omap->usbtll_fck = clk_get(omap->dev, "usbtll_fck"); if (IS_ERR(omap->usbtll_fck)) { @@ -476,14 +476,6 @@ err_tll_fck: clk_disable(omap->usbhost_fs_fck); clk_put(omap->usbhost_fs_fck); - if (omap->phy_reset) { - if (gpio_is_valid(omap->reset_gpio_port[0])) - gpio_free(omap->reset_gpio_port[0]); - - if (gpio_is_valid(omap->reset_gpio_port[1])) - gpio_free(omap->reset_gpio_port[1]); - } - err_host_fs_fck: clk_disable(omap->usbhost_hs_fck); clk_put(omap->usbhost_hs_fck); @@ -493,6 +485,14 @@ err_host_hs_fck: clk_put(omap->usbhost_ick); err_host_ick: + if (omap->phy_reset) { + if (gpio_is_valid(omap->reset_gpio_port[0])) + gpio_free(omap->reset_gpio_port[0]); + + if (gpio_is_valid(omap->reset_gpio_port[1])) + gpio_free(omap->reset_gpio_port[1]); + } + return ret; }