]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regulator: mc13892: Simplify implementation of mc13892_sw_regulator_set_voltage_sel()
authorAxel Lin <axel.lin@gmail.com>
Thu, 19 Jul 2012 07:10:31 +0000 (15:10 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 3 Aug 2012 22:21:29 +0000 (23:21 +0100)
commitc80df0baf409df5dca72e3ab5afe0e5795643df9
tree8b8068ba4a47f307971860773271570535785f94
parent49582a40d7b3a6f703a2b4212f16df48f556157b
regulator: mc13892: Simplify implementation of mc13892_sw_regulator_set_voltage_sel()

Use mc13xxx_reg_rmw rather than a mc13xxx_reg_read and a mc13xxx_reg_write calls.

This logic to set MC13892_SWITCHERS0_SWxHI bit is pretty simple:

if (volt > 1375000)
        set MC13892_SWITCHERS0_SWxHI bit
else if (volt < 1100000)
        clear MC13892_SWITCHERS0_SWxHI bit
else
        leave MC13892_SWITCHERS0_SWxHI bit untouched

We already know the selector, so we don't need to calculate the selector again.

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