xref: /linux/kernel/power/Kconfig (revision a0349828d6d6f95c445674c2953ee9db75c11f8f)
11da177e4SLinus Torvaldsconfig PM
21da177e4SLinus Torvalds	bool "Power Management support"
3eb7b6b32SLen Brown	depends on !IA64_HP_SIM
41da177e4SLinus Torvalds	---help---
51da177e4SLinus Torvalds	  "Power Management" means that parts of your computer are shut
61da177e4SLinus Torvalds	  off or put into a power conserving "sleep" mode if they are not
71da177e4SLinus Torvalds	  being used.  There are two competing standards for doing this: APM
81da177e4SLinus Torvalds	  and ACPI.  If you want to use either one, say Y here and then also
91da177e4SLinus Torvalds	  to the requisite support below.
101da177e4SLinus Torvalds
111da177e4SLinus Torvalds	  Power Management is most important for battery powered laptop
121da177e4SLinus Torvalds	  computers; if you have a laptop, check out the Linux Laptop home
131da177e4SLinus Torvalds	  page on the WWW at <http://www.linux-on-laptops.com/> or
141da177e4SLinus Torvalds	  Tuxmobil - Linux on Mobile Computers at <http://www.tuxmobil.org/>
151da177e4SLinus Torvalds	  and the Battery Powered Linux mini-HOWTO, available from
161da177e4SLinus Torvalds	  <http://www.tldp.org/docs.html#howto>.
171da177e4SLinus Torvalds
181da177e4SLinus Torvalds	  Note that, even if you say N here, Linux on the x86 architecture
191da177e4SLinus Torvalds	  will issue the hlt instruction if nothing is to be done, thereby
201da177e4SLinus Torvalds	  sending the processor to sleep and saving power.
211da177e4SLinus Torvalds
22bca73e4bSJeff Garzikconfig PM_LEGACY
23f89bce3dSDavid Brownell	bool "Legacy Power Management API (DEPRECATED)"
24bca73e4bSJeff Garzik	depends on PM
25f89bce3dSDavid Brownell	default n
26bca73e4bSJeff Garzik	---help---
27f89bce3dSDavid Brownell	   Support for pm_register() and friends.  This old API is obsoleted
28f89bce3dSDavid Brownell	   by the driver model.
29bca73e4bSJeff Garzik
30f89bce3dSDavid Brownell	   If unsure, say N.
31bca73e4bSJeff Garzik
321da177e4SLinus Torvaldsconfig PM_DEBUG
331da177e4SLinus Torvalds	bool "Power Management Debug Support"
341da177e4SLinus Torvalds	depends on PM
351da177e4SLinus Torvalds	---help---
36*a0349828SBen Collins	This option enables various debugging support in the Power Management
37*a0349828SBen Collins	code. This is helpful when debugging and reporting PM bugs, like
38*a0349828SBen Collins	suspend support.
39*a0349828SBen Collins
40*a0349828SBen Collinsconfig PM_VERBOSE
41*a0349828SBen Collins	bool "Verbose Power Management debugging"
42*a0349828SBen Collins	depends on PM_DEBUG
43*a0349828SBen Collins	default n
44*a0349828SBen Collins	---help---
45*a0349828SBen Collins	This option enables verbose messages from the Power Management code.
461da177e4SLinus Torvalds
47c8eb8b40SRafael J. Wysockiconfig DISABLE_CONSOLE_SUSPEND
48c8eb8b40SRafael J. Wysocki	bool "Keep console(s) enabled during suspend/resume (DANGEROUS)"
49*a0349828SBen Collins	depends on PM_DEBUG
50c8eb8b40SRafael J. Wysocki	default n
51c8eb8b40SRafael J. Wysocki	---help---
52c8eb8b40SRafael J. Wysocki	This option turns off the console suspend mechanism that prevents
53c8eb8b40SRafael J. Wysocki	debug messages from reaching the console during the suspend/resume
54c8eb8b40SRafael J. Wysocki	operations.  This may be helpful when debugging device drivers'
55c8eb8b40SRafael J. Wysocki	suspend/resume routines, but may itself lead to problems, for example
56c8eb8b40SRafael J. Wysocki	if netconsole is used.
57c8eb8b40SRafael J. Wysocki
58eb71c87aSLinus Torvaldsconfig PM_TRACE
59eb71c87aSLinus Torvalds	bool "Suspend/resume event tracing"
60*a0349828SBen Collins	depends on PM_DEBUG && X86_32 && EXPERIMENTAL
615c31f273SAndrew Morton	default n
62eb71c87aSLinus Torvalds	---help---
63eb71c87aSLinus Torvalds	This enables some cheesy code to save the last PM event point in the
64eb71c87aSLinus Torvalds	RTC across reboots, so that you can debug a machine that just hangs
65eb71c87aSLinus Torvalds	during suspend (or more commonly, during resume).
66eb71c87aSLinus Torvalds
675c31f273SAndrew Morton	To use this debugging feature you should attempt to suspend the machine,
685c31f273SAndrew Morton	then reboot it, then run
695c31f273SAndrew Morton
705c31f273SAndrew Morton		dmesg -s 1000000 | grep 'hash matches'
715c31f273SAndrew Morton
725c31f273SAndrew Morton	CAUTION: this option will cause your machine's real-time clock to be
735c31f273SAndrew Morton	set to an invalid time after a resume.
745c31f273SAndrew Morton
751da177e4SLinus Torvaldsconfig SOFTWARE_SUSPEND
76a7ee2e5fSDavid Brownell	bool "Software Suspend (Hibernation)"
77543b9fd3SJohannes Berg	depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP))
781da177e4SLinus Torvalds	---help---
79a7ee2e5fSDavid Brownell	  Enable the suspend to disk (STD) functionality, which is usually
80a7ee2e5fSDavid Brownell	  called "hibernation" in user interfaces.  STD checkpoints the
81a7ee2e5fSDavid Brownell	  system and powers it off; and restores that checkpoint on reboot.
821da177e4SLinus Torvalds
83c7276fdeSRafael J. Wysocki	  You can suspend your machine with 'echo disk > /sys/power/state'.
84c7276fdeSRafael J. Wysocki	  Alternatively, you can use the additional userland tools available
85c7276fdeSRafael J. Wysocki	  from <http://suspend.sf.net>.
86c7276fdeSRafael J. Wysocki
87c7276fdeSRafael J. Wysocki	  In principle it does not require ACPI or APM, although for example
88a7ee2e5fSDavid Brownell	  ACPI will be used for the final steps when it is available.  One
89a7ee2e5fSDavid Brownell	  of the reasons to use software suspend is that the firmware hooks
90a7ee2e5fSDavid Brownell	  for suspend states like suspend-to-RAM (STR) often don't work very
91a7ee2e5fSDavid Brownell	  well with Linux.
92c7276fdeSRafael J. Wysocki
93c7276fdeSRafael J. Wysocki	  It creates an image which is saved in your active swap. Upon the next
941da177e4SLinus Torvalds	  boot, pass the 'resume=/dev/swappartition' argument to the kernel to
951da177e4SLinus Torvalds	  have it detect the saved image, restore memory state from it, and
961da177e4SLinus Torvalds	  continue to run as before. If you do not want the previous state to
97c7276fdeSRafael J. Wysocki	  be reloaded, then use the 'noresume' kernel command line argument.
98c7276fdeSRafael J. Wysocki	  Note, however, that fsck will be run on your filesystems and you will
99c7276fdeSRafael J. Wysocki	  need to run mkswap against the swap partition used for the suspend.
1001da177e4SLinus Torvalds
101c7276fdeSRafael J. Wysocki	  It also works with swap files to a limited extent (for details see
102c7276fdeSRafael J. Wysocki	  <file:Documentation/power/swsusp-and-swap-files.txt>).
103c7276fdeSRafael J. Wysocki
104c7276fdeSRafael J. Wysocki	  Right now you may boot without resuming and resume later but in the
105c7276fdeSRafael J. Wysocki	  meantime you cannot use the swap partition(s)/file(s) involved in
106c7276fdeSRafael J. Wysocki	  suspending.  Also in this case you must not use the filesystems
107c7276fdeSRafael J. Wysocki	  that were mounted before the suspend.  In particular, you MUST NOT
108c7276fdeSRafael J. Wysocki	  MOUNT any journaled filesystems mounted before the suspend or they
109c7276fdeSRafael J. Wysocki	  will get corrupted in a nasty way.
1101da177e4SLinus Torvalds
1111da177e4SLinus Torvalds	  For more information take a look at <file:Documentation/power/swsusp.txt>.
1121da177e4SLinus Torvalds
1131da177e4SLinus Torvaldsconfig PM_STD_PARTITION
1141da177e4SLinus Torvalds	string "Default resume partition"
1151da177e4SLinus Torvalds	depends on SOFTWARE_SUSPEND
1161da177e4SLinus Torvalds	default ""
1171da177e4SLinus Torvalds	---help---
1181da177e4SLinus Torvalds	  The default resume partition is the partition that the suspend-
1191da177e4SLinus Torvalds	  to-disk implementation will look for a suspended disk image.
1201da177e4SLinus Torvalds
1211da177e4SLinus Torvalds	  The partition specified here will be different for almost every user.
1221da177e4SLinus Torvalds	  It should be a valid swap partition (at least for now) that is turned
1231da177e4SLinus Torvalds	  on before suspending.
1241da177e4SLinus Torvalds
1251da177e4SLinus Torvalds	  The partition specified can be overridden by specifying:
1261da177e4SLinus Torvalds
1271da177e4SLinus Torvalds		resume=/dev/<other device>
1281da177e4SLinus Torvalds
1291da177e4SLinus Torvalds	  which will set the resume partition to the device specified.
1301da177e4SLinus Torvalds
1311da177e4SLinus Torvalds	  Note there is currently not a way to specify which device to save the
1321da177e4SLinus Torvalds	  suspended image to. It will simply pick the first available swap
1331da177e4SLinus Torvalds	  device.
1341da177e4SLinus Torvalds
1355a72e04dSLi Shaohuaconfig SUSPEND_SMP
1365a72e04dSLi Shaohua	bool
137543b9fd3SJohannes Berg	depends on HOTPLUG_CPU && (X86 || PPC64) && PM
1385a72e04dSLi Shaohua	default y
1397726942fSRalf Baechle
1407726942fSRalf Baechleconfig APM_EMULATION
1417726942fSRalf Baechle	tristate "Advanced Power Management Emulation"
1427726942fSRalf Baechle	depends on PM && SYS_SUPPORTS_APM_EMULATION
1437726942fSRalf Baechle	help
1447726942fSRalf Baechle	  APM is a BIOS specification for saving power using several different
1457726942fSRalf Baechle	  techniques. This is mostly useful for battery powered laptops with
1467726942fSRalf Baechle	  APM compliant BIOSes. If you say Y here, the system time will be
1477726942fSRalf Baechle	  reset after a RESUME operation, the /proc/apm device will provide
1487726942fSRalf Baechle	  battery status information, and user-space programs will receive
1497726942fSRalf Baechle	  notification of APM "events" (e.g. battery status change).
1507726942fSRalf Baechle
1517726942fSRalf Baechle	  In order to use APM, you will need supporting software. For location
1527726942fSRalf Baechle	  and more information, read <file:Documentation/pm.txt> and the
1537726942fSRalf Baechle	  Battery Powered Linux mini-HOWTO, available from
1547726942fSRalf Baechle	  <http://www.tldp.org/docs.html#howto>.
1557726942fSRalf Baechle
1567726942fSRalf Baechle	  This driver does not spin down disk drives (see the hdparm(8)
1577726942fSRalf Baechle	  manpage ("man 8 hdparm") for that), and it doesn't turn off
1587726942fSRalf Baechle	  VESA-compliant "green" monitors.
1597726942fSRalf Baechle
1607726942fSRalf Baechle	  Generally, if you don't have a battery in your machine, there isn't
1617726942fSRalf Baechle	  much point in using this driver and you should say N. If you get
1627726942fSRalf Baechle	  random kernel OOPSes or reboots that don't seem to be related to
1637726942fSRalf Baechle	  anything, try disabling/enabling this option (or disabling/enabling
1647726942fSRalf Baechle	  APM in your BIOS).
165