forked from Minki/linux
regulator: Fixes for v4.7
Some driver specific fixes for the regulator subsystem: - Some of the changes to the core that were merged in the last merge window exposed the fact that the qcom-smd driver hadn't implemented the voltage enumeration interfaces like it should. Since it's a simple driver specific fix to implement them do that. - Fix the ramp delay configuration for tps51632. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJXXthzAAoJECTWi3JdVIfQas8H/Ak/6so7bLi3OuqPLlhNwaMC XtsDZVIdwV/QR6W/Wlc4yNmFc/v9VGr9vg4wZQeUFE26pnzCehRic6h3H3VoA4Jg LGBQB9yYeuJ4QZ+x80jvCWrs+qnU5oh4TpCbwJj9KphFDsOXCGnuGaDTIwK47s8i PsdaXZHvT2yYdxvaQyDDsAureouxOPMndLBk6B7uwb+sLiNoSfuE0QA/rrE0MnZp Iv21LV7bQ5LOBuTHDYFNh/HEq5oqs4eNUcxH42K2nabMvjTdYGZRNBnJzngpd4GO PBREj9/oqY6FDHg56f7OiRhDxp47lfs52Z5wdJKjw1nHTNxzmJG0pL/O4mfmy9o= =shx9 -----END PGP SIGNATURE----- Merge tag 'regulator-fix-v4.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "Some driver specific fixes for the regulator subsystem: - Some of the changes to the core that were merged in the last merge window exposed the fact that the qcom-smd driver hadn't implemented the voltage enumeration interfaces like it should. Since it's a simple driver specific fix to implement them do that. - Fix the ramp delay configuration for tps51632" * tag 'regulator-fix-v4.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: qcom_smd: add list_voltage callback regulator: qcom_smd: add regulator ops for pm8941 lnldo regulator: qcom_smd: add list_voltage callback regulator: tps51632: Fix setting ramp delay
This commit is contained in:
commit
35398ee3f0
@ -140,6 +140,19 @@ static const struct regulator_ops rpm_smps_ldo_ops = {
|
||||
.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,
|
||||
.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,
|
||||
.set_voltage = rpm_reg_set_voltage,
|
||||
@ -247,7 +260,7 @@ static const struct regulator_desc pm8941_nldo = {
|
||||
static const struct regulator_desc pm8941_lnldo = {
|
||||
.fixed_uV = 1740000,
|
||||
.n_voltages = 1,
|
||||
.ops = &rpm_smps_ldo_ops,
|
||||
.ops = &rpm_smps_ldo_ops_fixed,
|
||||
};
|
||||
|
||||
static const struct regulator_desc pm8941_switch = {
|
||||
|
@ -94,11 +94,14 @@ static int tps51632_dcdc_set_ramp_delay(struct regulator_dev *rdev,
|
||||
int ramp_delay)
|
||||
{
|
||||
struct tps51632_chip *tps = rdev_get_drvdata(rdev);
|
||||
int bit = ramp_delay/6000;
|
||||
int bit;
|
||||
int ret;
|
||||
|
||||
if (bit)
|
||||
bit--;
|
||||
if (ramp_delay == 0)
|
||||
bit = 0;
|
||||
else
|
||||
bit = DIV_ROUND_UP(ramp_delay, 6000) - 1;
|
||||
|
||||
ret = regmap_write(tps->regmap, TPS51632_SLEW_REGS, BIT(bit));
|
||||
if (ret < 0)
|
||||
dev_err(tps->dev, "SLEW reg write failed, err %d\n", ret);
|
||||
|
Loading…
Reference in New Issue
Block a user