Lines Matching refs:policy
245 static int amd_pstate_verify(struct cpufreq_policy_data *policy) in amd_pstate_verify() argument
247 cpufreq_verify_within_cpu_limits(policy); in amd_pstate_verify()
252 static int amd_pstate_target(struct cpufreq_policy *policy, in amd_pstate_target() argument
257 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_target()
267 freqs.old = policy->cur; in amd_pstate_target()
273 cpufreq_freq_transition_begin(policy, &freqs); in amd_pstate_target()
276 cpufreq_freq_transition_end(policy, &freqs, false); in amd_pstate_target()
288 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); in amd_pstate_adjust_perf() local
289 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_adjust_perf()
384 static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) in amd_pstate_set_boost() argument
386 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_set_boost()
395 policy->cpuinfo.max_freq = cpudata->max_freq; in amd_pstate_set_boost()
397 policy->cpuinfo.max_freq = cpudata->nominal_freq; in amd_pstate_set_boost()
399 policy->max = policy->cpuinfo.max_freq; in amd_pstate_set_boost()
402 policy->cpuinfo.max_freq); in amd_pstate_set_boost()
428 static int amd_pstate_cpu_init(struct cpufreq_policy *policy) in amd_pstate_cpu_init() argument
438 amd_perf_ctl_reset(policy->cpu); in amd_pstate_cpu_init()
439 dev = get_cpu_device(policy->cpu); in amd_pstate_cpu_init()
447 cpudata->cpu = policy->cpu; in amd_pstate_cpu_init()
465 policy->cpuinfo.transition_latency = AMD_PSTATE_TRANSITION_LATENCY; in amd_pstate_cpu_init()
466 policy->transition_delay_us = AMD_PSTATE_TRANSITION_DELAY; in amd_pstate_cpu_init()
468 policy->min = min_freq; in amd_pstate_cpu_init()
469 policy->max = max_freq; in amd_pstate_cpu_init()
471 policy->cpuinfo.min_freq = min_freq; in amd_pstate_cpu_init()
472 policy->cpuinfo.max_freq = max_freq; in amd_pstate_cpu_init()
475 policy->cur = policy->cpuinfo.min_freq; in amd_pstate_cpu_init()
478 policy->fast_switch_possible = true; in amd_pstate_cpu_init()
480 ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0], in amd_pstate_cpu_init()
481 FREQ_QOS_MIN, policy->cpuinfo.min_freq); in amd_pstate_cpu_init()
487 ret = freq_qos_add_request(&policy->constraints, &cpudata->req[1], in amd_pstate_cpu_init()
488 FREQ_QOS_MAX, policy->cpuinfo.max_freq); in amd_pstate_cpu_init()
500 policy->driver_data = cpudata; in amd_pstate_cpu_init()
513 static int amd_pstate_cpu_exit(struct cpufreq_policy *policy) in amd_pstate_cpu_exit() argument
515 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_cpu_exit()
524 static int amd_pstate_cpu_resume(struct cpufreq_policy *policy) in amd_pstate_cpu_resume() argument
535 static int amd_pstate_cpu_suspend(struct cpufreq_policy *policy) in amd_pstate_cpu_suspend() argument
553 static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, in show_amd_pstate_max_freq() argument
557 struct amd_cpudata *cpudata = policy->driver_data; in show_amd_pstate_max_freq()
566 static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy, in show_amd_pstate_lowest_nonlinear_freq() argument
570 struct amd_cpudata *cpudata = policy->driver_data; in show_amd_pstate_lowest_nonlinear_freq()
583 static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, in show_amd_pstate_highest_perf() argument
587 struct amd_cpudata *cpudata = policy->driver_data; in show_amd_pstate_highest_perf()