Skip to content

Commit

Permalink
Merge remote-tracking branches 'regulator/topic/rk808', 'regulator/to…
Browse files Browse the repository at this point in the history
…pic/rpm', 'regulator/topic/rt5033' and 'regulator/topic/tps65023' into regulator-next
  • Loading branch information
Mark Brown committed Feb 8, 2015
5 parents ffe167b + 5cb2f03 + c6515d2 + 53aebb7 + 4604a06 commit dd7c2e7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
12 changes: 8 additions & 4 deletions drivers/regulator/qcom_rpm-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ static int rpm_reg_set_mV_sel(struct regulator_dev *rdev,
return uV;

mutex_lock(&vreg->lock);
vreg->uV = uV;
if (vreg->is_enabled)
ret = rpm_reg_write(vreg, req, vreg->uV / 1000);
ret = rpm_reg_write(vreg, req, uV / 1000);

if (!ret)
vreg->uV = uV;
mutex_unlock(&vreg->lock);

return ret;
Expand All @@ -252,9 +254,11 @@ static int rpm_reg_set_uV_sel(struct regulator_dev *rdev,
return uV;

mutex_lock(&vreg->lock);
vreg->uV = uV;
if (vreg->is_enabled)
ret = rpm_reg_write(vreg, req, vreg->uV);
ret = rpm_reg_write(vreg, req, uV);

if (!ret)
vreg->uV = uV;
mutex_unlock(&vreg->lock);

return ret;
Expand Down
6 changes: 3 additions & 3 deletions drivers/regulator/rk808-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static int rk808_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
RK808_RAMP_RATE_MASK, ramp_value);
}

int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv)
static int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv)
{
unsigned int reg;
int sel = regulator_map_voltage_linear_range(rdev, uv, uv);
Expand All @@ -112,7 +112,7 @@ int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv)
sel);
}

int rk808_set_suspend_enable(struct regulator_dev *rdev)
static int rk808_set_suspend_enable(struct regulator_dev *rdev)
{
unsigned int reg;

Expand All @@ -123,7 +123,7 @@ int rk808_set_suspend_enable(struct regulator_dev *rdev)
0);
}

int rk808_set_suspend_disable(struct regulator_dev *rdev)
static int rk808_set_suspend_disable(struct regulator_dev *rdev)
{
unsigned int reg;

Expand Down
8 changes: 7 additions & 1 deletion drivers/regulator/rt5033-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ static struct regulator_ops rt5033_buck_ops = {
static const struct regulator_desc rt5033_supported_regulators[] = {
[RT5033_BUCK] = {
.name = "BUCK",
.of_match = of_match_ptr("BUCK"),
.regulators_node = of_match_ptr("regulators"),
.id = RT5033_BUCK,
.ops = &rt5033_buck_ops,
.type = REGULATOR_VOLTAGE,
Expand All @@ -50,6 +52,8 @@ static const struct regulator_desc rt5033_supported_regulators[] = {
},
[RT5033_LDO] = {
.name = "LDO",
.of_match = of_match_ptr("LDO"),
.regulators_node = of_match_ptr("regulators"),
.id = RT5033_LDO,
.ops = &rt5033_buck_ops,
.type = REGULATOR_VOLTAGE,
Expand All @@ -64,6 +68,8 @@ static const struct regulator_desc rt5033_supported_regulators[] = {
},
[RT5033_SAFE_LDO] = {
.name = "SAFE_LDO",
.of_match = of_match_ptr("SAFE_LDO"),
.regulators_node = of_match_ptr("regulators"),
.id = RT5033_SAFE_LDO,
.ops = &rt5033_safe_ldo_ops,
.type = REGULATOR_VOLTAGE,
Expand All @@ -81,7 +87,7 @@ static int rt5033_regulator_probe(struct platform_device *pdev)
int ret, i;
struct regulator_config config = {};

config.dev = &pdev->dev;
config.dev = rt5033->dev;
config.driver_data = rt5033;

for (i = 0; i < ARRAY_SIZE(rt5033_supported_regulators); i++) {
Expand Down
6 changes: 3 additions & 3 deletions drivers/regulator/tps65023-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static int tps65023_dcdc_set_voltage_sel(struct regulator_dev *dev,
}

/* Operations permitted on VDCDCx */
static struct regulator_ops tps65023_dcdc_ops = {
static const struct regulator_ops tps65023_dcdc_ops = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand All @@ -184,7 +184,7 @@ static struct regulator_ops tps65023_dcdc_ops = {
};

/* Operations permitted on LDOx */
static struct regulator_ops tps65023_ldo_ops = {
static const struct regulator_ops tps65023_ldo_ops = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand All @@ -194,7 +194,7 @@ static struct regulator_ops tps65023_ldo_ops = {
.map_voltage = regulator_map_voltage_ascend,
};

static struct regmap_config tps65023_regmap_config = {
static const struct regmap_config tps65023_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
};
Expand Down

0 comments on commit dd7c2e7

Please sign in to comment.