Lines Matching refs:policy
59 unsigned int cpu; /* cpu managing this policy, must be online */
68 unsigned int restore_freq; /* = policy->cur before transition */
71 unsigned int policy; /* see above */
72 unsigned int last_policy; /* policy before unplug */
93 * - Any routine that wants to read from the policy structure will
95 * - Any routine that will write to the policy structure and/or may take away
96 * the policy altogether (eg. CPU hotplug), will hold this lock in write
105 * policy and that the change will affect all of the policy CPUs then.
120 * the driver to set the frequency for this policy. To be set by the
158 * Used for passing new cpufreq policy data to the cpufreq driver's ->verify()
172 struct cpufreq_policy *policy;
187 void cpufreq_cpu_put(struct cpufreq_policy *policy);
197 static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
200 static inline bool policy_is_inactive(struct cpufreq_policy *policy)
202 return cpumask_empty(policy->cpus);
205 static inline bool policy_is_shared(struct cpufreq_policy *policy)
207 return cpumask_weight(policy->cpus) > 1;
220 void cpufreq_cpu_release(struct cpufreq_policy *policy);
221 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
222 void refresh_frequency_limits(struct cpufreq_policy *policy);
227 struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
228 void cpufreq_enable_fast_switch(struct cpufreq_policy *policy);
229 void cpufreq_disable_fast_switch(struct cpufreq_policy *policy);
255 void cpufreq_stats_create_table(struct cpufreq_policy *policy);
256 void cpufreq_stats_free_table(struct cpufreq_policy *policy);
257 void cpufreq_stats_record_transition(struct cpufreq_policy *policy,
260 static inline void cpufreq_stats_create_table(struct cpufreq_policy *policy) { }
261 static inline void cpufreq_stats_free_table(struct cpufreq_policy *policy) { }
262 static inline void cpufreq_stats_record_transition(struct cpufreq_policy *policy,
311 int (*init)(struct cpufreq_policy *policy);
312 int (*verify)(struct cpufreq_policy_data *policy);
315 int (*setpolicy)(struct cpufreq_policy *policy);
318 * On failure, should always restore frequency to policy->restore_freq
321 int (*target)(struct cpufreq_policy *policy,
324 int (*target_index)(struct cpufreq_policy *policy,
326 unsigned int (*fast_switch)(struct cpufreq_policy *policy,
335 unsigned int (*resolve_freq)(struct cpufreq_policy *policy,
353 unsigned int (*get_intermediate)(struct cpufreq_policy *policy,
355 int (*target_intermediate)(struct cpufreq_policy *policy,
361 /* Called to update policy limits on firmware notifications. */
367 int (*online)(struct cpufreq_policy *policy);
368 int (*offline)(struct cpufreq_policy *policy);
369 int (*exit)(struct cpufreq_policy *policy);
370 void (*stop_cpu)(struct cpufreq_policy *policy);
371 int (*suspend)(struct cpufreq_policy *policy);
372 int (*resume)(struct cpufreq_policy *policy);
375 void (*ready)(struct cpufreq_policy *policy);
381 int (*set_boost)(struct cpufreq_policy *policy, int state);
434 * the diver if the target frequency does not change, but the policy min or max
452 static inline void cpufreq_verify_within_limits(struct cpufreq_policy_data *policy,
456 if (policy->min < min)
457 policy->min = min;
458 if (policy->max < min)
459 policy->max = min;
460 if (policy->min > max)
461 policy->min = max;
462 if (policy->max > max)
463 policy->max = max;
464 if (policy->min > policy->max)
465 policy->min = policy->max;
470 cpufreq_verify_within_cpu_limits(struct cpufreq_policy_data *policy)
472 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
473 policy->cpuinfo.max_freq);
479 int cpufreq_generic_suspend(struct cpufreq_policy *policy);
504 void cpufreq_freq_transition_begin(struct cpufreq_policy *policy,
506 void cpufreq_freq_transition_end(struct cpufreq_policy *policy,
570 int (*init)(struct cpufreq_policy *policy);
571 void (*exit)(struct cpufreq_policy *policy);
572 int (*start)(struct cpufreq_policy *policy);
573 void (*stop)(struct cpufreq_policy *policy);
574 void (*limits)(struct cpufreq_policy *policy);
575 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
577 int (*store_setspeed) (struct cpufreq_policy *policy,
594 unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
596 int cpufreq_driver_target(struct cpufreq_policy *policy,
599 int __cpufreq_driver_target(struct cpufreq_policy *policy,
602 unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
604 unsigned int cpufreq_policy_transition_delay_us(struct cpufreq_policy *policy);
607 int cpufreq_start_governor(struct cpufreq_policy *policy);
608 void cpufreq_stop_governor(struct cpufreq_policy *policy);
627 static inline void cpufreq_policy_apply_limits(struct cpufreq_policy *policy)
629 if (policy->max < policy->cur)
630 __cpufreq_driver_target(policy, policy->max, CPUFREQ_RELATION_H);
631 else if (policy->min > policy->cur)
632 __cpufreq_driver_target(policy, policy->min, CPUFREQ_RELATION_L);
744 int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
747 int cpufreq_frequency_table_verify(struct cpufreq_policy_data *policy,
749 int cpufreq_generic_frequency_table_verify(struct cpufreq_policy_data *policy);
751 int cpufreq_table_index_unsorted(struct cpufreq_policy *policy,
754 int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
763 bool policy_has_boost_freq(struct cpufreq_policy *policy);
766 static inline int cpufreq_table_find_index_al(struct cpufreq_policy *policy,
769 struct cpufreq_frequency_table *table = policy->freq_table;
787 static inline int cpufreq_table_find_index_dl(struct cpufreq_policy *policy,
790 struct cpufreq_frequency_table *table = policy->freq_table;
817 static inline int cpufreq_table_find_index_l(struct cpufreq_policy *policy,
820 target_freq = clamp_val(target_freq, policy->min, policy->max);
822 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING)
823 return cpufreq_table_find_index_al(policy, target_freq);
825 return cpufreq_table_find_index_dl(policy, target_freq);
829 static inline int cpufreq_table_find_index_ah(struct cpufreq_policy *policy,
832 struct cpufreq_frequency_table *table = policy->freq_table;
859 static inline int cpufreq_table_find_index_dh(struct cpufreq_policy *policy,
862 struct cpufreq_frequency_table *table = policy->freq_table;
880 static inline int cpufreq_table_find_index_h(struct cpufreq_policy *policy,
883 target_freq = clamp_val(target_freq, policy->min, policy->max);
885 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING)
886 return cpufreq_table_find_index_ah(policy, target_freq);
888 return cpufreq_table_find_index_dh(policy, target_freq);
892 static inline int cpufreq_table_find_index_ac(struct cpufreq_policy *policy,
895 struct cpufreq_frequency_table *table = policy->freq_table;
926 static inline int cpufreq_table_find_index_dc(struct cpufreq_policy *policy,
929 struct cpufreq_frequency_table *table = policy->freq_table;
960 static inline int cpufreq_table_find_index_c(struct cpufreq_policy *policy,
963 target_freq = clamp_val(target_freq, policy->min, policy->max);
965 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING)
966 return cpufreq_table_find_index_ac(policy, target_freq);
968 return cpufreq_table_find_index_dc(policy, target_freq);
971 static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
975 if (unlikely(policy->freq_table_sorted == CPUFREQ_TABLE_UNSORTED))
976 return cpufreq_table_index_unsorted(policy, target_freq,
981 return cpufreq_table_find_index_l(policy, target_freq);
983 return cpufreq_table_find_index_h(policy, target_freq);
985 return cpufreq_table_find_index_c(policy, target_freq);
992 static inline int cpufreq_table_count_valid_entries(const struct cpufreq_policy *policy)
997 if (unlikely(!policy->freq_table))
1000 cpufreq_for_each_valid_entry(pos, policy->freq_table)
1020 static inline bool policy_has_boost_freq(struct cpufreq_policy *policy)
1027 void sched_cpufreq_governor_change(struct cpufreq_policy *policy,
1030 static inline void sched_cpufreq_governor_change(struct cpufreq_policy *policy,
1050 int cpufreq_table_validate_and_sort(struct cpufreq_policy *policy);
1053 void cpufreq_generic_init(struct cpufreq_policy *policy,