]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regulator: twl: Fix checking voltage range in twl6030smps_set_voltage()
authorAxel Lin <axel.lin@gmail.com>
Sat, 14 Jul 2012 05:37:13 +0000 (13:37 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 3 Aug 2012 22:21:27 +0000 (23:21 +0100)
commitc1ecdf65eb5e1daf8969a817f0610d89de76e65e
treead36eaa90645c1557507b23de8d5752a63d17e16
parent7a3d1151a4828e2562ee263ddf39c2399b271cca
regulator: twl: Fix checking voltage range in twl6030smps_set_voltage()

The voltage selection logic is supposed to find the samllest voltage falls
within specified range. When using equation to calculate vsel, we need to
ensure the requested min_uV meet the range of using the equation.
Otherwise we may select a voltage that is out of specified range.

For example, in the case vsel = 62 means select voltage of 2100000uV.
What we want is to ensure the requested min_uV <= 2100000 rather than checking
max_uV >= 2100000. And this also means in the case min_uV > 2100000, vsel = 62
does not meet the request.

Also calling twl6030smps_list_voltage() for all cases to ensure the selected
voltage still in bounds.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/twl-regulator.c