Lines Matching refs:policy

207 int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,  in cpufreq_frequency_table_cpuinfo()  argument
237 policy->min = policy->cpuinfo.min_freq = min_freq; in cpufreq_frequency_table_cpuinfo()
238 policy->max = policy->cpuinfo.max_freq = max_freq; in cpufreq_frequency_table_cpuinfo()
239 policy->cpuinfo.second_max_freq = second_max_freq; in cpufreq_frequency_table_cpuinfo()
241 if (policy->min == ~0) in cpufreq_frequency_table_cpuinfo()
247 int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, in cpufreq_frequency_table_verify() argument
254 if (!cpu_online(policy->cpu)) in cpufreq_frequency_table_verify()
257 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, in cpufreq_frequency_table_verify()
258 policy->cpuinfo.max_freq); in cpufreq_frequency_table_verify()
264 if ((freq >= policy->min) && (freq <= policy->max)) in cpufreq_frequency_table_verify()
266 else if ((next_larger > freq) && (freq > policy->max)) in cpufreq_frequency_table_verify()
271 policy->max = next_larger; in cpufreq_frequency_table_verify()
273 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, in cpufreq_frequency_table_verify()
274 policy->cpuinfo.max_freq); in cpufreq_frequency_table_verify()
279 int cpufreq_frequency_table_target(struct cpufreq_policy *policy, in cpufreq_frequency_table_target() argument
304 if (!cpu_online(policy->cpu)) in cpufreq_frequency_table_target()
311 if ((freq < policy->min) || (freq > policy->max)) in cpufreq_frequency_table_target()
357 int __cpufreq_driver_target(struct cpufreq_policy *policy, in __cpufreq_driver_target() argument
363 if (cpu_online(policy->cpu) && cpufreq_driver->target) in __cpufreq_driver_target()
365 unsigned int prev_freq = policy->cur; in __cpufreq_driver_target()
367 retval = cpufreq_driver->target(policy, target_freq, relation); in __cpufreq_driver_target()
369 TRACE_2D(TRC_PM_FREQ_CHANGE, prev_freq/1000, policy->cur/1000); in __cpufreq_driver_target()
377 struct cpufreq_policy *policy; in cpufreq_driver_getavg() local
380 if (!cpu_online(cpu) || !(policy = per_cpu(cpufreq_cpu_policy, cpu))) in cpufreq_driver_getavg()
390 return policy->cur; in cpufreq_driver_getavg()
395 struct cpufreq_policy *policy; in cpufreq_update_turbo() local
403 policy = per_cpu(cpufreq_cpu_policy, cpuid); in cpufreq_update_turbo()
404 if (!policy) in cpufreq_update_turbo()
407 if (policy->turbo == CPUFREQ_TURBO_UNSUPPORTED) in cpufreq_update_turbo()
410 curr_state = policy->turbo; in cpufreq_update_turbo()
414 policy->turbo = new_state; in cpufreq_update_turbo()
417 ret = cpufreq_driver->update(cpuid, policy); in cpufreq_update_turbo()
419 policy->turbo = curr_state; in cpufreq_update_turbo()
428 struct cpufreq_policy *policy; in cpufreq_get_turbo_status() local
430 policy = per_cpu(cpufreq_cpu_policy, cpuid); in cpufreq_get_turbo_status()
431 return policy && policy->turbo == CPUFREQ_TURBO_ENABLED; in cpufreq_get_turbo_status()
443 struct cpufreq_policy *policy) in __cpufreq_set_policy() argument
447 memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo)); in __cpufreq_set_policy()
449 if (policy->min > data->min && policy->min > policy->max) in __cpufreq_set_policy()
453 ret = cpufreq_driver->verify(policy); in __cpufreq_set_policy()
457 data->min = policy->min; in __cpufreq_set_policy()
458 data->max = policy->max; in __cpufreq_set_policy()
459 data->limits = policy->limits; in __cpufreq_set_policy()
463 if (policy->governor != data->governor) { in __cpufreq_set_policy()
472 data->governor = policy->governor; in __cpufreq_set_policy()