* RFC: Regulator Framework Voltage Setting
@ 2010-06-02 9:18 Linus WALLEIJ
2010-06-02 10:07 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Linus WALLEIJ @ 2010-06-02 9:18 UTC (permalink / raw)
To: Mark Brown, linux-kernel; +Cc: Bengt JONSSON, Sundar R IYER
Hello,
we have a question regarding the regulator_set_voltage function in the
regulator framework (drivers/regulator/core.c). The current
implementation checks the input min and max arguments against the
constraints and then calls the driver set_voltage operation directly
without checking the other consumer requests.
In our view it should respect all consumer voltage settings. Then, the
implementation would (roughly) be to iterate through all consumers and
make sure all of their latest requests are satisfied.
Our questions:
- Is this the correct interpretation of the current functionality?
- Is the proposed behaviour what you would expect?
- Any other problems to consider?
Below we have given an example to clarify.
Best regards,
Bengt JONSSON
Sundar R IYER
Linus WALLEIJ
Here is an example with three users (consumers) connected to the same
regulator_dev:
rdev ------ xreg (User X)
|--- yreg (User Y)
|--- zreg (User Z)
The users call the regulator framework like this:
1. User X calls regulator_set_voltage(xreg, 2000000, 3000000)
2. User Y calls regulator_set_voltage(yreg, 2100000, 3100000)
3. User Z calls regulator_set_voltage(zreg, 1900000, 2900000)
4. User Y calls regulator_set_voltage(yreg, 1900000, 3100000)
5. User Z calls regulator_set_voltage(zreg, 1900000, 3100000)
6. User X calls regulator_set_voltage(xreg, 4000000, 5000000). Here the
call should fail.
Assuming there are no constraints, with current implementation, the
requests would be sent unchanged to the driver. What we would expect
from the regulator framework is this:
1. The framework calls rdev->desc->ops->set_voltage(rdev, 2000000, 3000000)
2. The framework calls rdev->desc->ops->set_voltage(rdev, 2100000, 3000000)
3. The framework calls rdev->desc->ops->set_voltage(rdev, 2100000, 2900000)
4. The framework calls rdev->desc->ops->set_voltage(rdev, 2000000, 2900000)
5. The framework calls rdev->desc->ops->set_voltage(rdev, 2000000, 3000000)
6. Failed because the ranges do not overlap.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFC: Regulator Framework Voltage Setting
2010-06-02 9:18 RFC: Regulator Framework Voltage Setting Linus WALLEIJ
@ 2010-06-02 10:07 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-06-02 10:07 UTC (permalink / raw)
To: Linus WALLEIJ; +Cc: linux-kernel, Bengt JONSSON, Sundar R IYER
On Wed, Jun 02, 2010 at 11:18:00AM +0200, Linus WALLEIJ wrote:
> Our questions:
> - Is this the correct interpretation of the current functionality?
> - Is the proposed behaviour what you would expect?
> - Any other problems to consider?
The current expectation is that a consumer that really needs a voltage
setting will have exclusive use of the regulator and won't share it with
other consumers. There was some support for combining constraints from
multiple consumers originally but it got removed due to requests from
David Brownell (there's not actually much demand for this feature
anyway, finding devices which support but do not required DVS is
actually quite hard and generally the power requirments for shared rails
get fixed at hardware build tiem).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-02 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-02 9:18 RFC: Regulator Framework Voltage Setting Linus WALLEIJ
2010-06-02 10:07 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®