Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312578
b: refs/heads/master
c: 9a0fbb6
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 23, 2012
1 parent abc39d8 commit c48b610
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 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: b5152415225ba0d489939778f3b85217b25036db
refs/heads/master: 9a0fbb627cfa86303b8eb57377f536c64812cc85
32 changes: 7 additions & 25 deletions trunk/drivers/regulator/max8998.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,6 @@ static const struct voltage_map_desc *ldo_voltage_map[] = {
&buck4_voltage_map_desc, /* BUCK4 */
};

static int max8998_list_voltage(struct regulator_dev *rdev,
unsigned int selector)
{
const struct voltage_map_desc *desc;
int ldo = rdev_get_id(rdev);
int val;

if (ldo >= ARRAY_SIZE(ldo_voltage_map))
return -EINVAL;

desc = ldo_voltage_map[ldo];
if (desc == NULL)
return -EINVAL;

val = desc->min + desc->step * selector;
if (val > desc->max)
return -EINVAL;

return val * 1000;
}

static int max8998_get_enable_register(struct regulator_dev *rdev,
int *reg, int *shift)
{
Expand Down Expand Up @@ -392,8 +371,8 @@ static int max8998_set_voltage_buck(struct regulator_dev *rdev,
/* if previous_voltage equal new voltage, return */
if (previous_sel == i) {
dev_dbg(max8998->dev, "No voltage change, old:%d, new:%d\n",
max8998_list_voltage(rdev, previous_sel),
max8998_list_voltage(rdev, i));
regulator_list_voltage_linear(rdev, previous_sel),
regulator_list_voltage_linear(rdev, i));
return ret;
}

Expand Down Expand Up @@ -519,7 +498,7 @@ static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
}

static struct regulator_ops max8998_ldo_ops = {
.list_voltage = max8998_list_voltage,
.list_voltage = regulator_list_voltage_linear,
.is_enabled = max8998_ldo_is_enabled,
.enable = max8998_ldo_enable,
.disable = max8998_ldo_disable,
Expand All @@ -530,7 +509,7 @@ static struct regulator_ops max8998_ldo_ops = {
};

static struct regulator_ops max8998_buck_ops = {
.list_voltage = max8998_list_voltage,
.list_voltage = regulator_list_voltage_linear,
.is_enabled = max8998_ldo_is_enabled,
.enable = max8998_ldo_enable,
.disable = max8998_ldo_disable,
Expand Down Expand Up @@ -860,7 +839,10 @@ static __devinit int max8998_pmic_probe(struct platform_device *pdev)
desc = ldo_voltage_map[id];
if (desc && regulators[index].ops != &max8998_others_ops) {
int count = (desc->max - desc->min) / desc->step + 1;

regulators[index].n_voltages = count;
regulators[index].min_uV = desc->min * 1000;
regulators[index].uV_step = desc->step * 1000;
}

config.dev = max8998->dev;
Expand Down

0 comments on commit c48b610

Please sign in to comment.