aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep/main.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-10-18 06:04:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:18 -0400
commit74f270af0c1ed5b9d4413784256959dcfe3593ce (patch)
tree5b74248167be086b0050a84f9ebe072bbb43fdb3 /drivers/acpi/sleep/main.c
parentf242d9196fd1ef4e6bf0e50d2e7f32866fb145c2 (diff)
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 'drivers/acpi/sleep/main.c')
-rw-r--r--drivers/acpi/sleep/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index c58dd0bb5506..f20b0ab9ef54 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -230,6 +230,12 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
230#endif /* CONFIG_SUSPEND */ 230#endif /* CONFIG_SUSPEND */
231 231
232#ifdef CONFIG_HIBERNATION 232#ifdef CONFIG_HIBERNATION
233static int acpi_hibernation_start(void)
234{
235 acpi_target_sleep_state = ACPI_STATE_S4;
236 return 0;
237}
238
233static int acpi_hibernation_prepare(void) 239static int acpi_hibernation_prepare(void)
234{ 240{
235 return acpi_sleep_prepare(ACPI_STATE_S4); 241 return acpi_sleep_prepare(ACPI_STATE_S4);
@@ -258,6 +264,8 @@ static void acpi_hibernation_finish(void)
258 264
259 /* reset firmware waking vector */ 265 /* reset firmware waking vector */
260 acpi_set_firmware_waking_vector((acpi_physical_address) 0); 266 acpi_set_firmware_waking_vector((acpi_physical_address) 0);
267
268 acpi_target_sleep_state = ACPI_STATE_S0;
261} 269}
262 270
263static int acpi_hibernation_pre_restore(void) 271static int acpi_hibernation_pre_restore(void)
@@ -275,9 +283,11 @@ static void acpi_hibernation_restore_cleanup(void)
275} 283}
276 284
277static struct hibernation_ops acpi_hibernation_ops = { 285static struct hibernation_ops acpi_hibernation_ops = {
286 .start = acpi_hibernation_start,
287 .pre_snapshot = acpi_hibernation_prepare,
288 .finish = acpi_hibernation_finish,
278 .prepare = acpi_hibernation_prepare, 289 .prepare = acpi_hibernation_prepare,
279 .enter = acpi_hibernation_enter, 290 .enter = acpi_hibernation_enter,
280 .finish = acpi_hibernation_finish,
281 .pre_restore = acpi_hibernation_pre_restore, 291 .pre_restore = acpi_hibernation_pre_restore,
282 .restore_cleanup = acpi_hibernation_restore_cleanup, 292 .restore_cleanup = acpi_hibernation_restore_cleanup,
283}; 293};