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: 5253021 Return-Path: X-Original-To: patchwork-linux-arm@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 A42AEC11AC for ; Fri, 7 Nov 2014 13:57:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D32A9200FF for ; Fri, 7 Nov 2014 13:57:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D11F200DC for ; Fri, 7 Nov 2014 13:57:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xmk0N-0006kL-NR; Fri, 07 Nov 2014 13:55:11 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xmjzs-0005DB-QN for linux-arm-kernel@lists.infradead.org; Fri, 07 Nov 2014 13:54:42 +0000 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 linux-arm-kernel@lists.infradead.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== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141107_055441_058520_18F69925 X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.6 (-----) Cc: Krzysztof Kozlowski , Grygorii Strashko , Bartlomiej Zolnierkiewicz , Kevin Hilman , Andrzej Hajda , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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);