Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177718
b: refs/heads/master
c: 8f031b4
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Dec 17, 2009
1 parent 166efae commit 27d3924
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af5866c9cdc9e43ef775a14765fd8eab95c7fd20
refs/heads/master: 8f031b48cd2eab5fc3e4dffa06706372e90d63fe
44 changes: 31 additions & 13 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,25 +641,43 @@ static void print_constraints(struct regulator_dev *rdev)
{
struct regulation_constraints *constraints = rdev->constraints;
char buf[80];
int count;
int count = 0;
int ret;

if (rdev->desc->type == REGULATOR_VOLTAGE) {
if (constraints->min_uV && constraints->max_uV) {
if (constraints->min_uV == constraints->max_uV)
count = sprintf(buf, "%d mV ",
constraints->min_uV / 1000);
count += sprintf(buf + count, "%d mV ",
constraints->min_uV / 1000);
else
count = sprintf(buf, "%d <--> %d mV ",
constraints->min_uV / 1000,
constraints->max_uV / 1000);
} else {
count += sprintf(buf + count, "%d <--> %d mV ",
constraints->min_uV / 1000,
constraints->max_uV / 1000);
}

if (!constraints->min_uV ||
constraints->min_uV != constraints->max_uV) {
ret = _regulator_get_voltage(rdev);
if (ret > 0)
count += sprintf(buf + count, "at %d mV ", ret / 1000);
}

if (constraints->min_uA && constraints->max_uA) {
if (constraints->min_uA == constraints->max_uA)
count = sprintf(buf, "%d mA ",
constraints->min_uA / 1000);
count += sprintf(buf + count, "%d mA ",
constraints->min_uA / 1000);
else
count = sprintf(buf, "%d <--> %d mA ",
constraints->min_uA / 1000,
constraints->max_uA / 1000);
count += sprintf(buf + count, "%d <--> %d mA ",
constraints->min_uA / 1000,
constraints->max_uA / 1000);
}

if (!constraints->min_uA ||
constraints->min_uA != constraints->max_uA) {
ret = _regulator_get_current_limit(rdev);
if (ret > 0)
count += sprintf(buf + count, "at %d uA ", ret / 1000);
}

if (constraints->valid_modes_mask & REGULATOR_MODE_FAST)
count += sprintf(buf + count, "fast ");
if (constraints->valid_modes_mask & REGULATOR_MODE_NORMAL)
Expand Down

0 comments on commit 27d3924

Please sign in to comment.