Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17ec3fc5 authored by Danny Lin's avatar Danny Lin Committed by Akshay Kakatkar
Browse files

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: default avatarDanny Lin <danny@kdrag0n.dev>
parent 10c99ed2
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -220,6 +220,33 @@ config CPU_FREQ_GOV_SCHEDUTIL

	  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
+13 −0
Original line number Diff line number Diff line
@@ -58,6 +58,19 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
	policy->min = policy->cpuinfo.min_freq = min_freq;
	policy->max = policy->cpuinfo.max_freq = 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 (max_freq > cpuinfo_max_freq_cached)
		cpuinfo_max_freq_cached = max_freq;