1
- CPU frequency and voltage scaling code in the Linux(TM) kernel
1
+ .. SPDX-License-Identifier: GPL-2.0
2
2
3
+ =============================================================
4
+ General description of the CPUFreq core and CPUFreq notifiers
5
+ =============================================================
3
6
4
- L i n u x C P U F r e q
7
+ Authors:
8
+ - Dominik Brodowski <
[email protected] >
9
+ - David Kimdon <
[email protected] >
10
+ - Rafael J. Wysocki <
[email protected] >
11
+ - Viresh Kumar <
[email protected] >
5
12
6
- C P U F r e q C o r e
13
+ .. Contents:
7
14
8
-
9
- Dominik Brodowski <
[email protected] >
10
-
11
- Rafael J. Wysocki <
[email protected] >
12
-
13
-
14
-
15
-
16
- Clock scaling allows you to change the clock speed of the CPUs on the
17
- fly. This is a nice method to save battery power, because the lower
18
- the clock speed, the less power the CPU consumes.
19
-
20
-
21
- Contents:
22
- ---------
23
- 1. CPUFreq core and interfaces
24
- 2. CPUFreq notifiers
25
- 3. CPUFreq Table Generation with Operating Performance Point (OPP)
15
+ 1. CPUFreq core and interfaces
16
+ 2. CPUFreq notifiers
17
+ 3. CPUFreq Table Generation with Operating Performance Point (OPP)
26
18
27
19
1. General Information
28
- =======================
20
+ ======================
29
21
30
22
The CPUFreq core code is located in drivers/cpufreq/cpufreq.c. This
31
23
cpufreq code offers a standardized interface for the CPUFreq
@@ -63,7 +55,7 @@ The phase is specified in the second argument to the notifier. The phase is
63
55
CPUFREQ_CREATE_POLICY when the policy is first created and it is
64
56
CPUFREQ_REMOVE_POLICY when the policy is removed.
65
57
66
- The third argument, a void *pointer, points to a struct cpufreq_policy
58
+ The third argument, a `` void *pointer `` , points to a struct cpufreq_policy
67
59
consisting of several values, including min, max (the lower and upper
68
60
frequencies (in kHz) of the new policy).
69
61
@@ -80,10 +72,13 @@ CPUFREQ_POSTCHANGE.
80
72
81
73
The third argument is a struct cpufreq_freqs with the following
82
74
values:
83
- cpu - number of the affected CPU
84
- old - old frequency
85
- new - new frequency
86
- flags - flags of the cpufreq driver
75
+
76
+ ===== ===========================
77
+ cpu number of the affected CPU
78
+ old old frequency
79
+ new new frequency
80
+ flags flags of the cpufreq driver
81
+ ===== ===========================
87
82
88
83
3. CPUFreq Table Generation with Operating Performance Point (OPP)
89
84
==================================================================
@@ -94,9 +89,12 @@ dev_pm_opp_init_cpufreq_table -
94
89
the OPP layer's internal information about the available frequencies
95
90
into a format readily providable to cpufreq.
96
91
97
- WARNING: Do not use this function in interrupt context.
92
+ .. Warning ::
93
+
94
+ Do not use this function in interrupt context.
95
+
96
+ Example::
98
97
99
- Example:
100
98
soc_pm_init()
101
99
{
102
100
/* Do things */
@@ -106,7 +104,10 @@ dev_pm_opp_init_cpufreq_table -
106
104
/* Do other things */
107
105
}
108
106
109
- NOTE: This function is available only if CONFIG_CPU_FREQ is enabled in
110
- addition to CONFIG_PM_OPP.
107
+ .. note ::
108
+
109
+ This function is available only if CONFIG_CPU_FREQ is enabled in
110
+ addition to CONFIG_PM_OPP.
111
111
112
- dev_pm_opp_free_cpufreq_table - Free up the table allocated by dev_pm_opp_init_cpufreq_table
112
+ dev_pm_opp_free_cpufreq_table
113
+ Free up the table allocated by dev_pm_opp_init_cpufreq_table
0 commit comments