projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50762b5
)
rk30:sdk:modify regulator_set_voltage process
author
张晴
<zhangqing@rock-chips.com>
Mon, 30 Jul 2012 06:27:28 +0000
(14:27 +0800)
committer
张晴
<zhangqing@rock-chips.com>
Mon, 30 Jul 2012 06:27:28 +0000
(14:27 +0800)
drivers/regulator/core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index 19cfa94c3df5b57e850f865b776240045344afbc..fc8c1c3c11c2fc332fc063f21814f0308e9a91a9 100755
(executable)
--- 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;