From: 张晴 Date: Mon, 30 Jul 2012 06:27:28 +0000 (+0800) Subject: rk30:sdk:modify regulator_set_voltage process X-Git-Tag: firefly_0821_release~8959 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5419bd8a51579c45a5ab89861ff39ec671e4a0ac;p=firefly-linux-kernel-4.4.55.git rk30:sdk:modify regulator_set_voltage process --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 19cfa94c3df5..fc8c1c3c11c2 100755 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1779,6 +1779,19 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) ret = _regulator_do_set_voltage(rdev, min_uV, max_uV); + if (ret < 0) { + int ret_volt = 0; + msleep(1); + ret_volt = _regulator_get_voltage(rdev); + if (ret_volt == regulator->max_uV) { + ret = 0; + } else { + regulator->min_uV = 0; + regulator->max_uV = 0; + ret = -1; + } + } + out: mutex_unlock(&rdev->mutex); return ret;