regulator: palmas: Return raw register values as the selectors in [get|set]_voltage_sel
authorAxel Lin <axel.lin@ingics.com>
Thu, 29 Nov 2012 01:59:16 +0000 (09:59 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 6 Dec 2012 06:20:52 +0000 (15:20 +0900)
commitad02e846878ca35e9d3fa584be8ee770e9e14fce
tree03a914da8f56bc17a7dd34c2a4a7c3375421c92d
parent9489e9dcae718d5fde988e4a684a0f55b5f94d17
regulator: palmas: Return raw register values as the selectors in [get|set]_voltage_sel

Don't adjust the selector in [get|set]_voltage_sel, fix it in list_voltage() instead.

For smps*(except smps10), the vsel reg-value and voltage mapping as below:

reg-value       volt (uV) ( Assume RANGE is x1 )
0               0
1               500000
2               500000
3               500000
4               500000
5               500000
6               500000 (0.49V + 1 * 0.01V) * RANGE
7               510000 (0.49V + 2 * 0.01V) * RANGE
8               520000 (0.49V + 3 * 0.01V) * RANGE
9               530000 (0.49V + 4 * 0.01V) * RANGE
....

The linear mapping is start from selector 6.

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