From patchwork Fri Jan 25 03:00:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 2039921 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 1D4DCDF264 for ; Fri, 25 Jan 2013 03:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756784Ab3AYDDW (ORCPT ); Thu, 24 Jan 2013 22:03:22 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:47822 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755886Ab3AYDBK (ORCPT ); Thu, 24 Jan 2013 22:01:10 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0P314kL001106; Thu, 24 Jan 2013 21:01:05 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0P313p7009298; Fri, 25 Jan 2013 08:31:03 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Fri, 25 Jan 2013 08:31:03 +0530 Received: from a0393678lt.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0P30vAi024595; Fri, 25 Jan 2013 08:31:03 +0530 From: Kishon Vijay Abraham I To: , , , , , , , CC: , , Subject: [PATCH v3 10/11] usb: dwc3: core: enable the USB2 and USB3 phy in probe Date: Fri, 25 Jan 2013 08:30:54 +0530 Message-ID: <1359082855-7404-11-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359082855-7404-1-git-send-email-kishon@ti.com> References: <1359082855-7404-1-git-send-email-kishon@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 Enabled the USB2 and USB3 PHY in probe by calling usb_phy_set_suspend and disabled the PHYs on driver removal. When PM is implemented this will be optimized to enable the PHYs only when needed. Signed-off-by: Kishon Vijay Abraham I --- drivers/usb/dwc3/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c1fb6d2..af189d5 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -438,6 +438,9 @@ static int dwc3_probe(struct platform_device *pdev) return -EPROBE_DEFER; } + usb_phy_set_suspend(dwc->usb2_phy, 0); + usb_phy_set_suspend(dwc->usb3_phy, 0); + spin_lock_init(&dwc->lock); platform_set_drvdata(pdev, dwc); @@ -559,6 +562,9 @@ static int dwc3_remove(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + usb_phy_set_suspend(dwc->usb2_phy, 1); + usb_phy_set_suspend(dwc->usb3_phy, 1); + pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev);