Lines Matching refs:cpu_data

82 	struct cppc_cpudata *cpu_data;  member
89 static int cppc_perf_from_fbctrs(struct cppc_cpudata *cpu_data,
114 struct cppc_cpudata *cpu_data; in cppc_scale_freq_workfn() local
119 cpu_data = cppc_fi->cpu_data; in cppc_scale_freq_workfn()
126 perf = cppc_perf_from_fbctrs(cpu_data, &cppc_fi->prev_perf_fb_ctrs, in cppc_scale_freq_workfn()
131 local_freq_scale = div64_u64(perf, cpu_data->perf_caps.highest_perf); in cppc_scale_freq_workfn()
175 cppc_fi->cpu_data = policy->driver_data; in cppc_cpufreq_cpu_fie_init()
328 static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu_data, in cppc_cpufreq_perf_to_khz() argument
331 struct cppc_perf_caps *caps = &cpu_data->perf_caps; in cppc_cpufreq_perf_to_khz()
353 static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu_data, in cppc_cpufreq_khz_to_perf() argument
356 struct cppc_perf_caps *caps = &cpu_data->perf_caps; in cppc_cpufreq_khz_to_perf()
383 struct cppc_cpudata *cpu_data = policy->driver_data; in cppc_cpufreq_set_target() local
389 desired_perf = cppc_cpufreq_khz_to_perf(cpu_data, target_freq); in cppc_cpufreq_set_target()
391 if (desired_perf == cpu_data->perf_ctrls.desired_perf) in cppc_cpufreq_set_target()
394 cpu_data->perf_ctrls.desired_perf = desired_perf; in cppc_cpufreq_set_target()
399 ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls); in cppc_cpufreq_set_target()
412 struct cppc_cpudata *cpu_data = policy->driver_data; in cppc_cpufreq_fast_switch() local
417 desired_perf = cppc_cpufreq_khz_to_perf(cpu_data, target_freq); in cppc_cpufreq_fast_switch()
418 cpu_data->perf_ctrls.desired_perf = desired_perf; in cppc_cpufreq_fast_switch()
419 ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls); in cppc_cpufreq_fast_switch()
484 struct cppc_cpudata *cpu_data; in get_perf_level_count() local
487 cpu_data = policy->driver_data; in get_perf_level_count()
488 perf_caps = &cpu_data->perf_caps; in get_perf_level_count()
517 struct cppc_cpudata *cpu_data; in cppc_get_cpu_power() local
520 cpu_data = policy->driver_data; in cppc_get_cpu_power()
521 perf_caps = &cpu_data->perf_caps; in cppc_get_cpu_power()
530 perf_prev = cppc_cpufreq_khz_to_perf(cpu_data, *KHz); in cppc_get_cpu_power()
550 *KHz = cppc_cpufreq_perf_to_khz(cpu_data, perf); in cppc_get_cpu_power()
551 perf_check = cppc_cpufreq_khz_to_perf(cpu_data, *KHz); in cppc_get_cpu_power()
561 *KHz = cppc_cpufreq_perf_to_khz(cpu_data, perf); in cppc_get_cpu_power()
562 perf_check = cppc_cpufreq_khz_to_perf(cpu_data, *KHz); in cppc_get_cpu_power()
582 struct cppc_cpudata *cpu_data; in cppc_get_cpu_cost() local
587 cpu_data = policy->driver_data; in cppc_get_cpu_cost()
588 perf_caps = &cpu_data->perf_caps; in cppc_get_cpu_cost()
591 perf_prev = cppc_cpufreq_khz_to_perf(cpu_data, KHz); in cppc_get_cpu_cost()
638 struct cppc_cpudata *cpu_data; in cppc_cpufreq_register_em() local
642 cpu_data = policy->driver_data; in cppc_cpufreq_register_em()
645 cpu_data->shared_cpu_map, 0); in cppc_cpufreq_register_em()
657 struct cppc_cpudata *cpu_data; in cppc_cpufreq_get_cpu_data() local
660 cpu_data = kzalloc(sizeof(struct cppc_cpudata), GFP_KERNEL); in cppc_cpufreq_get_cpu_data()
661 if (!cpu_data) in cppc_cpufreq_get_cpu_data()
664 if (!zalloc_cpumask_var(&cpu_data->shared_cpu_map, GFP_KERNEL)) in cppc_cpufreq_get_cpu_data()
667 ret = acpi_get_psd_map(cpu, cpu_data); in cppc_cpufreq_get_cpu_data()
673 ret = cppc_get_perf_caps(cpu, &cpu_data->perf_caps); in cppc_cpufreq_get_cpu_data()
680 cpu_data->perf_caps.lowest_freq *= 1000; in cppc_cpufreq_get_cpu_data()
681 cpu_data->perf_caps.nominal_freq *= 1000; in cppc_cpufreq_get_cpu_data()
683 list_add(&cpu_data->node, &cpu_data_list); in cppc_cpufreq_get_cpu_data()
685 return cpu_data; in cppc_cpufreq_get_cpu_data()
688 free_cpumask_var(cpu_data->shared_cpu_map); in cppc_cpufreq_get_cpu_data()
690 kfree(cpu_data); in cppc_cpufreq_get_cpu_data()
697 struct cppc_cpudata *cpu_data = policy->driver_data; in cppc_cpufreq_put_cpu_data() local
699 list_del(&cpu_data->node); in cppc_cpufreq_put_cpu_data()
700 free_cpumask_var(cpu_data->shared_cpu_map); in cppc_cpufreq_put_cpu_data()
701 kfree(cpu_data); in cppc_cpufreq_put_cpu_data()
708 struct cppc_cpudata *cpu_data; in cppc_cpufreq_cpu_init() local
712 cpu_data = cppc_cpufreq_get_cpu_data(cpu); in cppc_cpufreq_cpu_init()
713 if (!cpu_data) { in cppc_cpufreq_cpu_init()
717 caps = &cpu_data->perf_caps; in cppc_cpufreq_cpu_init()
718 policy->driver_data = cpu_data; in cppc_cpufreq_cpu_init()
724 policy->min = cppc_cpufreq_perf_to_khz(cpu_data, in cppc_cpufreq_cpu_init()
726 policy->max = cppc_cpufreq_perf_to_khz(cpu_data, in cppc_cpufreq_cpu_init()
734 policy->cpuinfo.min_freq = cppc_cpufreq_perf_to_khz(cpu_data, in cppc_cpufreq_cpu_init()
736 policy->cpuinfo.max_freq = cppc_cpufreq_perf_to_khz(cpu_data, in cppc_cpufreq_cpu_init()
740 policy->shared_type = cpu_data->shared_type; in cppc_cpufreq_cpu_init()
753 cpumask_copy(policy->cpus, cpu_data->shared_cpu_map); in cppc_cpufreq_cpu_init()
773 policy->cur = cppc_cpufreq_perf_to_khz(cpu_data, caps->highest_perf); in cppc_cpufreq_cpu_init()
774 cpu_data->perf_ctrls.desired_perf = caps->highest_perf; in cppc_cpufreq_cpu_init()
776 ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls); in cppc_cpufreq_cpu_init()
793 struct cppc_cpudata *cpu_data = policy->driver_data; in cppc_cpufreq_cpu_exit() local
794 struct cppc_perf_caps *caps = &cpu_data->perf_caps; in cppc_cpufreq_cpu_exit()
800 cpu_data->perf_ctrls.desired_perf = caps->lowest_perf; in cppc_cpufreq_cpu_exit()
802 ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls); in cppc_cpufreq_cpu_exit()
819 static int cppc_perf_from_fbctrs(struct cppc_cpudata *cpu_data, in cppc_perf_from_fbctrs() argument
835 return cpu_data->perf_ctrls.desired_perf; in cppc_perf_from_fbctrs()
844 struct cppc_cpudata *cpu_data = policy->driver_data; in cppc_cpufreq_get_rate() local
860 delivered_perf = cppc_perf_from_fbctrs(cpu_data, &fb_ctrs_t0, in cppc_cpufreq_get_rate()
863 return cppc_cpufreq_perf_to_khz(cpu_data, delivered_perf); in cppc_cpufreq_get_rate()
868 struct cppc_cpudata *cpu_data = policy->driver_data; in cppc_cpufreq_set_boost() local
869 struct cppc_perf_caps *caps = &cpu_data->perf_caps; in cppc_cpufreq_set_boost()
878 policy->max = cppc_cpufreq_perf_to_khz(cpu_data, in cppc_cpufreq_set_boost()
881 policy->max = cppc_cpufreq_perf_to_khz(cpu_data, in cppc_cpufreq_set_boost()
894 struct cppc_cpudata *cpu_data = policy->driver_data; in show_freqdomain_cpus() local
896 return cpufreq_show_cpus(cpu_data->shared_cpu_map, buf); in show_freqdomain_cpus()
927 struct cppc_cpudata *cpu_data = policy->driver_data; in hisi_cppc_cpufreq_get_rate() local
937 return cppc_cpufreq_perf_to_khz(cpu_data, desired_perf); in hisi_cppc_cpufreq_get_rate()