• Axel Lin's avatar
    regulator: as3711: Convert to use linear ranges · 9234c636
    Axel Lin authored
    The SD, ALDO, and DLDO vlotage tables are composed of linear ranges.
    This patch converts as3711 to use newly introduced helpers for multiple
    linear ranges.
    
    Below is the voltage table on datasheet:
    
    SD:
    00h:     DC/DC powered down
    01h-40h: Volt = 0.6V + sdx_vsel * 12.5mV
    41h-70h: Volt = 1.4V + (sdx_vsel - 40h) * 25mV
    71h-7Fh: Volt = 2.6V + (sdx_vsel - 70h) * 50mV
    
    ALDO:
    0h-0Fh:  1.2V + ldox_vsel * 50mV
    10h-1Fh: 1.8V + (ldox_vsel - 10h) * 100mV
    
    DLDO:
    00h-10h: Volt = 0.9V + ldox_vsel * 50mV
    11h-1fh: Do not use
    20h-3fh: Volt = 1.75V + (ldox_vsel - 20h) * 50mV
    
    Note, when convert to use linear ranges APIs, the equation for SD needs below
    adjustment because the linear ranges APIs wiil substract range->min_sel when
    apply the equation.
    
    SD ( the equation to be used with linear ranges APIs )
    01h-40h: Volt = 0.6125V + (sdx_vsel - 1h) * 12.5mV
    41h-70h: Volt = 1.425V + (sdx_vsel - 41h) * 25mV
    71h-7Fh: Volt = 2.650V + (sdx_vsel - 71h) * 50mV
    Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
    Signed-off-by: default avatarMark Brown <broonie@linaro.org>
    9234c636
as3711-regulator.c 9.81 KB