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: 2766051 Return-Path: X-Original-To: patchwork-linux-pm@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 8D84A9F472 for ; Sat, 22 Jun 2013 20:12:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F95720106 for ; Sat, 22 Jun 2013 20:12:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 865D22010B for ; Sat, 22 Jun 2013 20:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750830Ab3FVUL0 (ORCPT ); Sat, 22 Jun 2013 16:11:26 -0400 Received: from qmta03.emeryville.ca.mail.comcast.net ([76.96.30.32]:52255 "EHLO qmta03.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807Ab3FVULZ (ORCPT ); Sat, 22 Jun 2013 16:11:25 -0400 Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta03.emeryville.ca.mail.comcast.net with comcast id rXcR1l0011zF43QA3YBRiT; 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 Cc: Shuah Khan , 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 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=M5Kqq+rK+UcGeAek35CD7K8s4IOekUPR5ohnePI/PjEZGDKIBkatYUX8Ur24Truc0 iPauLont50lNdwFIVWS8rcRzUpi14IPUv4nGvXNPvosNHJP9AIe5ikkPSXr7uPnMss 1jCa7wplb0a13SZyrVzZNIVvRox3mUwVufIMJkRVZvscu9lq9za3ftg5BIwp5NANBW it0TWmdWlIpFxJFs22iyKsS08oKbocnew7MbBeHPc4JHHD8E/aapi3+rk8vDR5d+WZ Irzjk9ey/FIXMWqyLcCPL7dr8l9LZCFQK36sj5Xwr6E4oCZDcXqahNy6RA/i+VMRAi IYKLeRFDeR4DQ== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 *