Re: [PATCH RFC net-next v2 11/18] regulator: Add support for power budget description

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 30 Oct 2024 17:03:06 +0000
Mark Brown <broonie@xxxxxxxxxx> wrote:

> On Wed, Oct 30, 2024 at 05:53:13PM +0100, Kory Maincent wrote:
> 
> > +/**
> > + * regulator_get_power_budget - get regulator total power budget
> > + * @regulator: regulator source
> > + *
> > + * Return: Power budget of the regulator in mW.
> > + */
> > +int regulator_get_power_budget(struct regulator *regulator)
> > +{
> > +	return regulator->rdev->constraints->pw_budget;
> > +}  
> 
> This is going to go badly with multiple consumers...

On my series the available power budget of the PIs (which are consumers) is
managed in the PSE core in the PSE power domain (patch 13). We could move it
directly to regulator API.

> > +static inline int regulator_get_power_budget(struct regulator *regulator)
> > +{
> > +	return 0;
> > +}  
> 
> We should probably default to INT_MAX here and in the case where we do
> have support, that way consumers will fail gracefully when no budget is
> specified.

That's true. Thanks!

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux