summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2013-12-17 14:23:17 +0100
committerMark Brown <broonie@linaro.org>2013-12-18 13:27:40 +0000
commitf37ff6b6ab9bff6f78dbfbdd123673a09e04cb7f (patch)
tree59b2d4b70ba3d65139ba46cf2e1c989b250f60ba /drivers/regulator
parent463616ea3f4c4ff27019ffcf8f09a25712c1f4c1 (diff)
downloadblackbird-op-linux-f37ff6b6ab9bff6f78dbfbdd123673a09e04cb7f.tar.gz
blackbird-op-linux-f37ff6b6ab9bff6f78dbfbdd123673a09e04cb7f.zip
regulator: s5m8767: Add symbols for hard-coded DVS_RAMP register
Add symbols for hard-coded values of BUCK_RAMP field in DVS_RAMP register. This simplifies a little the code as register update is called only once. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/s5m8767.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 9b14faa3bf91..27741df28ad7 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -881,31 +881,29 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
if (s5m8767->buck2_ramp || s5m8767->buck3_ramp
|| s5m8767->buck4_ramp) {
+ unsigned int val;
switch (s5m8767->ramp_delay) {
case 5:
- sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0x40, 0xf0);
+ val = S5M8767_DVS_BUCK_RAMP_5;
break;
case 10:
- sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0x90, 0xf0);
+ val = S5M8767_DVS_BUCK_RAMP_10;
break;
case 25:
- sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0xd0, 0xf0);
+ val = S5M8767_DVS_BUCK_RAMP_25;
break;
case 50:
- sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0xe0, 0xf0);
+ val = S5M8767_DVS_BUCK_RAMP_50;
break;
case 100:
- sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0xf0, 0xf0);
+ val = S5M8767_DVS_BUCK_RAMP_100;
break;
default:
- sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0x90, 0xf0);
+ val = S5M8767_DVS_BUCK_RAMP_10;
}
+ sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
+ val << S5M8767_DVS_BUCK_RAMP_SHIFT,
+ S5M8767_DVS_BUCK_RAMP_MASK);
}
for (i = 0; i < pdata->num_regulators; i++) {
OpenPOWER on IntegriCloud