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_H_
8 : #define ZEPHYR_SUBSYS_CPU_FREQ_H_
9 :
10 : #ifdef __cplusplus
11 : extern "C" {
12 : #endif
13 :
14 : #include <zephyr/types.h>
15 : #include <zephyr/cpu_freq/pstate.h>
16 :
17 : /**
18 : * @brief Dynamic CPU Frequency Scaling
19 : * @defgroup subsys_cpu_freq CPU Frequency (CPUFreq)
20 : * @since 4.3
21 : * @version 0.1.0
22 : * @ingroup os_services
23 : * @{
24 : */
25 :
26 : /**
27 : * @brief Request processor set the given performance state.
28 : *
29 : * To be implemented by the SoC. This API abstracts the hardware and SoC
30 : * specific calls required to change the performance state of the current CPU.
31 : * The caller must ensure that the current CPU does not change. If called from
32 : * an ISR or a single CPU system, this restriction is automatically met. If
33 : * called from a thread on an SMP system, either interrupts or the scheduler
34 : * must be disabled to ensure the current CPU does not change.
35 : *
36 : * @note It is not guaranteed that the performance state will be set immediately, or at all.
37 : *
38 : * @param state Pointer to performance state.
39 : *
40 : *
41 : * @retval 0 if request received successfully, -errno in case of failure.
42 : */
43 1 : int cpu_freq_pstate_set(const struct pstate *state);
44 :
45 : /**
46 : * @}
47 : */
48 :
49 : #ifdef __cplusplus
50 : }
51 : #endif
52 :
53 : #endif /* ZEPHYR_SUBSYS_CPU_FREQ_H_ */
|