2009-01-10 15:27:57

by Jonathan Cameron

[permalink] [raw]
Subject: Regulator: Use case query (many devices need to reg their voltage requirements?)

Dear All,

A quick request for comments w.r.t. specifying voltage requirements
of drivers that do not need to dynamically change their supply voltage.

Obviously for a given embedded system, it is possible to work out on
paper what regulator configuration works for all components connected to
a particular regulator as long as these connections are static.

A number of different embedded system now use main boards (core etc) in
conjunction with daughter boards. In these cases different modules may
be inserted to support different daughter board options from a single kernel
(and combinations if possible). Thus we have a situation in which the
appropriate voltage level can only be established if the various drivers
specify what they need. The board config may specify numerous devices
only some of which may actually be present.

This leads to additional complexity in numerous drivers as they have to act
as dynamic drivers (terminology from regulator docs) even though they don't
actually vary the voltage, merely specify what ranges they can work with.

Is this the best way to handle this situation, or do people have other
suggestions?

Thanks

Jonathan Cameron


2009-01-10 17:46:30

by Mark Brown

[permalink] [raw]
Subject: Re: Regulator: Use case query (many devices need to reg their voltage requirements?)

On Sat, Jan 10, 2009 at 03:27:48PM +0000, Jonathan Cameron wrote:

> A number of different embedded system now use main boards (core etc) in
> conjunction with daughter boards. In these cases different modules may
> be inserted to support different daughter board options from a single kernel
> (and combinations if possible). Thus we have a situation in which the
> appropriate voltage level can only be established if the various drivers
> specify what they need. The board config may specify numerous devices
> only some of which may actually be present.

The wide range of plug in and subfit options isn't that unusual.
There's quite a few modular reference designs out there, including
designs where the power module is replacable.

When I've considered this in the context of designs I've worked on in
the past I've always thought it would be easiest to represent the plug
in modules in the device tree with the main board regulators being set
up to know only about the supplies they provide to the board. The plug
in boards could then map how those supplies are distributed within the
boards, using virtual regulators to pass through the supplies from the
main board and being able to supply board-wide requirements for the
design.

I've not actually tried doing this so I've not had a chance to run into
any practical problems with it yet, and I'm not sure how well it maps
onto your system.

> This leads to additional complexity in numerous drivers as they have to act
> as dynamic drivers (terminology from regulator docs) even though they don't
> actually vary the voltage, merely specify what ranges they can work with.

For simple cases it's only one function call, though power requirements
often depend on other system considerations such as clock rates and
analogue design. There will also be issues if the drivers are for chips
which have multiple software compatible variants with differing power
requirements.

> Is this the best way to handle this situation, or do people have other
> suggestions?

Does the above idea work for you?

2009-01-10 18:05:35

by Jonathan Cameron

[permalink] [raw]
Subject: Re: Regulator: Use case query (many devices need to reg their voltage requirements?)

Hi Mark,
>
>> A number of different embedded system now use main boards (core etc) in
>> conjunction with daughter boards. In these cases different modules may
>> be inserted to support different daughter board options from a single kernel
>> (and combinations if possible). Thus we have a situation in which the
>> appropriate voltage level can only be established if the various drivers
>> specify what they need. The board config may specify numerous devices
>> only some of which may actually be present.
>>
>
> The wide range of plug in and subfit options isn't that unusual.
> There's quite a few modular reference designs out there, including
> designs where the power module is replacable.
>
> When I've considered this in the context of designs I've worked on in
> the past I've always thought it would be easiest to represent the plug
> in modules in the device tree with the main board regulators being set
> up to know only about the supplies they provide to the board. The plug
> in boards could then map how those supplies are distributed within the
> boards, using virtual regulators to pass through the supplies from the
> main board and being able to supply board-wide requirements for the
> design.
>
That's sounds like a sensible approach, though not entirely sure how it
will work out in
practice. Guess there is only one way to find out!
> I've not actually tried doing this so I've not had a chance to run into
> any practical problems with it yet, and I'm not sure how well it maps
> onto your system.
>
It maps fine, particularly as quite a few daughter boards have local (be
it static)
regulators to ensure clean supplies etc.
>> This leads to additional complexity in numerous drivers as they have to act
>> as dynamic drivers (terminology from regulator docs) even though they don't
>> actually vary the voltage, merely specify what ranges they can work with.
>>
>
> For simple cases it's only one function call, though power requirements
> often depend on other system considerations such as clock rates and
> analogue design.
Sure, I guess in cases where the requirements are board specific rather
than driven by the chip, some
means of overriding the defaults may be necessary. Not something that
we will want to add to drivers
unless actually needed.
> There will also be issues if the drivers are for chips
> which have multiple software compatible variants with differing power
> requirements.
>
Yup, though in many cases they have different part numbers etc and can
be handled via multiple
driver registrations or alias provisions such as in i2c. This is how
things like adc's with differing
numbers of inputs depending on precise model are handled anyway.
>
>> Is this the best way to handle this situation, or do people have other
>> suggestions?
>>
>
> Does the above idea work for you?
>

I think so. Guess it's going to be a case of trying out an example and
seeing how it goes.

Thanks,

Jonathan

2009-01-10 18:58:49

by Mark Brown

[permalink] [raw]
Subject: Re: Regulator: Use case query (many devices need to reg their voltage requirements?)

On Sat, Jan 10, 2009 at 06:05:25PM +0000, Jonathan Cameron wrote:

> It maps fine, particularly as quite a few daughter boards have local (be
> it static)
> regulators to ensure clean supplies etc.

Note that there's a fixed voltage regulator driver in the tree for
handling those.

> > There will also be issues if the drivers are for chips
> > which have multiple software compatible variants with differing power
> > requirements.

> Yup, though in many cases they have different part numbers etc and can
> be handled via multiple
> driver registrations or alias provisions such as in i2c. This is how
> things like adc's with differing
> numbers of inputs depending on precise model are handled anyway.

That is doable but error prone, especially if doing something like
adding regulator support to an existing driver or when new parts come
out. Often the part numbers are only slight different (adding an
additional letter at the end of the day) which doesn't help.