From patchwork Mon Apr 1 13:54:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 2370991 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1A8CC3FD40 for ; Mon, 1 Apr 2013 13:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758652Ab3DAN6D (ORCPT ); Mon, 1 Apr 2013 09:58:03 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:57893 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758529Ab3DAN6A (ORCPT ); Mon, 1 Apr 2013 09:58:00 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKK00LJDXGNS7Z0@mailout1.samsung.com>; Mon, 01 Apr 2013 22:57:59 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 9F.3F.05174.66299515; Mon, 01 Apr 2013 22:57:58 +0900 (KST) X-AuditID: cbfee68f-b7f4a6d000001436-01-51599266fefe Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 7B.C5.17838.66299515; Mon, 01 Apr 2013 22:57:58 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKK00JXCXD41C70@mmp1.samsung.com>; Mon, 01 Apr 2013 22:57:58 +0900 (KST) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, balbi@ti.com, stern@rowland.harvard.edu, sarah.a.sharp@linux.intel.com, rob.herring@calxeda.com, kgene.kim@samsung.com, kishon@ti.com, dianders@chromium.org, t.figa@samsung.com, p.paneri@samsung.com Subject: [PATCH v3 05/11] usb: dwc3: exynos: Enable runtime power management Date: Mon, 01 Apr 2013 19:24:04 +0530 Message-id: <1364824448-14732-6-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1364824448-14732-1-git-send-email-gautam.vivek@samsung.com> References: <1364824448-14732-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWyRsSkWjdtUmSgwbl3NhYH79dbnF12kM2i efF6NoveBVfZLC487WGzuLxrDpvF7CX9LBYzzu9jsli0rJXZ4vyWTiaLwysOMFk0nzjFbDHh 9wU2i/UzXrM48Hks+HyF3WN2w0UWj3knAz32z10D5N39wejRt2UVo8fxG9uZPD5vkgvgiOKy SUnNySxLLdK3S+DKOPJuInNBL2/Fvzk32BoYu7i7GDk5JARMJO5cPMwEYYtJXLi3nq2LkYtD SGApo8TFjlvsMEWTr89lhEgsYpTYOXcNlDOFSWLNoWNsIFVsAroSTW93ASU4OEQE4iQ2TxAG CTMLdDFJLD0qDmILC/hI/Ph1Emwoi4CqxO57z8BaeQU8JE6+/coKsUxB4s3tZ8wgNqeAp8SH rYvBrhMCqmm/eoIVZK+EwCN2iadzfzJBDBKQ+Db5EAvIXgkBWYlNB5gh5khKHFxxg2UCo/AC RoZVjKKpBckFxUnpRcZ6xYm5xaV56XrJ+bmbGIFxdPrfs/4djHcPWB9iTAYaN5FZSjQ5HxiH eSXxhsZmRhamJqbGRuaWZqQJK4nzqrVYBwoJpCeWpGanphakFsUXle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r/A3vRcVPyU9vQ2/5qR8rhTeyXhoeV1RQ8LJlh3X+8XK6nge MkqutLFfE6rN0HXBSvP5xC/HN945H3zYZ9LMT+2qqjwsSizFGYmGWsxFxYkA5VvHAxYDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Enabling runtime power management on dwc3-exynos letting dwc3 controller to be autosuspended on exynos platform when not in use. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/dwc3-exynos.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 1ea7bd8..1ae81a0 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -138,6 +139,11 @@ static int dwc3_exynos_probe(struct platform_device *pdev) exynos->dev = dev; exynos->clk = clk; + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + pm_runtime_forbid(dev); + clk_prepare_enable(exynos->clk); if (node) { @@ -152,10 +158,14 @@ static int dwc3_exynos_probe(struct platform_device *pdev) goto err2; } + pm_runtime_put_sync(dev); + pm_runtime_allow(dev); + return 0; err2: clk_disable_unprepare(clk); + pm_runtime_disable(dev); err1: return ret; } @@ -164,6 +174,8 @@ static int dwc3_exynos_remove(struct platform_device *pdev) { struct dwc3_exynos *exynos = platform_get_drvdata(pdev); + pm_runtime_disable(&pdev->dev); + platform_device_unregister(exynos->usb2_phy); platform_device_unregister(exynos->usb3_phy); device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);