From patchwork Mon Feb 10 16:12:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 3620581 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E9B9BF418 for ; Mon, 10 Feb 2014 16:21:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C50C92010F for ; Mon, 10 Feb 2014 16:21:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 108D820148 for ; Mon, 10 Feb 2014 16:21:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbaBJQVs (ORCPT ); Mon, 10 Feb 2014 11:21:48 -0500 Received: from qmta08.emeryville.ca.mail.comcast.net ([76.96.30.80]:39443 "EHLO qmta08.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbaBJQVr (ORCPT ); Mon, 10 Feb 2014 11:21:47 -0500 Received: from omta20.emeryville.ca.mail.comcast.net ([76.96.30.87]) by qmta08.emeryville.ca.mail.comcast.net with comcast id Qf6S1n0011smiN4A8gMn17; Mon, 10 Feb 2014 16:21:47 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta20.emeryville.ca.mail.comcast.net with comcast id QgMl1n00o0MU7Qa8ggMmiS; Mon, 10 Feb 2014 16:21:46 +0000 Received: from lorien.sisa.samsung.com (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id F21F342597; Mon, 10 Feb 2014 09:12:42 -0700 (MST) From: Shuah Khan To: rjw@rjwysocki.net, gregkh@linuxfoundation.org Cc: Shuah Khan , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, shuahkhan@gmail.com Subject: [RFT][PATCH 07/12] isa: change isa bus power management to use dev_pm_ops Date: Mon, 10 Feb 2014 09:12:30 -0700 Message-Id: <7ba97d2e7665008d0db89a7a36333394e5596a5e.1392040068.git.shuah.kh@samsung.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1392049307; bh=2ETQ5El6cARPgxER5RQIaPw8QM9b6732++Zl4KdMKcg=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=qTRv8Gf6FzCn6iocyGqQLH7r1hb2BbJAl8unpixep+g4xv8EE3sGnZhD+7NWyY/+Q LZzjKbzfUYCyQJKQzVsQcWGKMi8kQn8ytn+O9igFvlrXy0SuNEoLOkofrAOUORu5pz 4FcyV/9kfVuSKNb/DF7nHOn2mVwhpZaWBVGIHeX3axdnkF/xHwuU9tYaqjTB9wTv1m C/yj9+AZZm0zO5wk5AtN1m68AhLTvIJB6NLCyVotF+uyTHHJFJOScgLYC/Xx5DeNPU WTVlyCRWVJmKnVFxUMOcyrbVpIRcnxQz6dR1Adzh/U3K9+vkI4T1nxRm54j8nC5ee7 ac2H4UJMjQGKA== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.4 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 Change isa bus driver to register pm ops using dev_pm_ops instead of legacy pm_ops. .pm hooks call existing legacy suspend and resume interfaces by passing in the right pm state. Signed-off-by: Shuah Khan --- drivers/base/isa.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/base/isa.c b/drivers/base/isa.c index 91dba65..15b8825 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -63,7 +63,7 @@ static void isa_bus_shutdown(struct device *dev) isa_driver->shutdown(dev, to_isa_dev(dev)->id); } -static int isa_bus_suspend(struct device *dev, pm_message_t state) +static int __isa_bus_suspend(struct device *dev, pm_message_t state) { struct isa_driver *isa_driver = dev->platform_data; @@ -73,6 +73,21 @@ static int isa_bus_suspend(struct device *dev, pm_message_t state) return 0; } +static int isa_bus_suspend(struct device *dev) +{ + return __isa_bus_suspend(dev, PMSG_SUSPEND); +} + +static int isa_bus_freeze(struct device *dev) +{ + return __isa_bus_suspend(dev, PMSG_FREEZE); +} + +static int isa_bus_poweroff(struct device *dev) +{ + return __isa_bus_suspend(dev, PMSG_HIBERNATE); +} + static int isa_bus_resume(struct device *dev) { struct isa_driver *isa_driver = dev->platform_data; @@ -83,14 +98,23 @@ static int isa_bus_resume(struct device *dev) return 0; } +static const struct dev_pm_ops isa_bus_dev_pm_ops = { + .suspend = isa_bus_suspend, + .resume = isa_bus_resume, + /* Hibernate callbacks */ + .freeze = isa_bus_freeze, + .thaw = isa_bus_resume, + .poweroff = isa_bus_poweroff, + .restore = isa_bus_resume, +}; + static struct bus_type isa_bus_type = { .name = "isa", .match = isa_bus_match, .probe = isa_bus_probe, .remove = isa_bus_remove, .shutdown = isa_bus_shutdown, - .suspend = isa_bus_suspend, - .resume = isa_bus_resume + .pm = &isa_bus_dev_pm_ops, }; static void isa_dev_release(struct device *dev)