Merge tag 'v3.10.103' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / power / Kconfig
1 config SUSPEND
2 bool "Suspend to RAM and standby"
3 depends on ARCH_SUSPEND_POSSIBLE
4 default y
5 ---help---
6 Allow the system to enter sleep states in which main memory is
7 powered and thus its contents are preserved, such as the
8 suspend-to-RAM state (e.g. the ACPI S3 state).
9
10 config SUSPEND_FREEZER
11 bool "Enable freezer for suspend to RAM/standby" \
12 if ARCH_WANTS_FREEZER_CONTROL || BROKEN
13 depends on SUSPEND
14 default y
15 help
16 This allows you to turn off the freezer for suspend. If this is
17 done, no tasks are frozen for suspend to RAM/standby.
18
19 Turning OFF this setting is NOT recommended! If in doubt, say Y.
20
21 config HAS_WAKELOCK
22 bool
23 default y
24
25 config HAS_EARLYSUSPEND
26 bool
27 default y
28
29 config HAS_SBSUSPEND
30 bool
31 depends on HAS_EARLYSUSPEND
32 default y
33
34 config WAKELOCK
35 bool
36 default y
37
38 config EARLYSUSPEND
39 bool "Early suspend"
40 depends on WAKELOCK
41 default y
42 select HAS_EARLYSUSPEND
43 ---help---
44 Call early suspend handlers when the user requested sleep state
45 changes.
46
47 config FB_EARLYSUSPEND
48 bool "FB Early suspend"
49 depends on EARLYSUSPEND
50 default y
51 select HAS_EARLYSUSPEND
52 ---help---
53 Call early suspend handlers when the user requested sleep state
54 changes.
55
56 config HIBERNATE_CALLBACKS
57 bool
58
59 config HIBERNATION
60 bool "Hibernation (aka 'suspend to disk')"
61 depends on SWAP && ARCH_HIBERNATION_POSSIBLE
62 select HIBERNATE_CALLBACKS
63 select LZO_COMPRESS
64 select LZO_DECOMPRESS
65 select CRC32
66 ---help---
67 Enable the suspend to disk (STD) functionality, which is usually
68 called "hibernation" in user interfaces. STD checkpoints the
69 system and powers it off; and restores that checkpoint on reboot.
70
71 You can suspend your machine with 'echo disk > /sys/power/state'
72 after placing resume=/dev/swappartition on the kernel command line
73 in your bootloader's configuration file.
74
75 Alternatively, you can use the additional userland tools available
76 from <http://suspend.sf.net>.
77
78 In principle it does not require ACPI or APM, although for example
79 ACPI will be used for the final steps when it is available. One
80 of the reasons to use software suspend is that the firmware hooks
81 for suspend states like suspend-to-RAM (STR) often don't work very
82 well with Linux.
83
84 It creates an image which is saved in your active swap. Upon the next
85 boot, pass the 'resume=/dev/swappartition' argument to the kernel to
86 have it detect the saved image, restore memory state from it, and
87 continue to run as before. If you do not want the previous state to
88 be reloaded, then use the 'noresume' kernel command line argument.
89 Note, however, that fsck will be run on your filesystems and you will
90 need to run mkswap against the swap partition used for the suspend.
91
92 It also works with swap files to a limited extent (for details see
93 <file:Documentation/power/swsusp-and-swap-files.txt>).
94
95 Right now you may boot without resuming and resume later but in the
96 meantime you cannot use the swap partition(s)/file(s) involved in
97 suspending. Also in this case you must not use the filesystems
98 that were mounted before the suspend. In particular, you MUST NOT
99 MOUNT any journaled filesystems mounted before the suspend or they
100 will get corrupted in a nasty way.
101
102 For more information take a look at <file:Documentation/power/swsusp.txt>.
103
104 config ARCH_SAVE_PAGE_KEYS
105 bool
106
107 config PM_STD_PARTITION
108 string "Default resume partition"
109 depends on HIBERNATION
110 default ""
111 ---help---
112 The default resume partition is the partition that the suspend-
113 to-disk implementation will look for a suspended disk image.
114
115 The partition specified here will be different for almost every user.
116 It should be a valid swap partition (at least for now) that is turned
117 on before suspending.
118
119 The partition specified can be overridden by specifying:
120
121 resume=/dev/<other device>
122
123 which will set the resume partition to the device specified.
124
125 Note there is currently not a way to specify which device to save the
126 suspended image to. It will simply pick the first available swap
127 device.
128
129 menuconfig TOI_CORE
130 tristate "Enhanced Hibernation (TuxOnIce)"
131 depends on HIBERNATION
132 default y
133 ---help---
134 TuxOnIce is the 'new and improved' suspend support.
135
136 See the TuxOnIce home page (tuxonice.net)
137 for FAQs, HOWTOs and other documentation.
138
139 comment "Image Storage (you need at least one allocator)"
140 depends on TOI_CORE
141
142 config TOI_FILE
143 tristate "File Allocator"
144 depends on TOI_CORE
145 default y
146 ---help---
147 This option enables support for storing an image in a
148 simple file. You might want this if your swap is
149 sometimes full enough that you don't have enough spare
150 space to store an image.
151
152 config TOI_SWAP
153 tristate "Swap Allocator"
154 depends on TOI_CORE && SWAP
155 default y
156 ---help---
157 This option enables support for storing an image in your
158 swap space.
159
160 comment "General Options"
161 depends on TOI_CORE
162
163 config TOI_INCREMENTAL
164 tristate "Incremental Image Support"
165 depends on TOI_CORE && CRYPTO && BROKEN
166 select CRYPTO_SHA1
167 default y
168 ---help---
169 This option adds initial support for using hashing algorithms
170 (a quick, internal implementation of Fletcher16 and SHA1 via
171 cryptoapi) to discover the number of pages which are
172 unchanged since the image was last written. It is hoped that
173 this will be an initial step toward implementing storing just
174 the differences between consecutive images, which will
175 increase the amount of storage needed for the image, but also
176 increase the speed at which writing an image occurs and
177 reduce the wear and tear on drives.
178
179 comment "No increemntal image support available without Cryptoapi support."
180 depends on TOI_CORE && !CRYPTO
181
182 config TOI_PRUNE
183 tristate "Image pruning support"
184 depends on TOI_CORE && CRYPTO && BROKEN
185 default y
186 ---help---
187 This option adds support for using cryptoapi hashing
188 algorithms to identify pages with the same content. We
189 then write a much smaller pointer to the first copy of
190 the data instead of a complete (perhaps compressed)
191 additional copy.
192
193 You probably want this, so say Y here.
194
195 comment "No image pruning support available without Cryptoapi support."
196 depends on TOI_CORE && !CRYPTO
197
198 config TOI_CRYPTO
199 tristate "Compression support"
200 depends on TOI_CORE && CRYPTO
201 default y
202 ---help---
203 This option adds support for using cryptoapi compression
204 algorithms. Compression is particularly useful as it can
205 more than double your suspend and resume speed (depending
206 upon how well your image compresses).
207
208 You probably want this, so say Y here.
209
210 comment "No compression support available without Cryptoapi support."
211 depends on TOI_CORE && !CRYPTO
212
213 config TOI_USERUI
214 tristate "Userspace User Interface support"
215 depends on TOI_CORE && NET && (VT || SERIAL_CONSOLE)
216 default y
217 ---help---
218 This option enabled support for a userspace based user interface
219 to TuxOnIce, which allows you to have a nice display while suspending
220 and resuming, and also enables features such as pressing escape to
221 cancel a cycle or interactive debugging.
222
223 config TOI_USERUI_DEFAULT_PATH
224 string "Default userui program location"
225 default "/usr/local/sbin/tuxoniceui_text"
226 depends on TOI_USERUI
227 ---help---
228 This entry allows you to specify a default path to the userui binary.
229
230 config TOI_DEFAULT_IMAGE_SIZE_LIMIT
231 int "Default image size limit"
232 range -2 65536
233 default "-2"
234 depends on TOI_CORE
235 ---help---
236 This entry allows you to specify a default image size limit. It can
237 be overridden at run-time using /sys/power/tuxonice/image_size_limit.
238
239 config TOI_KEEP_IMAGE
240 bool "Allow Keep Image Mode"
241 depends on TOI_CORE
242 ---help---
243 This option allows you to keep and image and reuse it. It is intended
244 __ONLY__ for use with systems where all filesystems are mounted read-
245 only (kiosks, for example). To use it, compile this option in and boot
246 normally. Set the KEEP_IMAGE flag in /sys/power/tuxonice and suspend.
247 When you resume, the image will not be removed. You will be unable to turn
248 off swap partitions (assuming you are using the swap allocator), but future
249 suspends simply do a power-down. The image can be updated using the
250 kernel command line parameter suspend_act= to turn off the keep image
251 bit. Keep image mode is a little less user friendly on purpose - it
252 should not be used without thought!
253
254 config TOI_REPLACE_SWSUSP
255 bool "Replace swsusp by default"
256 default y
257 depends on TOI_CORE
258 ---help---
259 TuxOnIce can replace swsusp. This option makes that the default state,
260 requiring you to echo 0 > /sys/power/tuxonice/replace_swsusp if you want
261 to use the vanilla kernel functionality. Note that your initrd/ramfs will
262 need to do this before trying to resume, too.
263 With overriding swsusp enabled, echoing disk to /sys/power/state will
264 start a TuxOnIce cycle. If resume= doesn't specify an allocator and both
265 the swap and file allocators are compiled in, the swap allocator will be
266 used by default.
267
268 config TOI_IGNORE_LATE_INITCALL
269 bool "Wait for initrd/ramfs to run, by default"
270 default n
271 depends on TOI_CORE
272 ---help---
273 When booting, TuxOnIce can check for an image and start to resume prior
274 to any initrd/ramfs running (via a late initcall).
275
276 If you don't have an initrd/ramfs, this is what you want to happen -
277 otherwise you won't be able to safely resume. You should set this option
278 to 'No'.
279
280 If, however, you want your initrd/ramfs to run anyway before resuming,
281 you need to tell TuxOnIce to ignore that earlier opportunity to resume.
282 This can be done either by using this compile time option, or by
283 overriding this option with the boot-time parameter toi_initramfs_resume_only=1.
284
285 Note that if TuxOnIce can't resume at the earlier opportunity, the
286 value of this option won't matter - the initramfs/initrd (if any) will
287 run anyway.
288
289 menuconfig TOI_CLUSTER
290 tristate "Cluster support"
291 default n
292 depends on TOI_CORE && NET && BROKEN
293 ---help---
294 Support for linking multiple machines in a cluster so that they suspend
295 and resume together.
296
297 config TOI_DEFAULT_CLUSTER_INTERFACE
298 string "Default cluster interface"
299 depends on TOI_CLUSTER
300 ---help---
301 The default interface on which to communicate with other nodes in
302 the cluster.
303
304 If no value is set here, cluster support will be disabled by default.
305
306 config TOI_DEFAULT_CLUSTER_KEY
307 string "Default cluster key"
308 default "Default"
309 depends on TOI_CLUSTER
310 ---help---
311 The default key used by this node. All nodes in the same cluster
312 have the same key. Multiple clusters may coexist on the same lan
313 by using different values for this key.
314
315 config TOI_CLUSTER_IMAGE_TIMEOUT
316 int "Timeout when checking for image"
317 default 15
318 depends on TOI_CLUSTER
319 ---help---
320 Timeout (seconds) before continuing to boot when waiting to see
321 whether other nodes might have an image. Set to -1 to wait
322 indefinitely. In WAIT_UNTIL_NODES is non zero, we might continue
323 booting sooner than this timeout.
324
325 config TOI_CLUSTER_WAIT_UNTIL_NODES
326 int "Nodes without image before continuing"
327 default 0
328 depends on TOI_CLUSTER
329 ---help---
330 When booting and no image is found, we wait to see if other nodes
331 have an image before continuing to boot. This value lets us
332 continue after seeing a certain number of nodes without an image,
333 instead of continuing to wait for the timeout. Set to 0 to only
334 use the timeout.
335
336 config TOI_DEFAULT_CLUSTER_PRE_HIBERNATE
337 string "Default pre-hibernate script"
338 depends on TOI_CLUSTER
339 ---help---
340 The default script to be called when starting to hibernate.
341
342 config TOI_DEFAULT_CLUSTER_POST_HIBERNATE
343 string "Default post-hibernate script"
344 depends on TOI_CLUSTER
345 ---help---
346 The default script to be called after resuming from hibernation.
347
348 config TOI_DEFAULT_WAIT
349 int "Default waiting time for emergency boot messages"
350 default "25"
351 range -1 32768
352 depends on TOI_CORE
353 help
354 TuxOnIce can display warnings very early in the process of resuming,
355 if (for example) it appears that you have booted a kernel that doesn't
356 match an image on disk. It can then give you the opportunity to either
357 continue booting that kernel, or reboot the machine. This option can be
358 used to control how long to wait in such circumstances. -1 means wait
359 forever. 0 means don't wait at all (do the default action, which will
360 generally be to continue booting and remove the image). Values of 1 or
361 more indicate a number of seconds (up to 255) to wait before doing the
362 default.
363
364 config TOI_DEFAULT_EXTRA_PAGES_ALLOWANCE
365 int "Default extra pages allowance"
366 default "2000"
367 range 500 32768
368 depends on TOI_CORE
369 help
370 This value controls the default for the allowance TuxOnIce makes for
371 drivers to allocate extra memory during the atomic copy. The default
372 value of 2000 will be okay in most cases. If you are using
373 DRI, the easiest way to find what value to use is to try to hibernate
374 and look at how many pages were actually needed in the sysfs entry
375 /sys/power/tuxonice/debug_info (first number on the last line), adding
376 a little extra because the value is not always the same.
377
378 config TOI_CHECKSUM
379 bool "Checksum pageset2"
380 default n
381 depends on TOI_CORE
382 select CRYPTO
383 select CRYPTO_ALGAPI
384 select CRYPTO_MD4
385 ---help---
386 Adds support for checksumming pageset2 pages, to ensure you really get an
387 atomic copy. Since some filesystems (XFS especially) change metadata even
388 when there's no other activity, we need this to check for pages that have
389 been changed while we were saving the page cache. If your debugging output
390 always says no pages were resaved, you may be able to safely disable this
391 option.
392
393 config TOI
394 bool
395 depends on TOI_CORE!=n
396 default y
397
398 config TOI_EXPORTS
399 bool
400 depends on TOI_SWAP=m || TOI_FILE=m || \
401 TOI_CRYPTO=m || TOI_CLUSTER=m || \
402 TOI_USERUI=m || TOI_CORE=m
403 default y
404
405 config TOI_ZRAM_SUPPORT
406 def_bool y
407 depends on TOI && ZRAM!=n
408
409 config TOI_FIXUP
410 def_bool y
411 depends on TOI
412
413 config TOI_ENHANCE
414 def_bool y
415 depends on TOI
416
417 config PM_SLEEP
418 def_bool y
419 depends on SUSPEND || HIBERNATE_CALLBACKS
420
421 config PM_SLEEP_SMP
422 def_bool y
423 depends on SMP
424 depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
425 depends on PM_SLEEP
426 select HOTPLUG
427 select HOTPLUG_CPU
428
429 config PM_AUTOSLEEP
430 bool "Opportunistic sleep"
431 depends on PM_SLEEP
432 default n
433 ---help---
434 Allow the kernel to trigger a system transition into a global sleep
435 state automatically whenever there are no active wakeup sources.
436
437 config PM_WAKELOCKS
438 bool "User space wakeup sources interface"
439 depends on PM_SLEEP
440 default n
441 ---help---
442 Allow user space to create, activate and deactivate wakeup source
443 objects with the help of a sysfs-based interface.
444
445 config PM_WAKELOCKS_LIMIT
446 int "Maximum number of user space wakeup sources (0 = no limit)"
447 range 0 100000
448 default 100
449 depends on PM_WAKELOCKS
450
451 config PM_WAKELOCKS_GC
452 bool "Garbage collector for user space wakeup sources"
453 depends on PM_WAKELOCKS
454 default y
455
456 config PM_RUNTIME
457 bool "Run-time PM core functionality"
458 depends on !IA64_HP_SIM
459 ---help---
460 Enable functionality allowing I/O devices to be put into energy-saving
461 (low power) states at run time (or autosuspended) after a specified
462 period of inactivity and woken up in response to a hardware-generated
463 wake-up event or a driver's request.
464
465 Hardware support is generally required for this functionality to work
466 and the bus type drivers of the buses the devices are on are
467 responsible for the actual handling of the autosuspend requests and
468 wake-up events.
469
470 config PM
471 def_bool y
472 depends on PM_SLEEP || PM_RUNTIME
473
474 config PM_DEBUG
475 bool "Power Management Debug Support"
476 depends on PM
477 ---help---
478 This option enables various debugging support in the Power Management
479 code. This is helpful when debugging and reporting PM bugs, like
480 suspend support.
481
482 config PM_ADVANCED_DEBUG
483 bool "Extra PM attributes in sysfs for low-level debugging/testing"
484 depends on PM_DEBUG
485 ---help---
486 Add extra sysfs attributes allowing one to access some Power Management
487 fields of device objects from user space. If you are not a kernel
488 developer interested in debugging/testing Power Management, say "no".
489
490 config PM_TEST_SUSPEND
491 bool "Test suspend/resume and wakealarm during bootup"
492 depends on SUSPEND && PM_DEBUG && RTC_CLASS=y
493 ---help---
494 This option will let you suspend your machine during bootup, and
495 make it wake up a few seconds later using an RTC wakeup alarm.
496 Enable this with a kernel parameter like "test_suspend=mem".
497
498 You probably want to have your system's RTC driver statically
499 linked, ensuring that it's available when this test runs.
500
501 config PM_SLEEP_DEBUG
502 def_bool y
503 depends on PM_DEBUG && PM_SLEEP
504
505 config PM_TRACE
506 bool
507 help
508 This enables code to save the last PM event point across
509 reboot. The architecture needs to support this, x86 for
510 example does by saving things in the RTC, see below.
511
512 The architecture specific code must provide the extern
513 functions from <linux/resume-trace.h> as well as the
514 <asm/resume-trace.h> header with a TRACE_RESUME() macro.
515
516 The way the information is presented is architecture-
517 dependent, x86 will print the information during a
518 late_initcall.
519
520 config PM_TRACE_RTC
521 bool "Suspend/resume event tracing"
522 depends on PM_SLEEP_DEBUG
523 depends on X86
524 select PM_TRACE
525 ---help---
526 This enables some cheesy code to save the last PM event point in the
527 RTC across reboots, so that you can debug a machine that just hangs
528 during suspend (or more commonly, during resume).
529
530 To use this debugging feature you should attempt to suspend the
531 machine, reboot it and then run
532
533 dmesg -s 1000000 | grep 'hash matches'
534
535 CAUTION: this option will cause your machine's real-time clock to be
536 set to an invalid time after a resume.
537
538 config APM_EMULATION
539 tristate "Advanced Power Management Emulation"
540 depends on PM && SYS_SUPPORTS_APM_EMULATION
541 help
542 APM is a BIOS specification for saving power using several different
543 techniques. This is mostly useful for battery powered laptops with
544 APM compliant BIOSes. If you say Y here, the system time will be
545 reset after a RESUME operation, the /proc/apm device will provide
546 battery status information, and user-space programs will receive
547 notification of APM "events" (e.g. battery status change).
548
549 In order to use APM, you will need supporting software. For location
550 and more information, read <file:Documentation/power/apm-acpi.txt>
551 and the Battery Powered Linux mini-HOWTO, available from
552 <http://www.tldp.org/docs.html#howto>.
553
554 This driver does not spin down disk drives (see the hdparm(8)
555 manpage ("man 8 hdparm") for that), and it doesn't turn off
556 VESA-compliant "green" monitors.
557
558 Generally, if you don't have a battery in your machine, there isn't
559 much point in using this driver and you should say N. If you get
560 random kernel OOPSes or reboots that don't seem to be related to
561 anything, try disabling/enabling this option (or disabling/enabling
562 APM in your BIOS).
563
564 config ARCH_HAS_OPP
565 bool
566
567 config PM_OPP
568 bool "Operating Performance Point (OPP) Layer library"
569 depends on ARCH_HAS_OPP
570 ---help---
571 SOCs have a standard set of tuples consisting of frequency and
572 voltage pairs that the device will support per voltage domain. This
573 is called Operating Performance Point or OPP. The actual definitions
574 of OPP varies over silicon within the same family of devices.
575
576 OPP layer organizes the data internally using device pointers
577 representing individual voltage domains and provides SOC
578 implementations a ready to use framework to manage OPPs.
579 For more information, read <file:Documentation/power/opp.txt>
580
581 config PM_CLK
582 def_bool y
583 depends on PM && HAVE_CLK
584
585 config PM_GENERIC_DOMAINS
586 bool
587 depends on PM
588
589 config PM_GENERIC_DOMAINS_SLEEP
590 def_bool y
591 depends on PM_SLEEP && PM_GENERIC_DOMAINS
592
593 config PM_GENERIC_DOMAINS_RUNTIME
594 def_bool y
595 depends on PM_RUNTIME && PM_GENERIC_DOMAINS
596
597 config CPU_PM
598 bool
599 depends on SUSPEND || CPU_IDLE
600
601 config SUSPEND_TIME
602 bool "Log time spent in suspend"
603 ---help---
604 Prints the time spent in suspend in the kernel log, and
605 keeps statistics on the time spent in suspend in
606 /sys/kernel/debug/suspend_time