From 5419bd8a51579c45a5ab89861ff39ec671e4a0ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Mon, 30 Jul 2012 14:27:28 +0800 Subject: [PATCH] rk30:sdk:modify regulator_set_voltage process --- drivers/regulator/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; -- 2.34.1