Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302103
b: refs/heads/master
c: 022dcdf
h: refs/heads/master
i:
  302101: 6934d08
  302099: edf20b6
  302095: 1aca4ed
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 1, 2012
1 parent bfd3e95 commit 313a445
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 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: 7e44bb83a777fd67a70b2188dd31c33db25aef72
refs/heads/master: 022dcdf083d67db34f5237369d3501ca5708d8eb
22 changes: 6 additions & 16 deletions trunk/drivers/regulator/pcf50633-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = {
static u8 auto_voltage_bits(unsigned int millivolts)
{
if (millivolts < 1800)
return 0;
return 0x2f;
if (millivolts > 3800)
return 0xff;

Expand Down Expand Up @@ -87,6 +87,9 @@ static u8 ldo_voltage_bits(unsigned int millivolts)
/* Obtain voltage value from bits */
static unsigned int auto_voltage_value(u8 bits)
{
/* AUTOOUT: 00000000 to 00101110 are reserved.
* Return 0 for bits in reserved range, which means this selector code
* can't be used on this system */
if (bits < 0x2f)
return 0;

Expand Down Expand Up @@ -208,20 +211,7 @@ static int pcf50633_regulator_get_voltage(struct regulator_dev *rdev)
static int pcf50633_regulator_list_voltage(struct regulator_dev *rdev,
unsigned int index)
{
struct pcf50633 *pcf;
int regulator_id;

pcf = rdev_get_drvdata(rdev);

regulator_id = rdev_get_id(rdev);

switch (regulator_id) {
case PCF50633_REGULATOR_AUTO:
index += 0x2f;
break;
default:
break;
}
int regulator_id = rdev_get_id(rdev);

return pcf50633_regulator_voltage_value(regulator_id, index);
}
Expand Down Expand Up @@ -287,7 +277,7 @@ static struct regulator_ops pcf50633_regulator_ops = {

static struct regulator_desc regulators[] = {
[PCF50633_REGULATOR_AUTO] =
PCF50633_REGULATOR("auto", PCF50633_REGULATOR_AUTO, 81),
PCF50633_REGULATOR("auto", PCF50633_REGULATOR_AUTO, 128),
[PCF50633_REGULATOR_DOWN1] =
PCF50633_REGULATOR("down1", PCF50633_REGULATOR_DOWN1, 96),
[PCF50633_REGULATOR_DOWN2] =
Expand Down

0 comments on commit 313a445

Please sign in to comment.