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

Skip to content
Commit c06419c5 authored by Quentin Perret's avatar Quentin Perret Committed by Taniya Das
Browse files

PM / OPP: Introduce a power estimation helper



The Energy Model (EM) framework provides an API to let drivers register
the active power of CPUs. The drivers are expected to provide a callback
method which estimates the power consumed by a CPU at each available
performance levels. How exactly this should be implemented, however,
depends on the platform.

On some systems, PM_OPP knows the voltage and frequency at which CPUs
can run. When coupled with the CPU 'capacitance' (as provided by the
'dynamic-power-coefficient' devicetree binding), it is possible to
estimate the dynamic power consumption of a CPU as P = C * V^2 * f, with
C its capacitance and V and f respectively the voltage and frequency of
the OPP. The Intelligent Power Allocator (IPA) thermal governor already
implements that estimation method, in the thermal framework.

However, this power estimation method can be applied to any platform
where all the parameters are known (C, V and f), and not only those
suffering thermal issues. As such, the code implementing this feature
can be re-used to also populate the EM framework now used by EAS.

As a first step, introduce in PM_OPP a helper function which CPUFreq
drivers can use to register into the EM framework. This duplicates the
power estimation done in IPA until it can be migrated to using the EM
framework. This will be done later, once the EM framework has support
for at least all platforms currently supported by IPA.

Change-Id: Ic6c30abab3171e20fe213851b895b974742e6811
Signed-off-by: default avatarQuentin Perret <quentin.perret@arm.com>
Tested-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Git-commit: a4f342b9607d8c2034d3135cbbb11b4028be3678
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/


[tdas@codeaurora.org: minor conflicts fixed]
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
parent 44eef489
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment