lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/4] OPP: Add "opp-microwatt" supporting code
On 24-02-22, 08:11, Lukasz Luba wrote:
> +/**
> + * dev_pm_opp_get_power() - Gets the power corresponding to an opp
> + * @opp: opp for which power has to be returned for
> + *
> + * Return: power in micro watt corresponding to the opp, else
> + * return 0
> + *
> + * This is useful only for devices with single power supply.
> + */
> +unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp)
> +{
> + if (IS_ERR_OR_NULL(opp)) {
> + pr_err("%s: Invalid parameters\n", __func__);
> + return 0;
> + }
> +
> + return opp->supplies[0].u_watt;

What about returning the total of all u_watts for this OPP here ?
Surely it doesn't make sense to do the same for voltage and current,
but power is different.

--
viresh

\
 
 \ /
  Last update: 2022-02-24 10:05    [W:0.143 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site