aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/virtual.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
index 5c1d75662b82..144110788fd2 100644
--- a/drivers/regulator/virtual.c
+++ b/drivers/regulator/virtual.c
@@ -34,6 +34,8 @@ static void update_voltage_constraints(struct device *dev,
34 34
35 if (data->min_uV && data->max_uV 35 if (data->min_uV && data->max_uV
36 && data->min_uV <= data->max_uV) { 36 && data->min_uV <= data->max_uV) {
37 dev_dbg(dev, "Requesting %d-%duV\n",
38 data->min_uV, data->max_uV);
37 ret = regulator_set_voltage(data->regulator, 39 ret = regulator_set_voltage(data->regulator,
38 data->min_uV, data->max_uV); 40 data->min_uV, data->max_uV);
39 if (ret != 0) { 41 if (ret != 0) {
@@ -44,6 +46,7 @@ static void update_voltage_constraints(struct device *dev,
44 } 46 }
45 47
46 if (data->min_uV && data->max_uV && !data->enabled) { 48 if (data->min_uV && data->max_uV && !data->enabled) {
49 dev_dbg(dev, "Enabling regulator\n");
47 ret = regulator_enable(data->regulator); 50 ret = regulator_enable(data->regulator);
48 if (ret == 0) 51 if (ret == 0)
49 data->enabled = 1; 52 data->enabled = 1;
@@ -53,6 +56,7 @@ static void update_voltage_constraints(struct device *dev,
53 } 56 }
54 57
55 if (!(data->min_uV && data->max_uV) && data->enabled) { 58 if (!(data->min_uV && data->max_uV) && data->enabled) {
59 dev_dbg(dev, "Disabling regulator\n");
56 ret = regulator_disable(data->regulator); 60 ret = regulator_disable(data->regulator);
57 if (ret == 0) 61 if (ret == 0)
58 data->enabled = 0; 62 data->enabled = 0;
@@ -69,6 +73,8 @@ static void update_current_limit_constraints(struct device *dev,
69 73
70 if (data->max_uA 74 if (data->max_uA
71 && data->min_uA <= data->max_uA) { 75 && data->min_uA <= data->max_uA) {
76 dev_dbg(dev, "Requesting %d-%duA\n",
77 data->min_uA, data->max_uA);
72 ret = regulator_set_current_limit(data->regulator, 78 ret = regulator_set_current_limit(data->regulator,
73 data->min_uA, data->max_uA); 79 data->min_uA, data->max_uA);
74 if (ret != 0) { 80 if (ret != 0) {
@@ -80,6 +86,7 @@ static void update_current_limit_constraints(struct device *dev,
80 } 86 }
81 87
82 if (data->max_uA && !data->enabled) { 88 if (data->max_uA && !data->enabled) {
89 dev_dbg(dev, "Enabling regulator\n");
83 ret = regulator_enable(data->regulator); 90 ret = regulator_enable(data->regulator);
84 if (ret == 0) 91 if (ret == 0)
85 data->enabled = 1; 92 data->enabled = 1;
@@ -89,6 +96,7 @@ static void update_current_limit_constraints(struct device *dev,
89 } 96 }
90 97
91 if (!(data->min_uA && data->max_uA) && data->enabled) { 98 if (!(data->min_uA && data->max_uA) && data->enabled) {
99 dev_dbg(dev, "Disabling regulator\n");
92 ret = regulator_disable(data->regulator); 100 ret = regulator_disable(data->regulator);
93 if (ret == 0) 101 if (ret == 0)
94 data->enabled = 0; 102 data->enabled = 0;