2021-06-12 00:22:33 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Intel Corporation.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_PM_POLICY_H_
|
|
|
|
#define ZEPHYR_INCLUDE_PM_POLICY_H_
|
|
|
|
|
2021-12-14 06:08:22 +08:00
|
|
|
#include <stdint.h>
|
2021-06-12 00:22:33 +08:00
|
|
|
#include <pm/state.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-10-29 17:10:49 +08:00
|
|
|
/** @cond INTERNAL_HIDDEN */
|
|
|
|
|
2021-06-12 00:22:33 +08:00
|
|
|
/**
|
2021-06-15 01:18:55 +08:00
|
|
|
* @brief Function to get the next PM state
|
|
|
|
*
|
|
|
|
* This function is called by the power subsystem when the system is
|
|
|
|
* idle and returns the most appropriate state based on the number of
|
|
|
|
* ticks to the next event.
|
|
|
|
*
|
2021-10-23 01:59:51 +08:00
|
|
|
* @param cpu CPU index.
|
2021-06-15 01:18:55 +08:00
|
|
|
* @param ticks The number of ticks to the next scheduled event.
|
|
|
|
*
|
2021-10-23 01:59:51 +08:00
|
|
|
* @return The power state the system should use for the given cpu.
|
2021-06-12 00:22:33 +08:00
|
|
|
*/
|
2021-10-23 01:59:51 +08:00
|
|
|
struct pm_state_info pm_policy_next_state(uint8_t cpu, int32_t ticks);
|
2021-06-12 00:22:33 +08:00
|
|
|
|
2021-10-29 17:10:49 +08:00
|
|
|
/** @endcond */
|
2021-06-12 00:22:33 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ZEPHYR_INCLUDE_PM_POLICY_H_ */
|