1# Copyright (c) 2014-2015 Wind River Systems, Inc.
2# Copyright (c) 2016 Intel Corporation
3# SPDX-License-Identifier: Apache-2.0
4
5menu "Power Management"
6
7config HAS_PM
8	bool
9	help
10	  This option must be selected by SoCs that provide PM hooks, that is,
11	  calls to configure low-power states.
12
13config PM
14	bool "System Power Management"
15	depends on SYS_CLOCK_EXISTS && HAS_PM
16	help
17	  This option enables the board to implement extra power management
18	  policies whenever the kernel becomes idle. The kernel informs the
19	  power management subsystem of the number of ticks until the next kernel
20	  timer is due to expire.
21
22if PM
23
24module = PM
25module-str = System Power Management
26source "subsys/logging/Kconfig.template.log_config"
27
28config PM_STATS
29	bool "System Power Management Stats"
30	depends on STATS
31	help
32	  Enable System Power Management Stats.
33
34config PM_S2RAM
35	bool "Suspend-to-RAM (S2RAM)"
36	depends on ARCH_HAS_SUSPEND_TO_RAM
37	help
38	  This option enables suspend-to-RAM (S2RAM).
39
40config PM_NEED_ALL_DEVICES_IDLE
41	bool "System Low Power Mode Needs All Devices Idle"
42	depends on PM_DEVICE && !SMP
43	help
44	  When this option is enabled, check that no devices are busy before
45	  entering into system low power mode.
46
47choice PM_POLICY
48	prompt "Idle State Power Management Policy"
49	default PM_POLICY_DEFAULT
50	help
51	  Select the idle state power management policy.
52
53config PM_POLICY_DEFAULT
54	bool "Default PM policy"
55	help
56	  This option selects the default PM policy. Default policy is based
57	  on CPU residency times and other constraints imposed by the drivers or
58	  application.
59
60config PM_POLICY_CUSTOM
61	bool "Custom PM Policy"
62	help
63	  This options allows applications to override the default policy with
64	  a custom implementation.
65
66endchoice
67
68endif # PM
69
70config PM_DEVICE
71	bool "Device Power Management"
72	help
73	  This option enables the device power management interface.  The
74	  interface consists of hook functions implemented by device drivers
75	  that get called by the power manager application when the system
76	  is going to suspend state or resuming from suspend state. This allows
77	  device drivers to do any necessary power management operations
78	  like turning off device clocks and peripherals. The device drivers
79	  may also save and restore states in these hook functions.
80
81if PM_DEVICE
82
83module = PM_DEVICE
84module-str = Device Power Management
85source "subsys/logging/Kconfig.template.log_config"
86
87config PM_DEVICE_POWER_DOMAIN
88	bool "Power domain"
89	depends on PM_DEVICE
90	default y
91	help
92	  Enable support for Power Domain. With power domain enabled,
93	  devices that depend on a domain will be notified when this
94	  domain is suspended or resumed.
95
96config PM_DEVICE_POWER_DOMAIN_DYNAMIC
97	bool "Dynamically bind devices to a Power Pomain"
98	depends on PM_DEVICE_POWER_DOMAIN && DEVICE_DEPS_DYNAMIC
99	help
100	  Enable support for dynamically bind devices to a Power Domain.
101
102config PM_DEVICE_POWER_DOMAIN_DYNAMIC_NUM
103	int "Number of devices that can dynamically be bind to a Power Domain"
104	depends on PM_DEVICE_POWER_DOMAIN_DYNAMIC
105	default 1
106	help
107	  The number of devices that can dynamically be bind to a Power Domain.
108
109config PM_DEVICE_RUNTIME
110	bool "Runtime Device Power Management"
111	select EVENTS
112	help
113	  Enable Runtime Power Management to save power. With device runtime PM
114	  enabled, devices can be suspended or resumed based on the device
115	  usage even while the CPU or system is running.
116
117config PM_DEVICE_RUNTIME_EXCLUSIVE
118	depends on PM_DEVICE_RUNTIME
119	bool "Use only on Runtime Power Management on system suspend / resume"
120	default y
121	help
122	  On system suspend / resume do not trigger the Device PM hooks but
123	  only rely on Runtime PM to manage the devices power states.
124
125endif # PM_DEVICE
126
127endmenu
128