Skip to content

Commit 707e222

Browse files
committed
cpufreq: dt: Set .set_boost directly
The boost feature can be controlled at two levels currently, driver level (applies to all policies) and per-policy. Currently the driver enables driver level boost support from the per-policy ->init() callback, which isn't really efficient as that gets called for each policy and then there is online/offline path too where this gets done unnecessarily. Instead set the .set_boost field directly and always enable the boost support. If a policy doesn't support boost feature, the core will not enable it for that policy. Keep the initial state of driver level boost to disabled and let the user enable it if required as ideally the boost frequencies must be used only when really required. Signed-off-by: Viresh Kumar <[email protected]>
1 parent 11847a5 commit 707e222

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

drivers/cpufreq/cpufreq-dt.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
114114
policy->cpuinfo.transition_latency = transition_latency;
115115
policy->dvfs_possible_from_any_cpu = true;
116116

117-
/* Support turbo/boost mode */
118-
if (policy_has_boost_freq(policy)) {
119-
/* This gets disabled by core on driver unregister */
120-
ret = cpufreq_enable_boost_support();
121-
if (ret)
122-
goto out_clk_put;
123-
}
124-
125117
return 0;
126-
127-
out_clk_put:
128-
clk_put(cpu_clk);
129-
130-
return ret;
131118
}
132119

133120
static int cpufreq_online(struct cpufreq_policy *policy)
@@ -162,6 +149,7 @@ static struct cpufreq_driver dt_cpufreq_driver = {
162149
.offline = cpufreq_offline,
163150
.register_em = cpufreq_register_em_with_opp,
164151
.name = "cpufreq-dt",
152+
.set_boost = cpufreq_boost_set_sw,
165153
.suspend = cpufreq_generic_suspend,
166154
};
167155

0 commit comments

Comments
 (0)