Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312518
b: refs/heads/master
c: ee3ed6e
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 7, 2012
1 parent e6fd41b commit 075b8b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 985f769c89aedcae2981080051fc85b4ed035a9b
refs/heads/master: ee3ed6effd8cc4c0cbfa35307cfc5fcec75b5e12
6 changes: 6 additions & 0 deletions trunk/drivers/regulator/da903x.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ static int da903x_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
struct device *da9034_dev = to_da903x_dev(rdev);
uint8_t val, mask;

if (rdev->desc->n_voltages == 1)
return -EINVAL;

val = selector << info->vol_shift;
mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;

Expand All @@ -120,6 +123,9 @@ static int da903x_get_voltage_sel(struct regulator_dev *rdev)
uint8_t val, mask;
int ret;

if (rdev->desc->n_voltages == 1)
return 0;

ret = da903x_read(da9034_dev, info->vol_reg, &val);
if (ret)
return ret;
Expand Down

0 comments on commit 075b8b2

Please sign in to comment.