The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.
To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.
This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This commit fixes compilation of System Power Management module
when Device Power Management is disabled.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
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>
This commit updates the README and sample.yaml in order to signal
that this demo works flawlessly on the nRF51 platform.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Add an API for force suspending the devices. This API can be
called during unexpected system shutdown/poweroff scenarios
to safely turnoff the devices.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
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>
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
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>