mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 05:54:08 +00:00
feat(st-regulator): support regulator_set_voltage for fixed regulator
Always support the regulator_set_voltage operation for the same voltage. This patch prepares the DDR power configuration when the power supplies are fixed. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Maxime Méré <maxime.mere@foss.st.com> Change-Id: Idf032b03c6f0c95f997dec3ed8a0d38c54a3de15
This commit is contained in:
parent
6897ae8d0f
commit
156ed9724f
1 changed files with 8 additions and 4 deletions
|
@ -215,14 +215,18 @@ int regulator_set_voltage(struct rdev *rdev, uint16_t mvolt)
|
|||
|
||||
VERBOSE("%s: set mvolt\n", rdev->desc->node_name);
|
||||
|
||||
if (rdev->desc->ops->set_voltage == NULL) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if ((mvolt < rdev->min_mv) || (mvolt > rdev->max_mv)) {
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
if (regulator_get_voltage(rdev) == mvolt) {
|
||||
return 0U;
|
||||
}
|
||||
|
||||
if (rdev->desc->ops->set_voltage == NULL) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
lock_driver(rdev);
|
||||
|
||||
ret = rdev->desc->ops->set_voltage(rdev->desc, mvolt);
|
||||
|
|
Loading…
Add table
Reference in a new issue