lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch/rfc 2.6.29-rc6 1/2] regulator: enumerate voltages
Date
On Wednesday 25 February 2009, Mark Brown wrote:
> >       get_voltage() {
> >               read selector from hardware
> >               map selector to voltage
> >               return that voltage
> >       }
>
> > So it's trivial for similar code to take the selector as
> > a function parameter, and do the same thing.  Repackage
> > the existing code a bit; bzzt, done!
>
> Yes, that's a reasonable point (though I'd still like to see the maximum
> turn into a static value now I think about it).

At the regulator_desc level, that's trivial; I'll do that
in the patch you'll see.

In terms of the consumer interface, not -- "struct regulator"
is opaque to consumers, and everything is a functional accessor.
So I'll leave that as-is.


> > It will be fairly common for the regulator to support voltages
> > that are disallowed by the machine constraints, though.  That
> > can produce "holes" too; and not necessarily only for the lowest
> > or highest selector codes.
>
> At present only continous ranges are possible, though.  I can't think of
> any systems I've seen that'd want discontinous constraints, though I'm
> sure there are some.

Consider a regulator where voltage selectors 0..3 correspond to
voltages

{ 3.3V, 1.8V, 4.2V, 5.0V }

With machine constraints that say voltages go from 3V to 4.5V ...

- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-02-26 00:51    [W:0.118 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site