]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
regulator: pfuze100: Simplify pfuze100_set_ramp_delay implementation
authorAxel Lin <axel.lin@ingics.com>
Tue, 30 Jul 2013 14:47:44 +0000 (22:47 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 31 Jul 2013 16:53:46 +0000 (17:53 +0100)
commite56566699ca64ec44dd134ec5310a3585ffacfec
treedb37fc92b7e218247012e0e0960db548aa5086de
parentd9493234e20e8153495fa118b60bdff22fdfc6c8
regulator: pfuze100: Simplify pfuze100_set_ramp_delay implementation

Simplify the equation to calculate ramp_delay.
Below equations are equivalent:
  ramp_delay = 25000 / (2 * ramp_delay);
  ramp_delay = 50000 / (4 * ramp_delay);
  ramp_delay = 25000 / (2 * ramp_delay);
  ramp_delay = 12500 / ramp_delay;
So we don't need to read BIT6 of rdev->desc->vsel_reg for applying different
equations.

Also use rdev->desc->vsel_reg instead of run-time calculate register address.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/pfuze100-regulator.c