1
0
Fork 0

regulator: bd7181x: skip DVS buck setup if it's not enabled

The DVS buck setup should only be done in case that i2c_dvs_enable is
true.  Otherwise, we should skip it to avoid the following noisy
messages.

  bd7181x-pmic bd7181x-pmic: Buck0: DVS High-Low[0 - 0].
  bd7181x-pmic bd7181x-pmic: bd7181x_buck12_dvs_init(): not found selector for voltage [0]
  bd7181x-pmic bd7181x-pmic: bd7181x_buck12_dvs_init(): not found selector for voltage [0]

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
pull/10/head
Shawn Guo 2019-08-04 17:24:52 +02:00 committed by Steinar Bakkemo
parent 025677441b
commit 77bb1a30e6
1 changed files with 5 additions and 4 deletions

View File

@ -620,13 +620,14 @@ static int bd7181x_buck12_dvs_init(struct bd7181x_pmic *pmic)
u8 regh, regl;
for(i = 0; i < BD7181X_DVS_BUCK_NUM; i++, buck_dvs++) {
if (!buck_dvs->i2c_dvs_enable)
continue;
regh = BD7181X_REG_BUCK1_VOLT_H + i*0x2;
regl = BD7181X_REG_BUCK1_VOLT_L + i*0x2;
val = BUCK1_DVSSEL;
if(buck_dvs->i2c_dvs_enable) {
dev_info(pmic->dev, "Buck%d: I2C DVS Enabled !\n", i);
val &= ~BUCK1_STBY_DVS;
}
dev_info(pmic->dev, "Buck%d: I2C DVS Enabled !\n", i);
val &= ~BUCK1_STBY_DVS;
dev_info(pmic->dev, "Buck%d: DVS High-Low[%d - %d].\n", i, buck_dvs->voltage[0], buck_dvs->voltage[1]);
selector = regulator_map_voltage_iterate(pmic->rdev[i], buck_dvs->voltage[0], buck_dvs->voltage[0]);
if(selector < 0) {