summaryrefslogtreecommitdiff
path: root/include/acpi
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2023-12-11 11:48:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-01 01:56:05 +0100
commitff2a9c4029046a1b4bc64f47c7d248c056ba61f4 (patch)
tree5f1b3de4bf3f2b66db0e3df232a812423a3f1bd6 /include/acpi
parent31b55b2be4f36abb7e6dd9bb79e406176803bdda (diff)
downloadlinux-ff2a9c4029046a1b4bc64f47c7d248c056ba61f4.tar.gz
linux-ff2a9c4029046a1b4bc64f47c7d248c056ba61f4.tar.bz2
linux-ff2a9c4029046a1b4bc64f47c7d248c056ba61f4.zip
cpufreq/cppc: Move and rename cppc_cpufreq_{perf_to_khz|khz_to_perf}()
[ Upstream commit 50b813b147e9eb6546a1fc49d4e703e6d23691f2 ] Move and rename cppc_cpufreq_perf_to_khz() and cppc_cpufreq_khz_to_perf() to use them outside cppc_cpufreq in topology_init_cpu_capacity_cppc(). Modify the interface to use struct cppc_perf_caps *caps instead of struct cppc_cpudata *cpu_data as we only use the fields of cppc_perf_caps. cppc_cpufreq was converting the lowest and nominal freq from MHz to kHz before using them. We move this conversion inside cppc_perf_to_khz and cppc_khz_to_perf to make them generic and usable outside cppc_cpufreq. No functional change Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Pierre Gondois <pierre.gondois@arm.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/20231211104855.558096-6-vincent.guittot@linaro.org Stable-dep-of: d93df29bdab1 ("cpufreq: CPPC: fix perf_to_khz/khz_to_perf conversion exception") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/cppc_acpi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index b097bd57b2e4..2d1ec0e6ee01 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -143,6 +143,8 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
extern int cppc_set_enable(int cpu, bool enable);
extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
extern bool cppc_perf_ctrs_in_pcc(void);
+extern unsigned int cppc_perf_to_khz(struct cppc_perf_caps *caps, unsigned int perf);
+extern unsigned int cppc_khz_to_perf(struct cppc_perf_caps *caps, unsigned int freq);
extern bool acpi_cpc_valid(void);
extern bool cppc_allow_fast_switch(void);
extern int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data);