From e5af61252e3dec24b3ebdf8852fff1c7055e6a71 Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Wed, 19 Dec 2018 17:22:58 +0000 Subject: [PATCH] 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 --- drivers/opp/of.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 3d4ec2fad051..7830df8f9f7b 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -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;