Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292066
b: refs/heads/master
c: c567556
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 14, 2012
1 parent a092b83 commit 9402fb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 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: 831c986f5dfc9f29f5237697029f7faf24521413
refs/heads/master: c567556e75534316f1ae800b0a0fbbc687d0662e
31 changes: 5 additions & 26 deletions trunk/drivers/regulator/tps65912-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,34 +409,13 @@ static int tps65912_get_voltage_dcdc(struct regulator_dev *dev)
struct tps65912_reg *pmic = rdev_get_drvdata(dev);
struct tps65912 *mfd = pmic->mfd;
int id = rdev_get_id(dev);
int opvsel = 0, avsel = 0, sr, vsel;
int reg, vsel;

switch (id) {
case TPS65912_REG_DCDC1:
opvsel = tps65912_reg_read(mfd, TPS65912_DCDC1_OP);
avsel = tps65912_reg_read(mfd, TPS65912_DCDC1_AVS);
break;
case TPS65912_REG_DCDC2:
opvsel = tps65912_reg_read(mfd, TPS65912_DCDC2_OP);
avsel = tps65912_reg_read(mfd, TPS65912_DCDC2_AVS);
break;
case TPS65912_REG_DCDC3:
opvsel = tps65912_reg_read(mfd, TPS65912_DCDC3_OP);
avsel = tps65912_reg_read(mfd, TPS65912_DCDC3_AVS);
break;
case TPS65912_REG_DCDC4:
opvsel = tps65912_reg_read(mfd, TPS65912_DCDC4_OP);
avsel = tps65912_reg_read(mfd, TPS65912_DCDC4_AVS);
break;
default:
return -EINVAL;
}
reg = tps65912_get_sel_register(pmic, id);
if (reg < 0)
return reg;

sr = (opvsel & OP_SELREG_MASK) >> OP_SELREG_SHIFT;
if (sr)
vsel = avsel;
else
vsel = opvsel;
vsel = tps65912_reg_read(mfd, reg);
vsel &= 0x3F;

return tps65912_list_voltage_dcdc(dev, vsel);
Expand Down

0 comments on commit 9402fb7

Please sign in to comment.