1 /*
2  * Copyright (c) 2017-2019, STMicroelectronics - All Rights Reserved
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef STM32MP_PMIC_H
8 #define STM32MP_PMIC_H
9 
10 #include <stdbool.h>
11 
12 #include <platform_def.h>
13 
14 /*
15  * dt_pmic_status - Check PMIC status from device tree
16  *
17  * Returns the status of the PMIC (secure, non-secure), or a negative value on
18  * error
19  */
20 int dt_pmic_status(void);
21 
22 /*
23  * dt_pmic_configure_boot_on_regulators - Configure boot-on and always-on
24  * regulators from device tree configuration
25  *
26  * Returns 0 on success, and negative values on errors
27  */
28 int dt_pmic_configure_boot_on_regulators(void);
29 
30 /*
31  * initialize_pmic_i2c - Initialize I2C for the PMIC control
32  *
33  * Returns true if PMIC is available, false if not found, panics on errors
34  */
35 bool initialize_pmic_i2c(void);
36 
37 /*
38  * initialize_pmic - Main PMIC initialization function, called at platform init
39  *
40  * Panics on errors
41  */
42 void initialize_pmic(void);
43 
44 /*
45  * pmic_ddr_power_init - Initialize regulators required for DDR
46  *
47  * Returns 0 on success, and negative values on errors
48  */
49 int pmic_ddr_power_init(enum ddr_type ddr_type);
50 
51 #endif /* STM32MP_PMIC_H */
52