Commit graph

10 commits

Author SHA1 Message Date
Wentong Wu 7cb74655da power: add system power management direct force mode.
Add system power management direct force trigger mode. In this
mode application thread can directly put system in sleep or deep
sleep mode instead of waiting for idle thread to do it, so that
it can reduce latency to enter low power mode.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-01-24 21:37:40 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Ramakrishna Pallala 6b21e1b7a7 power: Add device idle power management support
Add framework for device Idle Power Management(IPM)
for suspending devices based on device idle. This will
help in saving power even while system(CPU) is active.

The framework uses device_set_power_state() API set the
device power state accordingly based on the usage count.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Piotr Zięcik c45961daae power: Rework OS <-> Application interface
This commit simplifies OS <-> Application interface controlling power
management. In the previous approach application-based PM required
overriding sys_suspend() and sys_resume() functions. As these functions
actually implemented power state change, in such case application
basically had to provide own implementation of all PM-related stuff,
which was not portable and hard to maintain.

This commit changes this scheme: The sys_suspend() and sys_resume()
are now system functions while the application could either use
built-in power management policies or provide its own. All details
of power mode switching are now handled by the OS.

Also, this commit cleans up the Kconfig options related to system-level
power management grouping them under common CONFIG_SYS_PM_ prefix.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-19 13:25:36 -05:00
Piotr Zięcik b6bf56c3fc power: pm_ctrl: Allow fine-grained power state locking
This commit enables fine-grained power state locking.
Now, each power state could be independently enabled or disabled.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-06 14:24:01 +01:00
Ramakrishna Pallala 212b2180c9 power: Add API's to enable/disable System PM states
Add API's to enable/disable System PM states so that an
an application can enable/disable system from entering
certain Low Power states.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-11-26 06:55:57 -08:00
Krzysztof Chruscinski 5e346812ac logging: Refactor LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros
Changed LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros to take log
level as optional parameter. LOG_MODULE_DECLARE can now also be used
in static inline functions in headers. Added LOG_LEVEL_SET macro
which is used when instance logging API is used to indicate maximal
log level compiled into the file.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Ramakrishna Pallala 359341203f power: Add OS Power Management debug hooks
Add the necessary PM hooks like Low Power state entry
count and residencies for logging and debugging purposes.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-10-28 11:44:22 -04:00
Ramakrishna Pallala c511857f57 subsys: power: Add support for pluggable PM policies
Add support for adding and selecting pluggable PM policies
which can be enabled based on the application needs.

Also added a dummy policy for demonstration purpose which
simply loops over the supported PM states.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-09-20 10:20:23 -04:00
Ramakrishna Pallala 2ad647857c subsys: power: Add OS managed Power Management framework
Add support for OS managed Power Management framework for Zephyr
under 'subsys/power'. This framework takes care of implementing
the _sys_soc_suspend/_sys_soc_resume API's, a PM policy based on
SoC Low Power residencies and also provides necessary API's to
do devices suspend and resume.

Also add necessary changes to support the existing Application
managed Power Management framework.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-08-22 08:07:14 -07:00