Skip to content

Commit

Permalink
regulator: Fix setting low power mode for wm831x aldo
Browse files Browse the repository at this point in the history
Set BIT[8] of LDO7 ON Control mode for low power mode.

R16507 (407Bh)  LDO7 ON Control
BIT[8] LDO7_ON_MODE: LDO7 ON Operating Mode
        0 = Normal mode
        1 = Low Power mode

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 29, 2012
1 parent fa5a97b commit e841a36
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/regulator/wm831x-ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,22 +506,19 @@ static int wm831x_aldo_set_mode(struct regulator_dev *rdev,
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
int ret;


switch (mode) {
case REGULATOR_MODE_NORMAL:
ret = wm831x_set_bits(wm831x, on_reg,
WM831X_LDO7_ON_MODE, 0);
ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE, 0);
if (ret < 0)
return ret;
break;

case REGULATOR_MODE_IDLE:
ret = wm831x_set_bits(wm831x, ctrl_reg,
WM831X_LDO7_ON_MODE,
ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE,
WM831X_LDO7_ON_MODE);
if (ret < 0)
return ret;
Expand Down

0 comments on commit e841a36

Please sign in to comment.