Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350394
b: refs/heads/master
c: c6f0a0e
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Dec 27, 2012
1 parent 4ac89a4 commit c41129c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 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: adbf7eabb6816eb3fe5d2ee0b8ec1d0b518a92df
refs/heads/master: c6f0a0efb163b7d2e879f92197ab5e674868358e
38 changes: 6 additions & 32 deletions trunk/drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ struct pm8607_regulator_info {
unsigned int *vol_table;
unsigned int *vol_suspend;

int update_reg;
int update_bit;
int slope_double;
};

Expand Down Expand Up @@ -222,30 +220,6 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index)
return ret;
}

static int pm8607_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{
struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
uint8_t val;
int ret;

val = (uint8_t)(selector << (ffs(rdev->desc->vsel_mask) - 1));

ret = pm860x_set_bits(info->i2c, rdev->desc->vsel_reg,
rdev->desc->vsel_mask, val);
if (ret)
return ret;
switch (info->desc.id) {
case PM8607_ID_BUCK1:
case PM8607_ID_BUCK2:
case PM8607_ID_BUCK3:
ret = pm860x_set_bits(info->i2c, info->update_reg,
1 << info->update_bit,
1 << info->update_bit);
break;
}
return ret;
}

static int pm8606_preg_enable(struct regulator_dev *rdev)
{
struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
Expand Down Expand Up @@ -277,7 +251,7 @@ static int pm8606_preg_is_enabled(struct regulator_dev *rdev)

static struct regulator_ops pm8607_regulator_ops = {
.list_voltage = pm8607_list_voltage,
.set_voltage_sel = pm8607_set_voltage_sel,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand Down Expand Up @@ -314,11 +288,11 @@ static struct regulator_ops pm8606_preg_ops = {
.n_voltages = ARRAY_SIZE(vreg##_table), \
.vsel_reg = PM8607_##vreg, \
.vsel_mask = ARRAY_SIZE(vreg##_table) - 1, \
.apply_reg = PM8607_##ureg, \
.apply_bit = (ubit), \
.enable_reg = PM8607_##ereg, \
.enable_mask = 1 << (ebit), \
}, \
.update_reg = PM8607_##ureg, \
.update_bit = (ubit), \
.slope_double = (0), \
.vol_table = (unsigned int *)&vreg##_table, \
.vol_suspend = (unsigned int *)&vreg##_suspend_table, \
Expand All @@ -344,9 +318,9 @@ static struct regulator_ops pm8606_preg_ops = {
}

static struct pm8607_regulator_info pm8607_regulator_info[] = {
PM8607_DVC(BUCK1, GO, 0, SUPPLIES_EN11, 0),
PM8607_DVC(BUCK2, GO, 1, SUPPLIES_EN11, 1),
PM8607_DVC(BUCK3, GO, 2, SUPPLIES_EN11, 2),
PM8607_DVC(BUCK1, GO, BIT(0), SUPPLIES_EN11, 0),
PM8607_DVC(BUCK2, GO, BIT(1), SUPPLIES_EN11, 1),
PM8607_DVC(BUCK3, GO, BIT(2), SUPPLIES_EN11, 2),

PM8607_LDO(1, LDO1, 0, SUPPLIES_EN11, 3),
PM8607_LDO(2, LDO2, 0, SUPPLIES_EN11, 4),
Expand Down

0 comments on commit c41129c

Please sign in to comment.