Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321851
b: refs/heads/master
c: 3e2a928
h: refs/heads/master
i:
  321849: b76ec7e
  321847: b5c0147
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 7, 2012
1 parent 4f1b195 commit caf48ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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: 7f852e0584f67654060f7814149744a1b7250480
refs/heads/master: 3e2a928472daa839e7be0d71c1d8320334ea76e1
5 changes: 3 additions & 2 deletions trunk/drivers/regulator/anatop-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ static int anatop_set_voltage_sel(struct regulator_dev *reg, unsigned selector)
static int anatop_get_voltage_sel(struct regulator_dev *reg)
{
struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
u32 val;
u32 val, mask;

if (!anatop_reg->control_reg)
return -ENOTSUPP;

val = anatop_read_reg(anatop_reg->mfd, anatop_reg->control_reg);
val = (val & ((1 << anatop_reg->vol_bit_width) - 1)) >>
mask = ((1 << anatop_reg->vol_bit_width) - 1) <<
anatop_reg->vol_bit_shift;
val = (val & mask) >> anatop_reg->vol_bit_shift;

return val - anatop_reg->min_bit_val;
}
Expand Down

0 comments on commit caf48ab

Please sign in to comment.