cpufreq: Allow configuring default minimum frequencies in Kconfig

This adds config options that set the default minimum frequency for the
little, big, and prime CPU clusters.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
Danny Lin
2019-09-02 21:32:56 -07:00
committed by UtsavBalar1231
parent f67dd314b6
commit c52d0b68a4
2 changed files with 40 additions and 0 deletions

View File

@@ -250,6 +250,33 @@ config CPU_FREQ_GOV_INTERACTIVE
If in doubt, say N.
config CPU_FREQ_DEFAULT_LITTLE_MIN
int "Default minimum frequency for the little cluster"
default 0
help
This sets the default minimum frequency (in kHz) for the little CPU
cluster.
If in doubt, say 0 to use the hardware's minimum frequency.
config CPU_FREQ_DEFAULT_BIG_MIN
int "Default minimum frequency for the big cluster"
default 0
help
This sets the default minimum frequency (in kHz) for the big CPU
cluster.
If in doubt, say 0 to use the hardware's minimum frequency.
config CPU_FREQ_DEFAULT_PRIME_MIN
int "Default minimum frequency for the prime cluster"
default 0
help
This sets the default minimum frequency (in kHz) for the prime CPU
cluster.
If in doubt, say 0 to use the hardware's minimum frequency.
comment "CPU frequency scaling drivers"
config CPUFREQ_DT

View File

@@ -61,6 +61,19 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
if (max_freq > cpuinfo_max_freq_cached)
cpuinfo_max_freq_cached = max_freq;
#if CONFIG_CPU_FREQ_DEFAULT_LITTLE_MIN
if (cpumask_test_cpu(policy->cpu, cpu_lp_mask))
policy->min = CONFIG_CPU_FREQ_DEFAULT_LITTLE_MIN;
#endif
#if CONFIG_CPU_FREQ_DEFAULT_BIG_MIN
if (cpumask_test_cpu(policy->cpu, cpu_perf_mask))
policy->min = CONFIG_CPU_FREQ_DEFAULT_BIG_MIN;
#endif
#if CONFIG_CPU_FREQ_DEFAULT_PRIME_MIN
if (cpumask_test_cpu(policy->cpu, cpu_perfp_mask))
policy->min = CONFIG_CPU_FREQ_DEFAULT_PRIME_MIN;
#endif
if (policy->min == ~0)
return -EINVAL;
else