diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-10-18 03:04:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 14:37:18 -0700 |
commit | 74f270af0c1ed5b9d4413784256959dcfe3593ce (patch) | |
tree | 5b74248167be086b0050a84f9ebe072bbb43fdb3 /include/linux/suspend.h | |
parent | f242d9196fd1ef4e6bf0e50d2e7f32866fb145c2 (diff) | |
download | kernel_samsung_espresso10-74f270af0c1ed5b9d4413784256959dcfe3593ce.zip kernel_samsung_espresso10-74f270af0c1ed5b9d4413784256959dcfe3593ce.tar.gz kernel_samsung_espresso10-74f270af0c1ed5b9d4413784256959dcfe3593ce.tar.bz2 |
PM: Rework struct hibernation_ops
During hibernation we also need to tell the ACPI core that we're going to put
the system into the S4 sleep state. For this reason, an additional method in
'struct hibernation_ops' is needed, playing the role of set_target() in
'struct platform_suspend_operations'. Moreover, the role of the .prepare()
method is now different, so it's better to introduce another method, that in
general may be different from .prepare(), that will be used to prepare the
platform for creating the hibernation image (.prepare() is used anyway to
notify the platform that we're going to enter the low power state after the
image has been saved).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index dee416c..0044483 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -134,16 +134,42 @@ extern void mark_free_pages(struct zone *zone); * * All three methods must be assigned. * - * @prepare: prepare system for hibernation - * @enter: shut down system after state has been saved to disk - * @finish: finish/clean up after state has been reloaded - * @pre_restore: prepare system for the restoration from a hibernation image - * @restore_cleanup: clean up after a failing image restoration + * @start: Tell the platform driver that we're starting hibernation. + * Called right after shrinking memory and before freezing devices. + * + * @pre_snapshot: Prepare the platform for creating the hibernation image. + * Called right after devices have been frozen and before the nonboot + * CPUs are disabled (runs with IRQs on). + * + * @finish: Restore the previous state of the platform after the hibernation + * image has been created *or* put the platform into the normal operation + * mode after the hibernation (the same method is executed in both cases). + * Called right after the nonboot CPUs have been enabled and before + * thawing devices (runs with IRQs on). + * + * @prepare: Prepare the platform for entering the low power state. + * Called right after the hibernation image has been saved and before + * devices are prepared for entering the low power state. + * + * @enter: Put the system into the low power state after the hibernation image + * has been saved to disk. + * Called after the nonboot CPUs have been disabled and all of the low + * level devices have been shut down (runs with IRQs off). + * + * @pre_restore: Prepare system for the restoration from a hibernation image. + * Called right after devices have been frozen and before the nonboot + * CPUs are disabled (runs with IRQs on). + * + * @restore_cleanup: Clean up after a failing image restoration. + * Called right after the nonboot CPUs have been enabled and before + * thawing devices (runs with IRQs on). */ struct hibernation_ops { + int (*start)(void); + int (*pre_snapshot)(void); + void (*finish)(void); int (*prepare)(void); int (*enter)(void); - void (*finish)(void); int (*pre_restore)(void); void (*restore_cleanup)(void); }; |