regulator: twl: Fix list_voltate for twl6030ldo_ops
authorAxel Lin <axel.lin@gmail.com>
Mon, 16 Jul 2012 10:31:10 +0000 (18:31 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 16 Jul 2012 19:58:02 +0000 (20:58 +0100)
commitc6a717c9d740ec8f5bd134ac8c75b1b7c0666ff8
treeca8dd6ad44b9651eb5646b1bd6645c5b1526941b
parent4bcb9f43426dcb7b326d4b5448f198eea4867e63
regulator: twl: Fix list_voltate for twl6030ldo_ops

According to the datasheet, the voltage for twl6030ldo_ops is not linear for
all cases. Linear mapping is only for the selection code from
00000001 to 00011000.

Table 9. LDO Output Voltage Selection Code
CODE     VOUT(V)    COD      VOUT(V)    CODE     VOUT(V)    CODE     VOUT(V)
00000000 0          00001000 1.7        00010000 2.5        00011000 3.3
00000001 1.0        00001001 1.8        00010001 2.6        00011001 Reserved
00000010 1.1        00001010 1.9        00010010 2.7        00011010 Reserved
00000011 1.2        00001011 2.0        00010011 2.8        00011011 Reserved
00000100 1.3        00001100 2.1        00010100 2.9        00011100 Reserved
00000101 1.4        00001101 2.2        00010101 3.0        00011101 Reserved
00000110 1.5        00001110 2.3        00010110 3.1        00011110 Reserved
00000111 1.6        00001111 2.4        00010111 3.2        00011111 2.75

This patch implements the list_voltage callback based on above table.

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