Lines Matching +full:max +full:- +full:frequency
1 .. SPDX-License-Identifier: GPL-2.0
10 - Dominik Brodowski <[email protected]>
11 - Rafael J. Wysocki <[email protected]>
12 - Viresh Kumar <[email protected]>
18 1.2 Per-CPU Initialization
24 2. Frequency Table Helpers
31 So, you just got a brand-new CPU / chipset with datasheets and want to
37 ------------------
46 .name - The name of this driver.
48 .init - A pointer to the per-policy initialization function.
50 .verify - A pointer to a "verification" function.
52 .setpolicy _or_ .fast_switch _or_ .target _or_ .target_index - See
57 .flags - Hints for the cpufreq core.
59 .driver_data - cpufreq driver specific data.
61 .get_intermediate and target_intermediate - Used to switch to stable
62 frequency while changing CPU frequency.
64 .get - Returns current frequency of the CPU.
66 .bios_limit - Returns HW/BIOS max frequency limitations for the CPU.
68 .exit - A pointer to a per-policy cleanup function called during
71 .suspend - A pointer to a per-policy suspend function which is called
75 .resume - A pointer to a per-policy resume function which is called
78 .ready - A pointer to a per-policy ready function which is called after
81 .attr - A pointer to a NULL-terminated list of "struct freq_attr" which
84 .boost_enabled - If set, boost frequencies are enabled.
86 .set_boost - A pointer to a per-policy function to enable/disable boost
90 1.2 Per-CPU Initialization
91 --------------------------
94 cpufreq driver registers itself, the per-policy initialization function
104 +-----------------------------------+--------------------------------------+
105 |policy->cpuinfo.min_freq _and_ | |
106 |policy->cpuinfo.max_freq | the minimum and maximum frequency |
109 +-----------------------------------+--------------------------------------+
110 |policy->cpuinfo.transition_latency | the time it takes on this CPU to |
114 +-----------------------------------+--------------------------------------+
115 |policy->cur | The current operating frequency of |
117 +-----------------------------------+--------------------------------------+
118 |policy->min, | |
119 |policy->max, | |
120 |policy->policy and, if necessary, | |
121 |policy->governor | must contain the "default policy" for|
127 +-----------------------------------+--------------------------------------+
128 |policy->cpus | Update this with the masks of the |
132 +-----------------------------------+--------------------------------------+
134 For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the
135 frequency table helpers might be helpful. See the section 2 for more information
140 ----------
143 "policy,governor,min,max") shall be set, this policy must be validated
147 See section 2 for details on frequency table helpers.
149 You need to make sure that at least one valid frequency (or operating
150 range) is within policy->min and policy->max. If necessary, increase
151 policy->max first, and only if this is no solution, decrease policy->min.
155 -------------------------------------------------------
157 Most cpufreq drivers or even most cpu frequency scaling algorithms
158 only allow the CPU frequency to be set to predefined fixed values. For
159 these, you use the ->target(), ->target_index() or ->fast_switch()
162 Some cpufreq capable processors switch the frequency between certain
163 limits on their own. These shall use the ->setpolicy() callback.
167 ------------------------
170 and ``unsigned int`` index (into the exposed frequency table).
172 The CPUfreq driver must set the new frequency when called here. The
173 actual frequency must be determined by freq_table[index].frequency.
175 It should always restore to earlier frequency (i.e. policy->restore_freq) in
176 case of errors, even if we switched to intermediate frequency earlier.
179 ----------
183 The CPUfreq driver must set the new frequency when called here. The
184 actual frequency must be determined using the following rules:
186 - keep close to "target_freq"
187 - policy->min <= new_freq <= policy->max (THIS MUST BE VALID!!!)
188 - if relation==CPUFREQ_REL_L, try to select a new_freq higher than or equal
190 - if relation==CPUFREQ_REL_H, try to select a new_freq lower than or equal
193 Here again the frequency table helper might assist you - see section 2
197 ----------------
199 This function is used for frequency switching from scheduler's context.
209 -------------
212 argument. You need to set the lower limit of the in-processor or
213 in-chipset dynamic frequency switching to policy->min, the upper limit
214 to policy->max, and -if supported- select a performance-oriented
215 setting when policy->policy is CPUFREQ_POLICY_PERFORMANCE, and a
216 powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check
220 --------------------------------------------
224 get_intermediate should return a stable intermediate frequency platform wants to
225 switch to, and target_intermediate() should set CPU to that frequency, before
226 jumping to the frequency corresponding to 'index'. Core will take care of
231 to intermediate frequency for some target frequency. In that case core will
232 directly call ->target_index().
234 NOTE: ->target_index() should restore to policy->restore_freq in case of
238 2. Frequency Table Helpers
242 frequencies, a "frequency table" with some functions might assist in
243 some work of the processor driver. Such a "frequency table" consists of
245 values in "driver_data", the corresponding frequency in "frequency" and
247 cpufreq_frequency_table entry with frequency set to CPUFREQ_TABLE_END.
248 And if you want to skip one entry in the table, set the frequency to
254 valid pointer in its policy->freq_table field.
257 frequency is within policy->min and policy->max, and all other criteria
258 are met. This is helpful for the ->verify call.
260 cpufreq_frequency_table_target() is the corresponding frequency table
261 helper for the ->target stage. Just pass the values to this function,
262 and this function returns the of the frequency table entry which
263 contains the frequency the CPU shall be set to.
267 cpufreq_for_each_entry(pos, table) - iterates over all entries of frequency
270 cpufreq_for_each_valid_entry(pos, table) - iterates over all entries,
272 Use arguments "pos" - a ``cpufreq_frequency_table *`` as a loop cursor and
273 "table" - the ``cpufreq_frequency_table *`` you want to iterate over.
281 pos->frequency = ...