Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323355
b: refs/heads/master
c: a0a7014
h: refs/heads/master
i:
  323353: 8bdc0ba
  323351: b371a0c
v: v3
  • Loading branch information
Linus Walleij authored and Mark Brown committed Aug 28, 2012
1 parent 3088c3e commit c85f122
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: db55168265699c72e6ebf7a4228029da590a3eab
refs/heads/master: a0a7014cd40b1d1d13e121e5083bd3b2bbffe348
20 changes: 10 additions & 10 deletions trunk/drivers/regulator/ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* @voltage_bank: bank to control regulator voltage
* @voltage_reg: register to control regulator voltage
* @voltage_mask: mask to control regulator voltage
* @voltage_shift: shift to control regulator voltage
* @delay: startup/set voltage delay in us
*/
struct ab8500_regulator_info {
Expand All @@ -50,6 +51,7 @@ struct ab8500_regulator_info {
u8 voltage_bank;
u8 voltage_reg;
u8 voltage_mask;
u8 voltage_shift;
unsigned int delay;
};

Expand Down Expand Up @@ -195,17 +197,14 @@ static int ab8500_regulator_get_voltage_sel(struct regulator_dev *rdev)
}

dev_vdbg(rdev_get_dev(rdev),
"%s-get_voltage (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
" 0x%x\n",
info->desc.name, info->voltage_bank, info->voltage_reg,
info->voltage_mask, regval);
"%s-get_voltage (bank, reg, mask, shift, value): "
"0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n",
info->desc.name, info->voltage_bank,
info->voltage_reg, info->voltage_mask,
info->voltage_shift, regval);

/* vintcore has a different layout */
val = regval & info->voltage_mask;
if (info->desc.id == AB8500_LDO_INTCORE)
return val >> 0x3;
else
return val;
return val >> info->voltage_shift;
}

static int ab8500_regulator_set_voltage_sel(struct regulator_dev *rdev,
Expand All @@ -221,7 +220,7 @@ static int ab8500_regulator_set_voltage_sel(struct regulator_dev *rdev,
}

/* set the registers for the request */
regval = (u8)selector;
regval = (u8)selector << info->voltage_shift;
ret = abx500_mask_and_set_register_interruptible(info->dev,
info->voltage_bank, info->voltage_reg,
info->voltage_mask, regval);
Expand Down Expand Up @@ -343,6 +342,7 @@ static struct ab8500_regulator_info
.voltage_bank = 0x03,
.voltage_reg = 0x80,
.voltage_mask = 0x38,
.voltage_shift = 3,
},

/*
Expand Down

0 comments on commit c85f122

Please sign in to comment.