mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 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

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®