19 lines
493 B
C
19 lines
493 B
C
|
// SPDX-License-Identifier: GPL-2.0
|
||
|
/*
|
||
|
* Copyright (c) 2019 MediaTek Inc.
|
||
|
*/
|
||
|
|
||
|
static unsigned int get_next_freq(struct sugov_policy *sg_policy,
|
||
|
unsigned long util, unsigned long max)
|
||
|
{
|
||
|
struct cpufreq_policy *policy = sg_policy->policy;
|
||
|
int cpu = policy->cpu;
|
||
|
unsigned int freq = arch_scale_freq_invariant() ?
|
||
|
policy->cpuinfo.max_freq : policy->cur;
|
||
|
|
||
|
freq = mtk_map_util_freq(cpu, util);
|
||
|
|
||
|
sg_policy->cached_raw_freq = freq;
|
||
|
return cpufreq_driver_resolve_freq(policy, freq);
|
||
|
}
|