Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965072AbbEMM1U (ORCPT ); Wed, 13 May 2015 08:27:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:23371 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964874AbbEMM1P (ORCPT ); Wed, 13 May 2015 08:27:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,420,1427785200"; d="scan'208";a="493059216" From: Heikki Krogerus To: Felipe Balbi Cc: David Cohen , Greg Kroah-Hartman , Baolu Lu , Kishon Vijay Abraham I , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: =?UTF-8?q?=5B=CD=84PATCHv5=2007/12=5D=20usb=3A=20dwc3=3A=20setup=20phys=20earlier?= Date: Wed, 13 May 2015 15:26:48 +0300 Message-Id: <1431520013-78645-8-git-send-email-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431520013-78645-1-git-send-email-heikki.krogerus@linux.intel.com> References: <1431520013-78645-1-git-send-email-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1971 Lines: 68 This allows dwc3_phy_setup() to be more useful later. There is nothing preventing the PHY configuration registers from being programmed early. They do not loose their context in soft reset. There are however other PHY related operations that should be executed before the driver request handles to the PHYs, such as registering DWC3's ULPI interface, which can now be done in dwc3_phy_setup(). Also, if there ever was need for the two 100ms delays in dwc3_phy_setup() there isn't anymore. The PHYs are now reset after the PHY interfaces are setup. Signed-off-by: Heikki Krogerus Acked-by: David Cohen --- drivers/usb/dwc3/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 921f181..6b02e12 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -436,8 +436,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); - mdelay(100); - reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); /* @@ -453,8 +451,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc) reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); - - mdelay(100); } /** @@ -569,8 +565,6 @@ static int dwc3_core_init(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_GCTL, reg); - dwc3_phy_setup(dwc); - ret = dwc3_alloc_scratch_buffers(dwc); if (ret) goto err1; @@ -892,6 +886,8 @@ static int dwc3_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dwc); dwc3_cache_hwparams(dwc); + dwc3_phy_setup(dwc); + ret = dwc3_core_get_phy(dwc); if (ret) goto err0; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/