mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00
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
This commit is contained in:
parent
1c37d0c1d3
commit
5278ec3faf
2 changed files with 38 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2021, STMicroelectronics - All Rights Reserved
|
||||
* Copyright (c) 2017-2022, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -48,4 +48,11 @@ static inline void print_pmic_info_and_debug(void)
|
|||
*/
|
||||
int pmic_ddr_power_init(enum ddr_type ddr_type);
|
||||
|
||||
/*
|
||||
* pmic_voltages_init - Update voltages for platform init
|
||||
*
|
||||
* Returns 0 on success, and negative values on errors
|
||||
*/
|
||||
int pmic_voltages_init(void);
|
||||
|
||||
#endif /* STM32MP_PMIC_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue