
From: Stefan Dosinger <stefandoesinger@gmx.at>

The attached patch introduces 2 new suspend/resume functions, pm_ops->setup
and pm_ops->leave.  These are used to correct the order of suspending/resuming
devices and calling acpi functions.  

Some notebooks, like my Acer Travelmate 800 and the Samsung P3 notebook have
big resume problems which are solved by calling acpi_leave_sleep_state before
resuming the devices.  I fix this by introducing a new function,
acpi_pm_leave, which is called before devices are resumed which calls
acpi_leave_sleep_state and disables the wakeup devices(yes, this was the
resume-finish-split patch).  Shaohua also sugested that _PTS should be called
after suspending devices, so I created acpi_pm_setup and moved the content of
acpi_pm_prepare there.

There are now 5 suspend/resume functions:

prepare: It's called before devices are suspended
setup: Called after device suspend but before finally going to sleep
enter: Last suspend function
leave: Called before devices are beeing resumed
finish: Last function, called after device resume

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Stefan Dösinger <stefandoesinger@gmx.at>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 /dev/null                 |    0 
 drivers/acpi/sleep/main.c |    0 
 include/linux/pm.h        |    0 
 kernel/power/main.c       |    0 
 4 files changed

diff -L acpi/sleep/main.c -puN /dev/null /dev/null
diff -puN drivers/acpi/sleep/main.c~acpi-call-acpi_leave_sleep_state-before-resuming-devices drivers/acpi/sleep/main.c
diff -puN include/linux/pm.h~acpi-call-acpi_leave_sleep_state-before-resuming-devices include/linux/pm.h
diff -puN kernel/power/main.c~acpi-call-acpi_leave_sleep_state-before-resuming-devices kernel/power/main.c
diff -L linux/pm.h -puN /dev/null /dev/null
diff -L power/main.c -puN /dev/null /dev/null
_
