]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regulator: max8997: Use uV in voltage_map_desc
authorAxel Lin <axel.lin@ingics.com>
Fri, 28 Dec 2012 09:09:03 +0000 (17:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:46:39 +0000 (08:46 -0800)
commite25286fe7b20849d6e3b447d513b16a1423a76ef
treec9082afc8274c7c022400aa436aa17612cd5c6bc
parent8a935b4ad29d83731572f0eb10f033fee45ae2e3
regulator: max8997: Use uV in voltage_map_desc

commit bc3b7756b5ff66828acf7bc24f148d28b8d61108 upstream.

Current code does integer division (min_vol = min_uV / 1000) before pass
min_vol to max8997_get_voltage_proper_val().
So it is possible min_vol is truncated to a smaller value.

For example, if the request min_uV is 800900 for ldo.
min_vol = 800900 / 1000 = 800 (mV)
Then max8997_get_voltage_proper_val returns 800 mV for this case which is lower
than the requested voltage.

Use uV rather than mV in voltage_map_desc to prevent truncation by integer
division.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/max8997.c