Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323324
b: refs/heads/master
c: 38f8f43
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 28, 2012
1 parent 5b8325a commit fde96fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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: 78292f4ed2aa9f92eb7bef1e0e1cea14b705e378
refs/heads/master: 38f8f43cbafe9ad07fdde31d28ed0c6933ac1e2e
24 changes: 13 additions & 11 deletions trunk/drivers/regulator/twl-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,11 @@ static int twl6030smps_list_voltage(struct regulator_dev *rdev, unsigned index)
return voltage;
}

static int
twl6030smps_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
unsigned int *selector)
static int twl6030smps_map_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV)
{
struct twlreg_info *info = rdev_get_drvdata(rdev);
int vsel = 0, calc_uV;
struct twlreg_info *info = rdev_get_drvdata(rdev);
int vsel = 0;

switch (info->flags) {
case 0:
Expand Down Expand Up @@ -829,14 +828,16 @@ twl6030smps_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
break;
}

calc_uV = twl6030smps_list_voltage(rdev, vsel);
if (calc_uV > max_uV)
return -EINVAL;
return vsel;
}

*selector = vsel;
static int twl6030smps_set_voltage_sel(struct regulator_dev *rdev,
unsigned int selector)
{
struct twlreg_info *info = rdev_get_drvdata(rdev);

return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE_SMPS,
vsel);
selector);
}

static int twl6030smps_get_voltage_sel(struct regulator_dev *rdev)
Expand All @@ -848,8 +849,9 @@ static int twl6030smps_get_voltage_sel(struct regulator_dev *rdev)

static struct regulator_ops twlsmps_ops = {
.list_voltage = twl6030smps_list_voltage,
.map_voltage = twl6030smps_map_voltage,

.set_voltage = twl6030smps_set_voltage,
.set_voltage_sel = twl6030smps_set_voltage_sel,
.get_voltage_sel = twl6030smps_get_voltage_sel,

.enable = twl6030reg_enable,
Expand Down

0 comments on commit fde96fe

Please sign in to comment.