Skip to content

Zephyr power management enhancement plan #89031

@bjarki-andreasen

Description

@bjarki-andreasen

Introduction

This issue documents and tracks the changes needed to refactor PM device to achieve what is proposed in #84049.

High level steps

  1. Use power domains/devices to dictate system state constraints instead of system state controling power domains/devices PM_DEVICE_POWER_DOMAIN refactor #89372

  2. Replace uses of PM_DEVICE_SYSTEM_MANAGED with PM_DEVICE_RUNTIME in all applications.

  3. Remove PM_DEVICE_SYSTEM_MANAGED. The system state will not be used to manage devices, this option therefore has no utility, and shall be removed.

  4. Remove pm_device_runtime_enable() and the zephyr,pm-device-runtime-auto devicetree property. All devices will be managed by PM_DEVICE_RUNTIME if enabled, disabling it per device is not a valid pm device configuration.

  5. Clean up all device drivers. This includes the following:

    • Use pm_device_driver_init() instead of calling pm_device_runtime_enable(), pm_device_init_suspended() etc.
    • Use pm_device_runtime_ APIs for resuming device dependencies like busses, pwms, etc, from device drivers.

    note: we will not remove inline calls to self get/put in can_start() or i2c_transfer() until step 7.

  6. Adjust subsystems and applications (samples) which currently use pm_device_action_run to solely use pm_device_runtime APIs.

  7. Remove inline self get/put calls from device drivers, like often present in can_start()/can_stop() or i2c_transfer(). These are no longer needed as applications/subsystems are mandated to call these APIs before and after using the device.

Metadata

Metadata

Labels

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions