* [RFT][PATCH 00/12] change drivers power management to use dev_pm_ops
@ 2014-02-10 16:12 Shuah Khan
2014-02-10 16:12 ` [RFT][PATCH 04/12] drivers/macintosh/adb: change platform " Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2014-02-10 16:12 UTC (permalink / raw)
To: rjw
Cc: Shuah Khan, heiko.carstens, chris, shuahkhan, dwalker,
ingo.tuchscherer, sonic.zhang, linux-s390, linux, davidb,
linux-pm, linux-arm-msm, linux-pcmcia, adi-buildroot-devel,
mirq-linux, ian, manuel.lauss, linux-arm-kernel, gregkh,
linux-mmc, linux-kernel, schwidefsky, linux390, linuxppc-dev
Change drivers 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. Bus drivers suspend and resume routines call .pm driver
hooks if found.
Shuah Khan (12):
arm: change locomo platform and bus power management to use
dev_pm_ops
arm: change sa1111 platform and bus power management to use
dev_pm_ops
arm: change scoop platform power management to use dev_pm_ops
drivers/macintosh/adb: change platform power managemnet to use
dev_pm_ops
mmc: change au1xmmc platform power management to use dev_pm_ops
mmc: change bfin_sdh platform power management to use dev_pm_ops
isa: change isa bus power managemnet to use dev_pm_ops
mmc: change cb710-mmc platform power management to use dev_pm_ops
mmc: change msm_sdcc platform power management to use dev_pm_ops
mmc: change tmio_mmc platform power management to use dev_pm_ops
drivers/pcmcia: change ds driver power management to use dev_pm_ops
drivers/s390/crypto: change ap_bus driver power management to use
dev_pm_ops
arch/arm/common/locomo.c | 93 +++++++++++++++++++++++++++++++++++-------
arch/arm/common/sa1111.c | 88 +++++++++++++++++++++++++++++++--------
arch/arm/common/scoop.c | 44 ++++++++++++++++----
drivers/base/isa.c | 30 ++++++++++++--
drivers/macintosh/adb.c | 41 ++++++++++++++++---
drivers/mmc/host/au1xmmc.c | 43 +++++++++++++++----
drivers/mmc/host/bfin_sdh.c | 40 +++++++++++++++---
drivers/mmc/host/cb710-mmc.c | 37 +++++++++++++++--
drivers/mmc/host/msm_sdcc.c | 42 +++++++++++++++----
drivers/mmc/host/tmio_mmc.c | 42 +++++++++++++++----
drivers/pcmcia/ds.c | 36 +++++++++++++---
drivers/s390/crypto/ap_bus.c | 30 ++++++++++++--
12 files changed, 481 insertions(+), 85 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [RFT][PATCH 04/12] drivers/macintosh/adb: change platform power management to use dev_pm_ops
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 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2014-02-10 16:12 UTC (permalink / raw)
To: rjw, benh; +Cc: shuahkhan, Shuah Khan, linuxppc-dev, linux-kernel, linux-pm
Change adb platform 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/macintosh/adb.c | 41 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 04a5049..df6b201 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -263,7 +263,7 @@ adb_reset_bus(void)
/*
* notify clients before sleep
*/
-static int adb_suspend(struct platform_device *dev, pm_message_t state)
+static int __adb_suspend(struct platform_device *dev, pm_message_t state)
{
adb_got_sleep = 1;
/* We need to get a lock on the probe thread */
@@ -276,10 +276,25 @@ static int adb_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
+static int adb_suspend(struct device *dev)
+{
+ return __adb_suspend(to_platform_device(dev), PMSG_SUSPEND);
+}
+
+static int adb_freeze(struct device *dev)
+{
+ return __adb_suspend(to_platform_device(dev), PMSG_FREEZE);
+}
+
+static int adb_poweroff(struct device *dev)
+{
+ return __adb_suspend(to_platform_device(dev), PMSG_HIBERNATE);
+}
+
/*
* reset bus after sleep
*/
-static int adb_resume(struct platform_device *dev)
+static int __adb_resume(struct platform_device *dev)
{
adb_got_sleep = 0;
up(&adb_probe_mutex);
@@ -287,6 +302,11 @@ static int adb_resume(struct platform_device *dev)
return 0;
}
+
+static int adb_resume(struct device *dev)
+{
+ return __adb_resume(to_platform_device(dev));
+}
#endif /* CONFIG_PM */
static int __init adb_init(void)
@@ -831,14 +851,25 @@ static const struct file_operations adb_fops = {
.release = adb_release,
};
+#ifdef CONFIG_PM
+static const struct dev_pm_ops adb_dev_pm_ops = {
+ .suspend = adb_suspend,
+ .resume = adb_resume,
+ /* Hibernate hooks */
+ .freeze = adb_freeze,
+ .thaw = adb_resume,
+ .poweroff = adb_poweroff,
+ .restore = adb_resume,
+};
+#endif
+
static struct platform_driver adb_pfdrv = {
.driver = {
.name = "adb",
- },
#ifdef CONFIG_PM
- .suspend = adb_suspend,
- .resume = adb_resume,
+ .pm = &adb_dev_pm_ops,
#endif
+ },
};
static struct platform_device adb_pfdev = {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-10 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 04/12] drivers/macintosh/adb: change platform " Shuah Khan
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).