Skip to content

Commit 24957db

Browse files
mszyprowvireshk
authored andcommitted
opp: core: Revert "add regulators enable and disable"
All the drivers, which use the OPP framework control regulators, which are already enabled. Typically those regulators are also system critical, due to providing power to CPU core or system buses. It turned out that there are cases, where calling regulator_enable() on such boot-enabled regulator has side-effects and might change its initial voltage due to performing initial voltage balancing without all restrictions from the consumers. Until this issue becomes finally solved in regulator core, avoid calling regulator_enable()/disable() from the OPP framework. This reverts commit 7f93ff7. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent f2edbb6 commit 24957db

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

drivers/opp/core.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,12 +1626,6 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
16261626
goto free_regulators;
16271627
}
16281628

1629-
ret = regulator_enable(reg);
1630-
if (ret < 0) {
1631-
regulator_put(reg);
1632-
goto free_regulators;
1633-
}
1634-
16351629
opp_table->regulators[i] = reg;
16361630
}
16371631

@@ -1645,10 +1639,8 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
16451639
return opp_table;
16461640

16471641
free_regulators:
1648-
while (i--) {
1649-
regulator_disable(opp_table->regulators[i]);
1650-
regulator_put(opp_table->regulators[i]);
1651-
}
1642+
while (i != 0)
1643+
regulator_put(opp_table->regulators[--i]);
16521644

16531645
kfree(opp_table->regulators);
16541646
opp_table->regulators = NULL;
@@ -1674,10 +1666,8 @@ void dev_pm_opp_put_regulators(struct opp_table *opp_table)
16741666
/* Make sure there are no concurrent readers while updating opp_table */
16751667
WARN_ON(!list_empty(&opp_table->opp_list));
16761668

1677-
for (i = opp_table->regulator_count - 1; i >= 0; i--) {
1678-
regulator_disable(opp_table->regulators[i]);
1669+
for (i = opp_table->regulator_count - 1; i >= 0; i--)
16791670
regulator_put(opp_table->regulators[i]);
1680-
}
16811671

16821672
_free_set_opp_data(opp_table);
16831673

0 commit comments

Comments
 (0)