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

Commit e5af6125 authored by Quentin Perret's avatar Quentin Perret Committed by Alistair Strachan
Browse files

ANDROID: PM / OPP: Document power estimation helper



Most functions of PM_OPP have a proper kerneldoc. It is not the case for
of_dev_pm_opp_get_cpu_power() yet.

Add the missing kerneldoc.

Bug: 120440300
Change-Id: Id4617dbcf571b90a6169e8a4dbaa3c9f8d56e756
Signed-off-by: default avatarQuentin Perret <quentin.perret@arm.com>
parent edf68da3
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -779,6 +779,22 @@ struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp)
}
EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node);

/**
 * of_dev_pm_opp_get_cpu_power() - Estimates the power of a CPU
 * @mW:		pointer to the power estimate in milli-watts
 * @KHz:	pointer to the OPP's frequency, in kilo-hertz
 * @cpu:	CPU for which power needs to be estimated
 *
 * Computes the power estimated by @CPU at the first OPP above @KHz (ceil),
 * and updates @KHz and @mW accordingly.
 *
 * The power is estimated as P = C * V^2 * f, with C the CPU's capacitance
 * (read from the 'dynamic-power-coefficient' devicetree binding) and V and f
 * respectively the voltage and frequency of the OPP.
 *
 * Return: -ENODEV if the CPU device cannot be found, -EINVAL if the power
 * calculation failed because of missing parameters, 0 otherwise.
 */
int of_dev_pm_opp_get_cpu_power(unsigned long *mW, unsigned long *KHz, int cpu)
{
	unsigned long mV, Hz, MHz;