mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: pavel@ucw.cz, rjw@sisk.pl, len.brown@intel.com,
	gregkh@linuxfoundation.org, airlied@linux.ie
Cc: Shuah Khan <shuah.kh@samsung.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, shuahkhan@gmail.com
Subject: [PATCH 1/2] power: add new interface to return pm_transition state
Date: Sat, 22 Jun 2013 14:11:14 -0600	[thread overview]
Message-ID: <1371931874-3220-1-git-send-email-shuah.kh@samsung.com> (raw)

Add a new interface get_pm_transition() to return pm_transition state.
This interface is intended to be used from dev_pm_ops class and type
suspend interfaces that call legacy pm ops driver suspend interfaces.
Legacy suspend pm_ops take pm_message_t as a parameter.

e.g: drm_class_suspend() calls into driver suspend routines
via drm_dev->driver->suspend(drm_dev, state).

Once drm_class_suspend() is converted to dev_pm_ops, it will no longer
have access to pm_transition which it has to pass into driver legacy
suspend calls. get_pm_transition() interface addresses this need.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/base/power/main.c |   17 +++++++++++++++++
 include/linux/pm.h        |    3 +++
 2 files changed, 20 insertions(+)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index c2132b8..3e2e09d 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -57,6 +57,23 @@ static pm_message_t pm_transition;
 static int async_error;
 
 /**
+ * get_pm_transition - return pm_transition state.
+ * This interface is intended to be used from dev_pm_ops class and type
+ * suspend interfaces that call legacy pm ops driver suspend interfaces.
+ * Legacy suspend pm_ops take pm_message_t as a parameter.
+ * e.g: drm_class_suspend() calls into driver suspend routines
+ * via drm_dev->driver->suspend(drm_dev, state).
+ * Once drm_class_suspend() is converted to dev_pm_ops, it will no longer
+ * have access to pm_transition which it has to pass into driver legacy
+ * suspend calls. get_pm_transition() interface addresses this need.
+*/
+pm_message_t get_pm_transition()
+{
+	return pm_transition;
+}
+EXPORT_SYMBOL_GPL(get_pm_transition);
+
+/**
  * device_pm_sleep_init - Initialize system suspend-related device fields.
  * @dev: Device object being initialized.
  */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index a224c7f..46f3252 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -63,6 +63,9 @@ typedef struct pm_message {
 	int event;
 } pm_message_t;
 
+/* drivers/base/power/main.c */
+extern pm_message_t get_pm_transition(void);
+
 /**
  * struct dev_pm_ops - device PM callbacks
  *
-- 
1.7.10.4


             reply	other threads:[~2013-06-22 20:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-22 20:11 Shuah Khan [this message]
2013-06-22 21:26 ` Rafael J. Wysocki
2013-06-24 16:20   ` Shuah Khan
2013-06-24 19:44     ` Rafael J. Wysocki

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=1371931874-3220-1-git-send-email-shuah.kh@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=shuahkhan@gmail.com \
    /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

all inboxes | Powered by JetHome®