Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272408
b: refs/heads/master
c: cc17ef3
h: refs/heads/master
v: v3
  • Loading branch information
Marcus Folkesson authored and Liam Girdwood committed Aug 28, 2011
1 parent 423196e commit bc3aa1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 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: f068ad8cca7532bc42115d61489de00fe57c3909
refs/heads/master: cc17ef3f0463ba17c8767578da8c4e5fbdd4b447
19 changes: 15 additions & 4 deletions trunk/drivers/regulator/tps65023-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
struct tps_pmic *tps = rdev_get_drvdata(dev);
int dcdc = rdev_get_id(dev);
int vsel;
int ret;

if (dcdc != TPS65023_DCDC_1)
return -EINVAL;
Expand All @@ -306,11 +307,21 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,

*selector = vsel;

/* write to the register in case we found a match */
if (vsel == tps->info[dcdc]->table_len)
return -EINVAL;
else
return tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
goto failed;

ret = tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);

/* Tell the chip that we have changed the value in DEFCORE
* and its time to update the core voltage
*/
tps_65023_set_bits(tps, TPS65023_REG_CON_CTRL2,
TPS65023_REG_CTRL2_GO);

return ret;

failed:
return -EINVAL;
}

static int tps65023_ldo_get_voltage(struct regulator_dev *dev)
Expand Down

0 comments on commit bc3aa1d

Please sign in to comment.