linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	linux-pm@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ulf Hansson <ulf.hansson@linaro.org>,
	David Airlie <airlied@linux.ie>,
	Kukjin Kim <kgene.kim@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Kevin Hilman <khilman@linaro.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: [PATCH 5/5] drm/exynos: Convert to suspend_late/resume_early callbacks for fimc
Date: Wed, 27 Nov 2013 16:35:00 +0100	[thread overview]
Message-ID: <1385566500-7666-6-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1385566500-7666-1-git-send-email-ulf.hansson@linaro.org>

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 <airlied@linux.ie>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 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[] = {
-- 
1.7.9.5


  parent reply	other threads:[~2013-11-27 15:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 15:34 [PATCH 0/5] PM: Enable option of re-use runtime PM callbacks at system suspend Ulf Hansson
2013-11-27 15:34 ` [PATCH 1/5] PM / Sleep: Add pm_generic functions to re-use runtime PM callbacks Ulf Hansson
2013-12-03 23:15   ` Rafael J. Wysocki
2013-12-03 23:41     ` Rafael J. Wysocki
2013-12-04 11:00       ` Ulf Hansson
2013-11-27 15:34 ` [PATCH 2/5] PM / Runtime: Implement the pm_generic_runtime functions for CONFIG_PM Ulf Hansson
2013-11-27 15:34 ` [PATCH 3/5] PM / Runtime: Add second macro for definition of runtime PM callbacks Ulf Hansson
2013-11-27 15:34 ` [PATCH 4/5] PM / Sleep: Add macro to define common late/early system " Ulf Hansson
2013-11-27 15:35 ` Ulf Hansson [this message]
2013-11-27 20:42 ` [PATCH 0/5] PM: Enable option of re-use runtime PM callbacks at system suspend Rafael J. Wysocki
2013-11-28  9:58   ` Ulf Hansson
2013-11-28 21:16     ` Rafael J. Wysocki
2013-11-29  9:32       ` Ulf Hansson
2013-11-29  9:35         ` Ulf Hansson
2013-11-29 13:52         ` Rafael J. Wysocki
2013-11-29 14:02           ` Rafael J. Wysocki
2013-11-29 15:30             ` Alan Stern
2013-11-29 21:20               ` Rafael J. Wysocki
2013-12-02 15:50                 ` Ulf Hansson
2013-12-05 21:46                   ` Len Brown
2013-12-05 22:21                     ` Alan Stern
2013-12-06  0:53                       ` Pavel Machek
2013-12-02 15:21           ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385566500-7666-6-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=airlied@linux.ie \
    --cc=gregkh@linuxfoundation.org \
    --cc=kgene.kim@samsung.com \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).