aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/s5m8767.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2013-12-17 08:23:17 -0500
committerMark Brown <broonie@linaro.org>2013-12-18 08:27:40 -0500
commitf37ff6b6ab9bff6f78dbfbdd123673a09e04cb7f (patch)
tree59b2d4b70ba3d65139ba46cf2e1c989b250f60ba /drivers/regulator/s5m8767.c
parent463616ea3f4c4ff27019ffcf8f09a25712c1f4c1 (diff)
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/s5m8767.c')
-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)
881 881
882 if (s5m8767->buck2_ramp || s5m8767->buck3_ramp 882 if (s5m8767->buck2_ramp || s5m8767->buck3_ramp
883 || s5m8767->buck4_ramp) { 883 || s5m8767->buck4_ramp) {
884 unsigned int val;
884 switch (s5m8767->ramp_delay) { 885 switch (s5m8767->ramp_delay) {
885 case 5: 886 case 5:
886 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 887 val = S5M8767_DVS_BUCK_RAMP_5;
887 0x40, 0xf0);
888 break; 888 break;
889 case 10: 889 case 10:
890 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 890 val = S5M8767_DVS_BUCK_RAMP_10;
891 0x90, 0xf0);
892 break; 891 break;
893 case 25: 892 case 25:
894 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 893 val = S5M8767_DVS_BUCK_RAMP_25;
895 0xd0, 0xf0);
896 break; 894 break;
897 case 50: 895 case 50:
898 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 896 val = S5M8767_DVS_BUCK_RAMP_50;
899 0xe0, 0xf0);
900 break; 897 break;
901 case 100: 898 case 100:
902 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 899 val = S5M8767_DVS_BUCK_RAMP_100;
903 0xf0, 0xf0);
904 break; 900 break;
905 default: 901 default:
906 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP, 902 val = S5M8767_DVS_BUCK_RAMP_10;
907 0x90, 0xf0);
908 } 903 }
904 sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
905 val << S5M8767_DVS_BUCK_RAMP_SHIFT,
906 S5M8767_DVS_BUCK_RAMP_MASK);
909 } 907 }
910 908
911 for (i = 0; i < pdata->num_regulators; i++) { 909 for (i = 0; i < pdata->num_regulators; i++) {