diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-24 18:29:47 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-09 10:34:17 -0500 |
commit | 51f93390c21a4154b0520c3a8a34733e4072a7db (patch) | |
tree | 1b606b7fd233c4947a0f669f2858d8f7a021d0ad /arch/arm/mach-sa1100/neponset.c | |
parent | d2e539a5ebd6b204037deb44c416a9e20b5d2354 (diff) |
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.c | 24 |
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 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | #include <linux/pm.h> | ||
11 | #include <linux/serial_core.h> | 12 | #include <linux/serial_core.h> |
12 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
13 | 14 | ||
@@ -303,10 +304,10 @@ static int __devexit neponset_remove(struct platform_device *dev) | |||
303 | return 0; | 304 | return 0; |
304 | } | 305 | } |
305 | 306 | ||
306 | #ifdef CONFIG_PM | 307 | #ifdef CONFIG_PM_SLEEP |
307 | static int neponset_suspend(struct platform_device *dev, pm_message_t state) | 308 | static int neponset_suspend(struct device *dev) |
308 | { | 309 | { |
309 | struct neponset_drvdata *d = platform_get_drvdata(dev); | 310 | struct neponset_drvdata *d = dev_get_drvdata(dev); |
310 | 311 | ||
311 | d->ncr0 = NCR_0; | 312 | d->ncr0 = NCR_0; |
312 | d->mdm_ctl_0 = MDM_CTL_0; | 313 | d->mdm_ctl_0 = MDM_CTL_0; |
@@ -314,9 +315,9 @@ static int neponset_suspend(struct platform_device *dev, pm_message_t state) | |||
314 | return 0; | 315 | return 0; |
315 | } | 316 | } |
316 | 317 | ||
317 | static int neponset_resume(struct platform_device *dev) | 318 | static int neponset_resume(struct device *dev) |
318 | { | 319 | { |
319 | struct neponset_drvdata *d = platform_get_drvdata(dev); | 320 | struct neponset_drvdata *d = dev_get_drvdata(dev); |
320 | 321 | ||
321 | NCR_0 = d->ncr0; | 322 | NCR_0 = d->ncr0; |
322 | MDM_CTL_0 = d->mdm_ctl_0; | 323 | MDM_CTL_0 = d->mdm_ctl_0; |
@@ -324,19 +325,24 @@ static int neponset_resume(struct platform_device *dev) | |||
324 | return 0; | 325 | return 0; |
325 | } | 326 | } |
326 | 327 | ||
328 | static const struct dev_pm_ops neponset_pm_ops = { | ||
329 | .suspend_noirq = neponset_suspend, | ||
330 | .resume_noirq = neponset_resume, | ||
331 | .freeze_noirq = neponset_suspend, | ||
332 | .restore_noirq = neponset_resume, | ||
333 | }; | ||
334 | #define PM_OPS &neponset_pm_ops | ||
327 | #else | 335 | #else |
328 | #define neponset_suspend NULL | 336 | #define PM_OPS NULL |
329 | #define neponset_resume NULL | ||
330 | #endif | 337 | #endif |
331 | 338 | ||
332 | static struct platform_driver neponset_device_driver = { | 339 | static struct platform_driver neponset_device_driver = { |
333 | .probe = neponset_probe, | 340 | .probe = neponset_probe, |
334 | .remove = __devexit_p(neponset_remove), | 341 | .remove = __devexit_p(neponset_remove), |
335 | .suspend = neponset_suspend, | ||
336 | .resume = neponset_resume, | ||
337 | .driver = { | 342 | .driver = { |
338 | .name = "neponset", | 343 | .name = "neponset", |
339 | .owner = THIS_MODULE, | 344 | .owner = THIS_MODULE, |
345 | .pm = PM_OPS, | ||
340 | }, | 346 | }, |
341 | }; | 347 | }; |
342 | 348 | ||