mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
cpufreq: mediatek: Enter system sleep at the suspend OPP
cpufreq_suspend() stops the governors at the start of system suspend, and this driver has no .suspend callback, so each cluster sleeps at whatever OPP it was last left at. On an MT8173 tablet (Amazon Fire HD 10, 2017), entering suspend-to-RAM with both clusters at their highest OPP measured 63.5 mA. With this change and the lowest OPP marked, the same entry measured 52.0 mA. Use the generic suspend-frequency support, as cpufreq-dt does. Tables without an opp-suspend entry leave suspend_freq at 0, which makes cpufreq_generic_suspend() a no-op, so they are unaffected. Assisted-by: LLM Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
6fa50b1988
commit
a4b90518dd
|
|
@ -603,6 +603,7 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
|
|||
policy->freq_table = freq_table;
|
||||
policy->driver_data = info;
|
||||
policy->clk = info->cpu_clk;
|
||||
policy->suspend_freq = dev_pm_opp_get_suspend_opp_freq(info->cpu_dev) / 1000;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -624,6 +625,7 @@ static struct cpufreq_driver mtk_cpufreq_driver = {
|
|||
.init = mtk_cpufreq_init,
|
||||
.exit = mtk_cpufreq_exit,
|
||||
.register_em = cpufreq_register_em_with_opp,
|
||||
.suspend = cpufreq_generic_suspend,
|
||||
.name = "mtk-cpufreq",
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user