Line data Source code
1 0 : /*
2 : * Copyright (c) 2025 Analog Devices, Inc.
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #ifndef ZEPHYR_SUBSYS_CPU_FREQ_POLICY_H_
8 : #define ZEPHYR_SUBSYS_CPU_FREQ_POLICY_H_
9 :
10 : #ifdef __cplusplus
11 : extern "C" {
12 : #endif
13 :
14 : /*
15 : * CPU Frequency Policy Interface - to be implemented by each policy.
16 : */
17 :
18 : #include <zephyr/types.h>
19 : #include <zephyr/cpu_freq/pstate.h>
20 :
21 :
22 : /**
23 : * @brief CPU Frequency Scaling Policy
24 : * @defgroup subsys_cpu_freq_policy CPU Frequency Policy
25 : * @since 4.3
26 : * @version 0.1.0
27 : * @ingroup subsys_cpu_freq
28 : * @{
29 : */
30 :
31 : /**
32 : * @brief Get the next P-state from CPU Frequency Policy
33 : *
34 : * This function is implemented by a CPU Freq policy selected via Kconfig.
35 : *
36 : * @param pstate Pointer to the P-state struct where the next P-state is returned.
37 : *
38 : * @retval 0 in case of success, nonzero in case of failure.
39 : */
40 1 : int cpu_freq_policy_select_pstate(const struct pstate **pstate);
41 :
42 : /**
43 : * @}
44 : */
45 :
46 : #ifdef __cplusplus
47 : }
48 : #endif
49 :
50 : #endif /* ZEPHYR_SUBSYS_CPU_FREQ_POLICY_H_ */
|