regulator: core: Allow to get voltage count and list from parent
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Tue, 29 Jul 2014 16:28:56 +0000 (18:28 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 29 Jul 2014 18:24:43 +0000 (19:24 +0100)
commit26988efe11b1dc44853035122927ced25578f302
tree50cc6c35a8c9d853f27a2ca2c38704ee24c5c2e2
parente303996e94b8705c85f3d78f3c094d05b0620c9d
regulator: core: Allow to get voltage count and list from parent

Load switches are modeled as regulators but they just provide
the voltage of their parent input supply. So, the drivers for
these switches usually neither provide a .list_voltage handler
not set a .n_voltages count. But there is code in the kernel
that assumes that all regulators should be able to provide this
information (e.g: cpufreq and mmc subsystems).

If the voltage count and list are not available for a regulator
and it has a parent input supply, then use the parent values.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/core.c