diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2012-11-23 03:03:13 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-24 12:56:32 -0500 |
commit | 11ec7bf001e7bfd37f244042032e15dac2c301bc (patch) | |
tree | 1aa99ecea43bce6def8365844aa9a97ab86d3b2d /drivers/regulator/max8997.c | |
parent | f4a75d2eb7b1e2206094b901be09adb31ba63681 (diff) |
regulator: max8997: reorder buck1/2/5 dvs setup code
The BUCKxDVSx register programming is now moved prior to setting up of the
gpio based dvs mode. This will ensure that all the BUCKxDVSx registers
are programmed with appropriate voltage values before the gpio based dvs
mode is selected for buck1/2/5.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/max8997.c')
-rw-r--r-- | drivers/regulator/max8997.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index e39a0c7260dc..04d9f29503ad 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -1019,6 +1019,19 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1019 | max_buck5, 0x3f); | 1019 | max_buck5, 0x3f); |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | /* Initialize all the DVS related BUCK registers */ | ||
1023 | for (i = 0; i < 8; i++) { | ||
1024 | max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i, | ||
1025 | max8997->buck1_vol[i], | ||
1026 | 0x3f); | ||
1027 | max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i, | ||
1028 | max8997->buck2_vol[i], | ||
1029 | 0x3f); | ||
1030 | max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i, | ||
1031 | max8997->buck5_vol[i], | ||
1032 | 0x3f); | ||
1033 | } | ||
1034 | |||
1022 | /* | 1035 | /* |
1023 | * If buck 1, 2, and 5 do not care DVS GPIO settings, ignore them. | 1036 | * If buck 1, 2, and 5 do not care DVS GPIO settings, ignore them. |
1024 | * If at least one of them cares, set gpios. | 1037 | * If at least one of them cares, set gpios. |
@@ -1068,19 +1081,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1068 | max8997_update_reg(i2c, MAX8997_REG_BUCK5CTRL, (pdata->buck5_gpiodvs) ? | 1081 | max8997_update_reg(i2c, MAX8997_REG_BUCK5CTRL, (pdata->buck5_gpiodvs) ? |
1069 | (1 << 1) : (0 << 1), 1 << 1); | 1082 | (1 << 1) : (0 << 1), 1 << 1); |
1070 | 1083 | ||
1071 | /* Initialize all the DVS related BUCK registers */ | ||
1072 | for (i = 0; i < 8; i++) { | ||
1073 | max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i, | ||
1074 | max8997->buck1_vol[i], | ||
1075 | 0x3f); | ||
1076 | max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i, | ||
1077 | max8997->buck2_vol[i], | ||
1078 | 0x3f); | ||
1079 | max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i, | ||
1080 | max8997->buck5_vol[i], | ||
1081 | 0x3f); | ||
1082 | } | ||
1083 | |||
1084 | /* Misc Settings */ | 1084 | /* Misc Settings */ |
1085 | max8997->ramp_delay = 10; /* set 10mV/us, which is the default */ | 1085 | max8997->ramp_delay = 10; /* set 10mV/us, which is the default */ |
1086 | max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9); | 1086 | max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9); |