Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302117
b: refs/heads/master
c: 3cbff37
h: refs/heads/master
i:
  302115: ded50f5
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 1, 2012
1 parent ace709a commit 4ca3a73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 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: d5ec96357d743288bd03a685defd586ad35d351e
refs/heads/master: 3cbff37ea0e9d90334c51ac92f5a597697258d3d
11 changes: 4 additions & 7 deletions trunk/drivers/regulator/pcap-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,18 @@ static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev,
selector << vreg->index);
}

static int pcap_regulator_get_voltage(struct regulator_dev *rdev)
static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev)
{
struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
void *pcap = rdev_get_drvdata(rdev);
u32 tmp;
int mV;

if (vreg->n_voltages == 1)
return vreg->voltage_table[0] * 1000;
return 0;

ezx_pcap_read(pcap, vreg->reg, &tmp);
tmp = ((tmp >> vreg->index) & (vreg->n_voltages - 1));
mV = vreg->voltage_table[tmp];

return mV * 1000;
return tmp;
}

static int pcap_regulator_enable(struct regulator_dev *rdev)
Expand Down Expand Up @@ -228,7 +225,7 @@ static int pcap_regulator_list_voltage(struct regulator_dev *rdev,
static struct regulator_ops pcap_regulator_ops = {
.list_voltage = pcap_regulator_list_voltage,
.set_voltage_sel = pcap_regulator_set_voltage_sel,
.get_voltage = pcap_regulator_get_voltage,
.get_voltage_sel = pcap_regulator_get_voltage_sel,
.enable = pcap_regulator_enable,
.disable = pcap_regulator_disable,
.is_enabled = pcap_regulator_is_enabled,
Expand Down

0 comments on commit 4ca3a73

Please sign in to comment.