regulator: pcf50633: Use linear_min_sel and regulator_[map|list]_voltage_linear
authorAxel Lin <axel.lin@ingics.com>
Wed, 28 Nov 2012 02:41:04 +0000 (10:41 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Nov 2012 19:21:00 +0000 (19:21 +0000)
commit05cf34c1af48e2e1308a03fbc778039243bebd3a
treed9b041473e6fd6a3b94ba5e1d870cf8d162b622d
parent6b1f8a45666877d4885c03d9472657fd73edfa8b
regulator: pcf50633: Use linear_min_sel and regulator_[map|list]_voltage_linear

This driver can be converted to use linear_min_sel and
regulator_[map|list]_voltage_linear.

Below shows the equation (from Datasheet) for each LDOs.

For AUTOOUT:
        VO(prog) = 0.625 + auto_out x 0.025 V; e.g.
        (00000000 to 00101110: reserved)
        00101111: 1.8 V (min)
        01010011: 2.7 V
        01101010: 3.275 V
        01101011: 3.300 V
        01101100: 3.325 V
        01111111 : 3.800 V (max)

        The linear mapping start from 0x2f selector.

        Thus we convert this equation to:
        VO(prog) = 1.8 + (selector - linear_min_sel) x 0.025 V
        (min_uV = 1800000, uV_step = 25000, linear_min_sel = 0x2f)

For DOWNxOUT:
        VO(prog) = 0.625 + downx_out x 0.025 V; e.g.
        00000000 : 0.625 V (min)
        00010111 : 1.200 V
        00101111 : 1.800 V
        01011111 : 3.000 V (max)

For xLDOOUT:
        VO(prog) = 0.9 + xldo_out x 0.1 V; e.g.
        00000: 0.9 V
        00001: 1.0 V
        11000 : 3.3 V
        11011 : 3.6 V

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