From patchwork Sat Jun 22 20:11:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 2768401 Return-Path: X-Original-To: patchwork-dri-devel@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 56ACC9F472 for ; Sun, 23 Jun 2013 15:37:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B95020117 for ; Sun, 23 Jun 2013 15:37:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C8B9F2010F for ; Sun, 23 Jun 2013 15:36:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A8E9E5ED4 for ; Sun, 23 Jun 2013 08:36:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 487 seconds by postgrey-1.32 at gabe; Sat, 22 Jun 2013 13:19:32 PDT Received: from qmta12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net [76.96.27.227]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BDFCE5CDE for ; Sat, 22 Jun 2013 13:19:32 -0700 (PDT) Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta12.emeryville.ca.mail.comcast.net with comcast id rXkd1l0061zF43Q01YBRPj; Sat, 22 Jun 2013 20:11:25 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta24.emeryville.ca.mail.comcast.net with comcast id rYBN1l00G0MU7Qa8kYBNe8; Sat, 22 Jun 2013 20:11:24 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id 8B3E18018E; Sat, 22 Jun 2013 14:11:26 -0600 (MDT) From: Shuah Khan To: pavel@ucw.cz, rjw@sisk.pl, len.brown@intel.com, gregkh@linuxfoundation.org, airlied@linux.ie Subject: [PATCH 1/2] power: add new interface to return pm_transition state Date: Sat, 22 Jun 2013 14:11:14 -0600 Message-Id: <1371931874-3220-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.7.10.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1371931885; bh=OdI6WBENxVclGaYWSXkNVl1z3Su5SG2sGHDExkIuM2w=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=lZhmdg7quIyR+w84lxgi6mwb5BhYq2A47K3bQv9eoBasRtgsl9szE435Ul3cnto/n /IPLxkF/znHUfYQ+j8YGSnHrGY744r6KWKeeVjLsKGvk8u2CprF9Bko4/HaTETODsp fTepfARIORUkjwyfjE9eDSV8XUHvz5zwfnOiQ+QPY9sV4vG959fJKZuQOyJ9dH4czO NlbTfdhspQdqeZTSeNsMEvrY0b4ULgl0BiHWa0DKPKy6JmeHW/Zzhv+RLySxblhXmM G9/6WbnmUc/+kObQM6g8n2X2w6PExYWFxyfyp033v5JslgUwt7vUmknA2NOVrESZLq ssxii70r6r66w== X-Mailman-Approved-At: Sun, 23 Jun 2013 08:36:46 -0700 Cc: shuahkhan@gmail.com, Shuah Khan , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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 --- 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 *