]> git.karo-electronics.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)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:18 +0000 (09:54 +0800)
commit6238c199ced8f61f681c26bf8b943d25848b5cd9
treec1ed67cf9e498de9659b2aa7da3dcd86c8330676
parent9167981760ad9c42d4db4b1ec64c9a4b207a6126
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