summaryrefslogtreecommitdiff
path: root/arch/arm/mach-sa1100/neponset.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-25 03:29:47 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-09 19:34:17 +0400
commit51f93390c21a4154b0520c3a8a34733e4072a7db (patch)
tree1b606b7fd233c4947a0f669f2858d8f7a021d0ad /arch/arm/mach-sa1100/neponset.c
parentd2e539a5ebd6b204037deb44c416a9e20b5d2354 (diff)
downloadlinux-51f93390c21a4154b0520c3a8a34733e4072a7db.tar.xz
ARM: sa11x0: neponset: suspend/resume in _noirq state
Suspend and resume in the _noirq state, so that we're saving the state of the modem control signals as late as possible, and restoring them as early as possible. There's nothing to do in thaw/poweroff methods as we've already saved the necessary state. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100/neponset.c')
-rw-r--r--arch/arm/mach-sa1100/neponset.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 2451a38aa2f0..59223baa7c1d 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -8,6 +8,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/pm.h>
#include <linux/serial_core.h>
#include <linux/slab.h>
@@ -303,10 +304,10 @@ static int __devexit neponset_remove(struct platform_device *dev)
return 0;
}
-#ifdef CONFIG_PM
-static int neponset_suspend(struct platform_device *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int neponset_suspend(struct device *dev)
{
- struct neponset_drvdata *d = platform_get_drvdata(dev);
+ struct neponset_drvdata *d = dev_get_drvdata(dev);
d->ncr0 = NCR_0;
d->mdm_ctl_0 = MDM_CTL_0;
@@ -314,9 +315,9 @@ static int neponset_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
-static int neponset_resume(struct platform_device *dev)
+static int neponset_resume(struct device *dev)
{
- struct neponset_drvdata *d = platform_get_drvdata(dev);
+ struct neponset_drvdata *d = dev_get_drvdata(dev);
NCR_0 = d->ncr0;
MDM_CTL_0 = d->mdm_ctl_0;
@@ -324,19 +325,24 @@ static int neponset_resume(struct platform_device *dev)
return 0;
}
+static const struct dev_pm_ops neponset_pm_ops = {
+ .suspend_noirq = neponset_suspend,
+ .resume_noirq = neponset_resume,
+ .freeze_noirq = neponset_suspend,
+ .restore_noirq = neponset_resume,
+};
+#define PM_OPS &neponset_pm_ops
#else
-#define neponset_suspend NULL
-#define neponset_resume NULL
+#define PM_OPS NULL
#endif
static struct platform_driver neponset_device_driver = {
.probe = neponset_probe,
.remove = __devexit_p(neponset_remove),
- .suspend = neponset_suspend,
- .resume = neponset_resume,
.driver = {
.name = "neponset",
.owner = THIS_MODULE,
+ .pm = PM_OPS,
},
};