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: Quentin Perret <quentin.perret@arm.com>
This commit is contained in:
Quentin Perret 2018-12-19 17:22:58 +00:00 committed by Alistair Strachan
parent edf68da31b
commit e5af61252e

View File

@ -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;