From patchwork Fri Nov 7 13:53:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5252971 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 5CD8DC11AD for ; Fri, 7 Nov 2014 13:54:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3EF920145 for ; Fri, 7 Nov 2014 13:54:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A5B89200FF for ; Fri, 7 Nov 2014 13:54:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 398496E7E4; Fri, 7 Nov 2014 05:54:19 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F2DF6E793 for ; Fri, 7 Nov 2014 05:54:16 -0800 (PST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEO00K8H9F6LF40@mailout3.w1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 07 Nov 2014 13:57:06 +0000 (GMT) X-AuditID: cbfec7f4-b7f6c6d00000120b-be-545ccf0640ce Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id B9.93.04619.60FCC545; Fri, 07 Nov 2014 13:54:14 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NEO00MHA9A8LC90@eusync1.samsung.com>; Fri, 07 Nov 2014 13:54:14 +0000 (GMT) From: Krzysztof Kozlowski To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , David Airlie , Kukjin Kim , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/exynos/dsi: Add runtime PM so LCD power domain could be turned off Date: Fri, 07 Nov 2014 14:53:59 +0100 Message-id: <1415368439-23642-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415368439-23642-1-git-send-email-k.kozlowski@samsung.com> References: <1415368439-23642-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJLMWRmVeSWpSXmKPExsVy+t/xy7ps52NCDBa+V7S4te4cq0XvuZNM FhtnrGe1uPL1PZvFyiksFpPuT2CxeHHvIovF6xeGFr0LrrJZPN38mMnibNMbdotNj6+xWlze NYfNYsb5fUwWa4/cZbeYMfklm4OAx6ZVnWwe2789YPW4332cyWPzknqPvi2rGD2O39jO5PF5 k1wAexSXTUpqTmZZapG+XQJXxsX7F9gLGoUqHsw6ztTAOIGvi5GDQ0LAROLFd+cuRk4gU0zi wr31bF2MXBxCAksZJT50XmKGcPqYJI5fm8sKUsUmYCyxefkSsCoRge9MElOerGcHSTALTGGS mHqmAsQWFkiQ+NexhAVkA4uAqsSao9kgYV4Bd4lLW6eyQGyTkzh5bDLYTE4BD4nejvdgthBQ zavj01knMPIuYGRYxSiaWppcUJyUnmuoV5yYW1yal66XnJ+7iRESvF92MC4+ZnWIUYCDUYmH t1MoJkSINbGsuDL3EKMEB7OSCO+N40Ah3pTEyqrUovz4otKc1OJDjEwcnFINjNM53/1S3mY/ W5f/XnCM2C3TVr5FHleqFK/8zBPZX6PMPfc5u37lzP5Vz9/vcDQJn/w+ii1Ac8PE1F0tKyac divtL8r69H9i7yw9Ltate1In7HqW99iOocl49vKfdxaG6q2NE5rZk1sTGs124pZ/TuuLtpUf jL4cujdJeV3wvXwZ0b/b2nrjDyuxFGckGmoxFxUnAgC0zb7bPAIAAA== Cc: Krzysztof Kozlowski , Grygorii Strashko , Bartlomiej Zolnierkiewicz , Kevin Hilman , Andrzej Hajda , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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=-4.8 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);