Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312510
b: refs/heads/master
c: fc492f9
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Jun 4, 2012
1 parent 122f2d6 commit 446efe8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 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: 2e3f7f26e1323fb302921c4575a499710636d531
refs/heads/master: fc492f9bd13cb4c7c1299f5d390a203c1ad9a85b
38 changes: 8 additions & 30 deletions trunk/drivers/regulator/wm8350-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,12 @@ static int wm8350_ldo_set_suspend_disable(struct regulator_dev *rdev)
return 0;
}

static int wm8350_ldo_set_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV, unsigned *selector)
static int wm8350_ldo_map_voltage(struct regulator_dev *rdev, int min_uV,
int max_uV)
{
struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
int volt_reg, ldo = rdev_get_id(rdev), mV, min_mV = min_uV / 1000,
max_mV = max_uV / 1000;
u16 val;
int mV;
int min_mV = min_uV / 1000;
int max_mV = max_uV / 1000;

if (min_mV < 900 || min_mV > 3300)
return -EINVAL;
Expand All @@ -698,29 +697,7 @@ static int wm8350_ldo_set_voltage(struct regulator_dev *rdev, int min_uV,
BUG_ON(wm8350_ldo_val_to_mvolts(mV) < min_mV);
}

switch (ldo) {
case WM8350_LDO_1:
volt_reg = WM8350_LDO1_CONTROL;
break;
case WM8350_LDO_2:
volt_reg = WM8350_LDO2_CONTROL;
break;
case WM8350_LDO_3:
volt_reg = WM8350_LDO3_CONTROL;
break;
case WM8350_LDO_4:
volt_reg = WM8350_LDO4_CONTROL;
break;
default:
return -EINVAL;
}

*selector = mV;

/* all LDOs have same mV bits */
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_VSEL_MASK;
wm8350_reg_write(wm8350, volt_reg, val | mV);
return 0;
return mV;
}

static int wm8350_ldo_list_voltage(struct regulator_dev *rdev,
Expand Down Expand Up @@ -1058,7 +1035,8 @@ static struct regulator_ops wm8350_dcdc2_5_ops = {
};

static struct regulator_ops wm8350_ldo_ops = {
.set_voltage = wm8350_ldo_set_voltage,
.map_voltage = wm8350_ldo_map_voltage,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.list_voltage = wm8350_ldo_list_voltage,
.enable = regulator_enable_regmap,
Expand Down

0 comments on commit 446efe8

Please sign in to comment.