From patchwork Wed Nov 27 15:35:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3248671 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CD9D59F694 for ; Wed, 27 Nov 2013 15:36:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C15A2039C for ; Wed, 27 Nov 2013 15:36:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4746220121 for ; Wed, 27 Nov 2013 15:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757094Ab3K0Pfr (ORCPT ); Wed, 27 Nov 2013 10:35:47 -0500 Received: from mail-lb0-f175.google.com ([209.85.217.175]:37931 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757048Ab3K0Pfp (ORCPT ); Wed, 27 Nov 2013 10:35:45 -0500 Received: by mail-lb0-f175.google.com with SMTP id x18so5415968lbi.20 for ; Wed, 27 Nov 2013 07:35:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CSJfy5ToIckyxg4E7fLpPtRpdBlTsAgxktH3hJHy40I=; b=haEMtFmaAL1EXfJWbmZ19l9r7StxsevuuJqdlWT7XmfKpZ/uKt8Um4x+aNmsWWR2R7 AG4aVInZpEmiRteyYM5gf8YygIDENtpNGdNuPuLlNN99D6PcWKs479p7vSEXA6SGMh2m FpBMT0tOzvMg1Cd25dfUbUX22fc70mnScEKmCEMHV3rgvIc+bP743i5IvxcFzmSAsnhr twKryi4qwTA0Jc2rUwhS1dtcUe2NNBkKO6ZShaPHuKJfpel9iJowXeJEhm7fEvEiRZNI NPeadsmCmOjz6CsZtBLCJDISZU9+cmhAyE58u2/91Vc8JGiNn0ciYhrnHoBvyPdPOHM/ f/lA== X-Gm-Message-State: ALoCoQnGjHw2DzkBOUpbKbwQeGtv2059pm6Qz1ZEAMBir28N+VN+facOIjxN1ooJF54AxDRjIpMC X-Received: by 10.152.2.197 with SMTP id 5mr7524940law.17.1385566543707; Wed, 27 Nov 2013 07:35:43 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id c15sm8352568lbq.11.2013.11.27.07.35.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 07:35:42 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ulf Hansson , David Airlie , Kukjin Kim , linux-samsung-soc@vger.kernel.org, Kevin Hilman , Alan Stern Subject: [PATCH 5/5] drm/exynos: Convert to suspend_late/resume_early callbacks for fimc Date: Wed, 27 Nov 2013 16:35:00 +0100 Message-Id: <1385566500-7666-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1385566500-7666-1-git-send-email-ulf.hansson@linaro.org> References: <1385566500-7666-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 To simplify code for system suspend, convert the .suspend|resume callbacks into .suspend_late|resume_early. In general this could be convenient for any driver that supports both system PM and runtime PM. Move the runtime PM callbacks to be implemented within CONFIG_PM, to make them available for system PM. Use pm_generic_suspend_late_runtime and pm_generic_resume_early_runtime as the new callbacks. Cc: David Airlie Cc: Kukjin Kim Cc: linux-samsung-soc@vger.kernel.org Cc: Kevin Hilman Cc: Alan Stern Cc: Rafael J. Wysocki Cc: Pavel Machek Cc: Len Brown Signed-off-by: Ulf Hansson --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 33 ++++-------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8adfc8f..7aa17a3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1888,33 +1888,7 @@ static int fimc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int fimc_suspend(struct device *dev) -{ - struct fimc_context *ctx = get_fimc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (pm_runtime_suspended(dev)) - return 0; - - return fimc_clk_ctrl(ctx, false); -} - -static int fimc_resume(struct device *dev) -{ - struct fimc_context *ctx = get_fimc_context(dev); - - DRM_DEBUG_KMS("id[%d]\n", ctx->id); - - if (!pm_runtime_suspended(dev)) - return fimc_clk_ctrl(ctx, true); - - return 0; -} -#endif - -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int fimc_runtime_suspend(struct device *dev) { struct fimc_context *ctx = get_fimc_context(dev); @@ -1935,8 +1909,9 @@ static int fimc_runtime_resume(struct device *dev) #endif static const struct dev_pm_ops fimc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(fimc_suspend, fimc_resume) - SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_generic_suspend_late_runtime, + pm_generic_resume_early_runtime) + SET_PM_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL) }; static const struct of_device_id fimc_of_match[] = {