Skip to content

Commit ddef17b

Browse files
committed
cpufreq: apple: 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 691b321 commit ddef17b

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/cpufreq/apple-soc-cpufreq.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,6 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)
310310
policy->fast_switch_possible = true;
311311
policy->suspend_freq = freq_table[0].frequency;
312312

313-
if (policy_has_boost_freq(policy)) {
314-
ret = cpufreq_enable_boost_support();
315-
if (ret) {
316-
dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
317-
} else {
318-
apple_soc_cpufreq_driver.boost_enabled = true;
319-
}
320-
}
321-
322313
return 0;
323314

324315
out_free_cpufreq_table:
@@ -353,6 +344,7 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
353344
.target_index = apple_soc_cpufreq_set_target,
354345
.fast_switch = apple_soc_cpufreq_fast_switch,
355346
.register_em = cpufreq_register_em_with_opp,
347+
.set_boost = cpufreq_boost_set_sw,
356348
.suspend = cpufreq_generic_suspend,
357349
};
358350

0 commit comments

Comments
 (0)