]> git.hungrycats.org Git - linux/commit
[power] Add flag to control suspend-to-disk behavior.
authorPatrick Mochel <mochel@osdl.org>
Tue, 19 Aug 2003 08:26:30 +0000 (01:26 -0700)
committerPatrick Mochel <mochel@osdl.org>
Tue, 19 Aug 2003 08:26:30 +0000 (01:26 -0700)
commit4db335837b40105b914d6eab47785638dfa65059
tree8ec3918ce0fce00580e194bbaa7c4c5df86c6484
parent7f1ba7ace9cfac51f6ff8d18d6b1716c5fbb9b95
[power] Add flag to control suspend-to-disk behavior.

Suspend-to-disk can be handled in numerous ways, some we have control over,
and others we don't. The biggest difference is whether or not the firmware
is responsible for entering a low-power state or if the platform driver is.
The two modes are incompatible, so we enable the platform driver tell the
PM core when they register their pm_ops (via the ->pm_disk_mode) field.

If the firmware is responsible, then it will also write memory to disk,
while the kernel is otherwise responsible. However, a user may choose to
use the in-kernel suspend mechanism, even if the system supports only
the firmware mechanism. Instead of entering a low-power state, the system
will turn off (or reboot for testing).

A sysfs file -- /sys/power/disk -- is available to set the mode to one of:

  'firmware'
  'platform'
  'shutdown'
  'reboot'

The latter two are settable any time, and assume that one is using swsusp.
The other two are only settable to what the platform supports.
drivers/acpi/sleep/main.c
include/linux/pm.h
kernel/power/main.c