From patchwork Thu Oct 23 13:48:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5140661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0172BC11AC for ; Thu, 23 Oct 2014 13:48:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 208BA20268 for ; Thu, 23 Oct 2014 13:48:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4924A20265 for ; Thu, 23 Oct 2014 13:48:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 535616E45B; Thu, 23 Oct 2014 06:48:44 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTP id E920A6E446 for ; Thu, 23 Oct 2014 06:48:40 -0700 (PDT) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDW006OCH5XSBB0@mailout1.w1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 23 Oct 2014 14:51:33 +0100 (BST) X-AuditID: cbfec7f4-b7f6c6d00000120b-95-54490737c4b5 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 02.C7.04619.73709445; Thu, 23 Oct 2014 14:48:39 +0100 (BST) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NDW005PLH0TGQ80@eusync4.samsung.com>; Thu, 23 Oct 2014 14:48:39 +0100 (BST) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , David Airlie , Kukjin Kim , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [RFC 2/2] drm/exynos/dsi: Add runtime PM so LCD power domain could be turned off Date: Thu, 23 Oct 2014 15:48:10 +0200 Message-id: <1414072090-11293-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1414072090-11293-1-git-send-email-k.kozlowski@samsung.com> References: <1414072090-11293-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t/xa7rm7J4hBidvsljcWneO1aL33Ekm i40z1rNaXPn6ns2iefF6NotJ9yewWLy4d5HF4vULQ4veBVfZLM42vWG3mDVlL5PFpsfXWC0u 75rDZvG59wijxYzz+5gs1h65y25x99RRNoszpy+xWsyY/JLNQdhj8Z6XTB7bvz1g9dg/dw27 x/3u40wem5fUe2y52s7i0bdlFaPHitXf2T0+b5IL4IzisklJzcksSy3St0vgynjU9Ial4L9g xYNZx5kaGCfwdTFyckgImEjseruOBcIWk7hwbz1bFyMXh5DAUkaJtxO2MUE4fUwSy6asB6ti EzCW2Lx8CRuILSKwnkXi0kEvkCJmgf2MEr/urmQFSQgLREtMO/KPEcRmEVCVmHZ1D1Ccg4NX wF1iyaJyiG1yEiePTQYr5xTwkHg65zEzSIkQUMmyLRYTGHkXMDKsYhRNLU0uKE5KzzXUK07M LS7NS9dLzs/dxAgJ+C87GBcfszrEKMDBqMTDW5HsESLEmlhWXJl7iFGCg1lJhDee1TNEiDcl sbIqtSg/vqg0J7X4ECMTB6dUA6NPwYsyzaJbQdXyeWuDLZM2cXvxb5a4tOfX931JLdNl9jL+ 2Syn+ndLeXTWlzfqkRdK+FNeLTvIs+/RhqwNvGeTn2RaxvLU73PoXtDUJ3VZIdWsQevk/v+z 9uREazxavHP19CUH5SL/7P9YFHD+/4xbXDPXprj5LzIrbUw7IblOKPdHqf8XLmUlluKMREMt 5qLiRADnML+EVgIAAA== Cc: Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add runtime Power Management to the Exynos DSI driver so the LCD power domain could be turned off. This slightly reduces the energy consumption when screen is completely turned off. On Trats2 board when the system was idle the energy consumption dropped by 1% (from 92.2 mA to 91.1 mA). Before the patch: $ cat cat /sys/kernel/debug/pm_genpd/pm_genpd_summary lcd0-power-domain on /devices/11c00000.fimd suspended /devices/11c80000.dsi unsupported After applying the patch: lcd0-power-domain off /devices/11c00000.fimd suspended /devices/11c80000.dsi suspended Signed-off-by: Krzysztof Kozlowski --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 24741d8758e8..19ed36d2d557 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -1356,6 +1357,8 @@ static int exynos_dsi_enable(struct exynos_dsi *dsi) if (dsi->state & DSIM_STATE_ENABLED) return 0; + pm_runtime_get_sync(dsi->dev); + ret = exynos_dsi_poweron(dsi); if (ret < 0) return ret; @@ -1392,6 +1395,8 @@ static void exynos_dsi_disable(struct exynos_dsi *dsi) drm_panel_unprepare(dsi->panel); exynos_dsi_poweroff(dsi); + pm_runtime_put_sync(dsi->dev); + dsi->state &= ~DSIM_STATE_ENABLED; } @@ -1772,6 +1777,8 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (ret) goto err_del_component; + pm_runtime_enable(&pdev->dev); + return ret; err_del_component: @@ -1781,6 +1788,8 @@ err_del_component: static int exynos_dsi_remove(struct platform_device *pdev) { + pm_runtime_disable(&pdev->dev); + component_del(&pdev->dev, &exynos_dsi_component_ops); exynos_drm_component_del(&pdev->dev, EXYNOS_DEVICE_TYPE_CONNECTOR);