• Matti Vaittinen's avatar
    regulator: bd718x7: Support external connection to scale voltages · d2ad9811
    Matti Vaittinen authored
    Setups where regulator (especially the buck8) output voltage is scaled
    by adding external connection where some other regulator output is
    connected to feedback-pin (over suitable resistors) is getting popular
    amongst users of BD71837. This allows for example scaling down the
    buck8 voltages to suit lover GPU voltages for projects where buck8 is
    (ab)used to supply power for GPU. As a note - some setups do allow DVS
    for buck8. This do produce voltage spikes and the HW must be evaluated
    to be able to survive them. Thus this commit still keep the DVS disabled
    for non DVS bucks by default. Let's not help you burn your proto board.
    
    Allow describing this external connection from DT and scale the
    voltages accordingly. This is what the connection should look like:
    
    |------------|
    |    buck 8  |-------+----->Vout
    |            |       |
    |------------|       |
         | FB pin        |
         |               |
         +-------+--R2---+
                 |
                 R1
                 |
         V FB-pull-up
    
         Here the buck output is sifted according to formula:
    
    Vout_o = Vo - (Vpu - Vo)*R2/R1
    Linear_step = step_orig*(R1+R2)/R1
    
    where:
    Vout_o is adjusted voltage output at vsel reg value 0
    Vo is original voltage output at vsel reg value 0
    Vpu is the pull-up voltage V FB-pull-up in the picture
    R1 and R2 are resistor values.
    
    Bring support for specifying the Vpu, R1 and R2 from device tree and
    scale voltages if they are given.
    Signed-off-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
    Link: https://lore.kernel.org/r/89b2be87074f307a8823f15f34e1f662023cbf36.1604994184.git.matti.vaittinen@fi.rohmeurope.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    d2ad9811
bd718x7-regulator.c 48.5 KB