regulator: arizona-micsupp: Fix choosing selector in arizona_micsupp_map_voltage
authorAxel Lin <axel.lin@gmail.com>
Tue, 26 Jun 2012 10:37:58 +0000 (18:37 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 26 Jun 2012 10:48:05 +0000 (11:48 +0100)
commit7f217d36dce7e3e2789cfbd91ae53a36a98df837
tree430d07b77f4f53e92d2fc64942b13f18c1d47e99
parent1910efa1d0fdf8109b285d4486f6a0de810b5574
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>
drivers/regulator/arizona-micsupp.c
This page took 0.024278 seconds and 5 git commands to generate.