aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 3f458896d45c..ec4112d257bc 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -75,6 +75,7 @@ struct cpufreq_policy {
75 unsigned int max; /* in kHz */ 75 unsigned int max; /* in kHz */
76 unsigned int cur; /* in kHz, only needed if cpufreq 76 unsigned int cur; /* in kHz, only needed if cpufreq
77 * governors are used */ 77 * governors are used */
78 unsigned int restore_freq; /* = policy->cur before transition */
78 unsigned int suspend_freq; /* freq to set during suspend */ 79 unsigned int suspend_freq; /* freq to set during suspend */
79 80
80 unsigned int policy; /* see above */ 81 unsigned int policy; /* see above */
@@ -221,11 +222,35 @@ struct cpufreq_driver {
221 222
222 /* define one out of two */ 223 /* define one out of two */
223 int (*setpolicy) (struct cpufreq_policy *policy); 224 int (*setpolicy) (struct cpufreq_policy *policy);
225
226 /*
227 * On failure, should always restore frequency to policy->restore_freq
228 * (i.e. old freq).
229 */
224 int (*target) (struct cpufreq_policy *policy, /* Deprecated */ 230 int (*target) (struct cpufreq_policy *policy, /* Deprecated */
225 unsigned int target_freq, 231 unsigned int target_freq,
226 unsigned int relation); 232 unsigned int relation);
227 int (*target_index) (struct cpufreq_policy *policy, 233 int (*target_index) (struct cpufreq_policy *policy,
228 unsigned int index); 234 unsigned int index);
235 /*
236 * Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION
237 * unset.
238 *
239 * get_intermediate should return a stable intermediate frequency
240 * platform wants to switch to and target_intermediate() should set CPU
241 * to to that frequency, before jumping to the frequency corresponding
242 * to 'index'. Core will take care of sending notifications and driver
243 * doesn't have to handle them in target_intermediate() or
244 * target_index().
245 *
246 * Drivers can return '0' from get_intermediate() in case they don't
247 * wish to switch to intermediate frequency for some target frequency.
248 * In that case core will directly call ->target_index().
249 */
250 unsigned int (*get_intermediate)(struct cpufreq_policy *policy,
251 unsigned int index);
252 int (*target_intermediate)(struct cpufreq_policy *policy,
253 unsigned int index);
229 254
230 /* should be defined, if possible */ 255 /* should be defined, if possible */
231 unsigned int (*get) (unsigned int cpu); 256 unsigned int (*get) (unsigned int cpu);