linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: rjw@rjwysocki.net, gregkh@linuxfoundation.org
Cc: Shuah Khan <shuah.kh@samsung.com>,
	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	[thread overview]
Message-ID: <7ba97d2e7665008d0db89a7a36333394e5596a5e.1392040068.git.shuah.kh@samsung.com> (raw)
In-Reply-To: <cover.1392040064.git.shuah.kh@samsung.com>
In-Reply-To: <cover.1392040064.git.shuah.kh@samsung.com>

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 <shuah.kh@samsung.com>
---
 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)
-- 
1.7.10.4


  parent reply	other threads:[~2014-02-10 16:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 16:12 [RFT][PATCH 00/12] change drivers power management to use dev_pm_ops Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 01/12] arm: change locomo platform and bus " Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 02/12] arm: change sa1111 " Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 03/12] arm: change scoop platform " Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 04/12] drivers/macintosh/adb: change " Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 05/12] mmc: change au1xmmc " Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 06/12] mmc: change bfin_sdh " Shuah Khan
2014-02-10 16:12 ` Shuah Khan [this message]
2014-02-10 16:12 ` [RFT][PATCH 08/12] mmc: change cb710-mmc " Shuah Khan
2014-02-10 23:49   ` Michał Mirosław
2014-02-11 15:38     ` Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 09/12] mmc: change msm_sdcc " Shuah Khan
2014-02-10 16:15 ` [RFT][PATCH 10/12] mmc: change tmio_mmc " Shuah Khan
2014-02-10 16:15 ` [RFT][PATCH 11/12] drivers/pcmcia: change ds driver " Shuah Khan
2014-02-10 16:15 ` [RFT][PATCH 12/12] drivers/s390/crypto: change ap_bus " Shuah Khan

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=7ba97d2e7665008d0db89a7a36333394e5596a5e.1392040068.git.shuah.kh@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --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;
as well as URLs for NNTP newsgroup(s).