forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
regulator: rohm-regulator: add helper for restricted voltage setting
Few ROHM PMICs have regulators where voltage setting can be done only when regulator is disabled. Add helper for those PMICs. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/6f51871e9fea611d133b5dd2560f4a7ee1ede9cd.1637233864.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <[email protected]>
- Loading branch information
1 parent
4950486
commit 8b6e885
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,22 @@ int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, | |
} | ||
EXPORT_SYMBOL(rohm_regulator_set_dvs_levels); | ||
|
||
/* | ||
* Few ROHM PMIC ICs have constrains on voltage changing: | ||
* BD71837 - only buck 1-4 voltages can be changed when they are enabled. | ||
* Other bucks and all LDOs must be disabled when voltage is changed. | ||
* BD96801 - LDO voltage levels can be changed when LDOs are disabled. | ||
*/ | ||
int rohm_regulator_set_voltage_sel_restricted(struct regulator_dev *rdev, | ||
unsigned int sel) | ||
{ | ||
if (rdev->desc->ops->is_enabled(rdev)) | ||
return -EBUSY; | ||
|
||
return regulator_set_voltage_sel_regmap(rdev, sel); | ||
} | ||
EXPORT_SYMBOL_GPL(rohm_regulator_set_voltage_sel_restricted); | ||
|
||
MODULE_LICENSE("GPL v2"); | ||
MODULE_AUTHOR("Matti Vaittinen <[email protected]>"); | ||
MODULE_DESCRIPTION("Generic helpers for ROHM PMIC regulator drivers"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters