From patchwork Wed Aug 31 12:55:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 75091 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp321533qga; Wed, 31 Aug 2016 05:56:28 -0700 (PDT) X-Received: by 10.66.164.104 with SMTP id yp8mr16490667pab.47.1472648188248; Wed, 31 Aug 2016 05:56:28 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id q7si31410889pap.88.2016.08.31.05.56.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 05:56:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BE006E74E; Wed, 31 Aug 2016 12:56:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id C2DC06E1C4 for ; Wed, 31 Aug 2016 12:56:16 +0000 (UTC) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCR001LAYLQMW00@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 31 Aug 2016 13:56:14 +0100 (BST) X-AuditID: cbfec7f4-f79cb6d000001359-39-57c6d3ee92aa Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id F8.00.04953.EE3D6C75; Wed, 31 Aug 2016 13:56:14 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OCR00GIKYLJHR40@eusync1.samsung.com>; Wed, 31 Aug 2016 13:56:14 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 3/6] drm/exynos: rotator: fix system and runtime pm integration Date: Wed, 31 Aug 2016 14:55:56 +0200 Message-id: <1472648159-9814-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> References: <1472648159-9814-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLLMWRmVeSWpSXmKPExsVy+t/xy7rvLh8LN9h2nM/i1rpzrBYbZ6xn tbjy9T2bxaT7E1gsXty7yGLx+oWhRc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA7cHve7jzN5 9G1ZxejxeZNcAHMUl01Kak5mWWqRvl0CV8byD+0sBc95KnZcd2tgfM3VxcjJISFgItHbdJgV whaTuHBvPVsXIxeHkMBSRolFE34wQzhNTBJnTi9gAaliEzCU6HrbxQZiiwikSnSvXc8EUsQs 8JhJ4s2q+ewgCWEBf4nWtptMIDaLgKpE/8qdYDavgLtE65q7TBDr5CROHpsMtppTwENi9ay3 YLYQUM3ah+dZJzDyLmBkWMUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kREmhfdjAuPmZ1iFGA g1GJhzdjxtFwIdbEsuLK3EOMEhzMSiK85y4dCxfiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3fX +xAhgfTEktTs1NSC1CKYLBMHp1QDY49C31mmQ18CgnJm/9uWeLt0Q/v5B+X+m18FLOCN3XHl 1oKm3X2n2GPuKHu+VzsuFLFFZlfzEcE0XS6ZxmORIt3AoMudldgR6asU8fK04p6ajFO2r644 1t2a/nb78/Y6dffFPls/ijm9X8/2gPf7lIubF8YoLLRtNPrSkDHB8KnspyjfWAs2JZbijERD Leai4kQABfueijACAAA= Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Sylwester Nawrocki , 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" Use generic helpers instead of open-coding usage of runtime pm for system sleep pm, which was potentially broken for some corner cases. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_rotator.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 404367a430b5..6591e406084c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -794,29 +794,6 @@ static int rotator_clk_crtl(struct rot_context *rot, bool enable) return 0; } - -#ifdef CONFIG_PM_SLEEP -static int rotator_suspend(struct device *dev) -{ - struct rot_context *rot = dev_get_drvdata(dev); - - if (pm_runtime_suspended(dev)) - return 0; - - return rotator_clk_crtl(rot, false); -} - -static int rotator_resume(struct device *dev) -{ - struct rot_context *rot = dev_get_drvdata(dev); - - if (!pm_runtime_suspended(dev)) - return rotator_clk_crtl(rot, true); - - return 0; -} -#endif - static int rotator_runtime_suspend(struct device *dev) { struct rot_context *rot = dev_get_drvdata(dev); @@ -833,7 +810,8 @@ static int rotator_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops rotator_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(rotator_suspend, rotator_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume, NULL) };