Re: [PATCH v2 1/2] regulator: core: add regulator_has_continuous_voltage_range()

From: Mark Brown
Date: Fri Mar 24 2017 - 14:44:02 EST


On Thu, Mar 23, 2017 at 02:40:16PM -0700, Matthias Kaehlcke wrote:
> El Mon, Mar 20, 2017 at 12:06:15PM +0000 Mark Brown ha dit:
> > On Fri, Mar 17, 2017 at 05:03:30PM -0700, Matthias Kaehlcke wrote:

> > > You are right that my case is very specialist, however I think it is
> > > a general problem that a consumer can't know whether the results of
> > > _list_voltage(), etc correspond to the regulator itself or to its
> > > supplies. E.g. a consumer might have a continuous reg which is
> > > supplied by a discrete reg, in this case _list_voltage() would return
> > > the steps of the supply reg, which is probably not what most consumers
> > > expect.

> > No, this is doesn't make much sense! Why should we be reporting
> > properties of the parent regulator when the child regulator is
> > regulating away all visibility of those properties?

> I am confused whether you are confirming that the current behavior
> makes no sense or if you think that what I'm saying is nonsense.

I'm saying that the current behaviour isn't good and that the
incoherence of what you're proposing should make this clear to you.

> > If it helps think of a continuous regulator as a discrete regulator with
> > a base voltage of 0 and steps of 1uV.

> Thanks, I understood that. What I didn't realize initially is that we
> can avoid iterating through all the voltages if the regulator has
> linear steps, which we can determine with regulator_get_linear_step().
> With that in mind I don't see concerns from the vctrl perspective.

OK, good. I keep meaning to look into retooling all the continuous
regulators to actually be linear regulators to simplify things.

Attachment: signature.asc
Description: PGP signature