diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-06-26 12:37:58 +0200 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-26 12:48:05 +0200 |
commit | 7f217d36dce7e3e2789cfbd91ae53a36a98df837 (patch) | |
tree | 430d07b77f4f53e92d2fc64942b13f18c1d47e99 /drivers | |
parent | regulator: Add driver for Arizona LDO1 (diff) | |
download | linux-7f217d36dce7e3e2789cfbd91ae53a36a98df837.tar.xz linux-7f217d36dce7e3e2789cfbd91ae53a36a98df837.zip |
regulator: arizona-micsupp: Fix choosing selector in arizona_micsupp_map_voltage
If min_uV is in the range of: 3250001~3269999,
current code uses the equation:
selector = DIV_ROUND_UP(min_uV - 1700000, 50000);
Then selector will be 32.
Then arizona_micsupp_list_voltage returns -EINVAL for this case which is wrong.
This patch fixes this issue:
If min_uV > 3200000, selector should be ARIZONA_MICSUPP_MAX_SELECTOR.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/arizona-micsupp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c index 97d85b09a940..fdd7473ada4a 100644 --- a/drivers/regulator/arizona-micsupp.c +++ b/drivers/regulator/arizona-micsupp.c @@ -57,7 +57,7 @@ static int arizona_micsupp_map_voltage(struct regulator_dev *rdev, if (min_uV < 1700000) min_uV = 1700000; - if (min_uV >= 3300000) + if (min_uV > 3200000) selector = ARIZONA_MICSUPP_MAX_SELECTOR; else selector = DIV_ROUND_UP(min_uV - 1700000, 50000); |