regulator: gpio-regulator: Split setting of voltages and currents
authorHeiko Stübner <heiko@sntech.de>
Tue, 7 Aug 2012 22:50:19 +0000 (00:50 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 8 Aug 2012 11:16:06 +0000 (12:16 +0100)
commiteb0c5686b3c6332892b3eb5d8bb9eb04f943cb25
tree982bd81ae8d81791df1ebddb38b441e1d2473c65
parentcfa9cfbc083c7fc882286dcfba59c7e5a1a15545
regulator: gpio-regulator: Split setting of voltages and currents

Originally gpio-regulator used the first item of its state list
that matched the given voltage or current range.

Commit 4dbd8f63f0 (regulator: gpio-regulator: Set the smallest voltage/current
in the specified range) changed this, to make the selection independent of
the ordering of the state list.

But selecting the minimal value is only true for voltage regulators.
For current regulators the maximum in the given range should be
selected instead.

Therefore split the previous common selection function into specific
functions for voltage and current regulators.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/gpio-regulator.c