summaryrefslogtreecommitdiff
path: root/drivers/st
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2022-01-18 15:49:42 +0100
committerYann Gautier <yann.gautier@st.com>2022-03-22 09:09:23 +0100
commit5278ec3faf2010fd6aea1d8cd4294dd229c5c21d (patch)
tree9e1ba03e1e480a86b19acba9b1455eb9ab0a76be /drivers/st
parent1c37d0c1d378769249c797de5b13d73cf6f17a53 (diff)
downloadarm-trusted-firmware-5278ec3faf2010fd6aea1d8cd4294dd229c5c21d.tar.gz
feat(st-pmic): add pmic_voltages_init() function
This new function pmic_voltages_init() is used to set the minimum value for STM32MP13 VDDCPU and VDDCORE regulators. This value is retrieved from device tree. Signed-off-by: Yann Gautier <yann.gautier@st.com> Change-Id: Ibbe237cb5dccc1fddf92e07ffd3955048ff82075
Diffstat (limited to 'drivers/st')
-rw-r--r--drivers/st/pmic/stm32mp_pmic.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/st/pmic/stm32mp_pmic.c b/drivers/st/pmic/stm32mp_pmic.c
index a1031fdd3..5b4376041 100644
--- a/drivers/st/pmic/stm32mp_pmic.c
+++ b/drivers/st/pmic/stm32mp_pmic.c
@@ -329,6 +329,36 @@ int pmic_ddr_power_init(enum ddr_type ddr_type)
return 0;
}
+int pmic_voltages_init(void)
+{
+#if STM32MP13
+ struct rdev *buck1, *buck4;
+ int status;
+
+ buck1 = regulator_get_by_name("buck1");
+ if (buck1 == NULL) {
+ return -ENOENT;
+ }
+
+ buck4 = regulator_get_by_name("buck4");
+ if (buck4 == NULL) {
+ return -ENOENT;
+ }
+
+ status = regulator_set_min_voltage(buck1);
+ if (status != 0) {
+ return status;
+ }
+
+ status = regulator_set_min_voltage(buck4);
+ if (status != 0) {
+ return status;
+ }
+#endif
+
+ return 0;
+}
+
enum {
STPMIC1_BUCK1 = 0,
STPMIC1_BUCK2,