On Thu, Jun 02, 2016 at 11:23:14AM +0100, Srinivas Kandagatla wrote:Yep, you are right, I should have looked into _regulator_list_voltage() in more carefully, it already has this check in place.
Regulator drivers can have linear range which is according to the
regualtor hardware spec, however the board level device tree files
can restrict this range by adding constriants.
These constriants are not considered in the exsiting code, which
gives false supported voltage range to the consumers.
For now I have added this support for regulator_list_voltage_linear_range()
If it makes sense we can extend this to other list voltage helpers too.
Why are you making this change? The obvious problem here is that drivers
should not be looking at constraints - it would be silly to duplicate
constraint enforcing code in individual drivers and would lead to
inconsistent performance of constraints. This is why we do this in the
core, in _regulator_list_voltage(),