Commit 0d2a8ef4 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'regulator/fix/qcom-smd' and...

Merge remote-tracking branches 'regulator/fix/qcom-smd' and 'regulator/fix/tps51632' into regulator-linus
...@@ -140,6 +140,19 @@ static const struct regulator_ops rpm_smps_ldo_ops = { ...@@ -140,6 +140,19 @@ static const struct regulator_ops rpm_smps_ldo_ops = {
.enable = rpm_reg_enable, .enable = rpm_reg_enable,
.disable = rpm_reg_disable, .disable = rpm_reg_disable,
.is_enabled = rpm_reg_is_enabled, .is_enabled = rpm_reg_is_enabled,
.list_voltage = regulator_list_voltage_linear_range,
.get_voltage = rpm_reg_get_voltage,
.set_voltage = rpm_reg_set_voltage,
.set_load = rpm_reg_set_load,
};
static const struct regulator_ops rpm_smps_ldo_ops_fixed = {
.enable = rpm_reg_enable,
.disable = rpm_reg_disable,
.is_enabled = rpm_reg_is_enabled,
.list_voltage = regulator_list_voltage_linear_range,
.get_voltage = rpm_reg_get_voltage, .get_voltage = rpm_reg_get_voltage,
.set_voltage = rpm_reg_set_voltage, .set_voltage = rpm_reg_set_voltage,
...@@ -247,7 +260,7 @@ static const struct regulator_desc pm8941_nldo = { ...@@ -247,7 +260,7 @@ static const struct regulator_desc pm8941_nldo = {
static const struct regulator_desc pm8941_lnldo = { static const struct regulator_desc pm8941_lnldo = {
.fixed_uV = 1740000, .fixed_uV = 1740000,
.n_voltages = 1, .n_voltages = 1,
.ops = &rpm_smps_ldo_ops, .ops = &rpm_smps_ldo_ops_fixed,
}; };
static const struct regulator_desc pm8941_switch = { static const struct regulator_desc pm8941_switch = {
......
...@@ -94,11 +94,14 @@ static int tps51632_dcdc_set_ramp_delay(struct regulator_dev *rdev, ...@@ -94,11 +94,14 @@ static int tps51632_dcdc_set_ramp_delay(struct regulator_dev *rdev,
int ramp_delay) int ramp_delay)
{ {
struct tps51632_chip *tps = rdev_get_drvdata(rdev); struct tps51632_chip *tps = rdev_get_drvdata(rdev);
int bit = ramp_delay/6000; int bit;
int ret; int ret;
if (bit) if (ramp_delay == 0)
bit--; bit = 0;
else
bit = DIV_ROUND_UP(ramp_delay, 6000) - 1;
ret = regmap_write(tps->regmap, TPS51632_SLEW_REGS, BIT(bit)); ret = regmap_write(tps->regmap, TPS51632_SLEW_REGS, BIT(bit));
if (ret < 0) if (ret < 0)
dev_err(tps->dev, "SLEW reg write failed, err %d\n", ret); dev_err(tps->dev, "SLEW reg write failed, err %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment