regulator: core: Support fixed voltages in regulator_is_supported_voltage()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 2 Jul 2012 14:00:18 +0000 (15:00 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Jul 2012 19:27:58 +0000 (20:27 +0100)
commitc5f3939b8fe0c358d35397982e5afdef112afc81
tree94bff02c8f75418d0b68795bcf3c1ae9c2a51a9c
parent4fe23791a4052ad4c8ba79dab9ff5febc8095714
regulator: core: Support fixed voltages in regulator_is_supported_voltage()

Currently regulator_is_supported_voltage() works by enumerating the set
of voltages which can be set by the regulator but the checks we're doing
to impose constraints mean that if we can't vary the voltage we'll not
report any voltages as supported even though the regulator is actually
set at that voltage.

We could fix the voltage listing but this would mean that list_voltage()
could end up going to the hardware to get the current voltage which isn't
expected (it's supposed to be very cheap) so instead special case things
when we can't change the voltage and compare the requested range against
the current voltage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c