Skip to content

Commit

Permalink
regulator: Make virtual consumer a bit more chatty
Browse files Browse the repository at this point in the history
This makes it easier to read the logs when doing testing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Sep 22, 2009
1 parent a07ac21 commit a5d2abc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/regulator/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ static void update_voltage_constraints(struct device *dev,

if (data->min_uV && data->max_uV
&& data->min_uV <= data->max_uV) {
dev_dbg(dev, "Requesting %d-%duV\n",
data->min_uV, data->max_uV);
ret = regulator_set_voltage(data->regulator,
data->min_uV, data->max_uV);
if (ret != 0) {
Expand All @@ -44,6 +46,7 @@ static void update_voltage_constraints(struct device *dev,
}

if (data->min_uV && data->max_uV && !data->enabled) {
dev_dbg(dev, "Enabling regulator\n");
ret = regulator_enable(data->regulator);
if (ret == 0)
data->enabled = 1;
Expand All @@ -53,6 +56,7 @@ static void update_voltage_constraints(struct device *dev,
}

if (!(data->min_uV && data->max_uV) && data->enabled) {
dev_dbg(dev, "Disabling regulator\n");
ret = regulator_disable(data->regulator);
if (ret == 0)
data->enabled = 0;
Expand All @@ -69,6 +73,8 @@ static void update_current_limit_constraints(struct device *dev,

if (data->max_uA
&& data->min_uA <= data->max_uA) {
dev_dbg(dev, "Requesting %d-%duA\n",
data->min_uA, data->max_uA);
ret = regulator_set_current_limit(data->regulator,
data->min_uA, data->max_uA);
if (ret != 0) {
Expand All @@ -80,6 +86,7 @@ static void update_current_limit_constraints(struct device *dev,
}

if (data->max_uA && !data->enabled) {
dev_dbg(dev, "Enabling regulator\n");
ret = regulator_enable(data->regulator);
if (ret == 0)
data->enabled = 1;
Expand All @@ -89,6 +96,7 @@ static void update_current_limit_constraints(struct device *dev,
}

if (!(data->min_uA && data->max_uA) && data->enabled) {
dev_dbg(dev, "Disabling regulator\n");
ret = regulator_disable(data->regulator);
if (ret == 0)
data->enabled = 0;
Expand Down

0 comments on commit a5d2abc

Please sign in to comment.