stm32mp_pmic.h 1.13 KB
Newer Older
Yann Gautier's avatar
Yann Gautier committed
1
/*
2
 * Copyright (c) 2017-2019, STMicroelectronics - All Rights Reserved
Yann Gautier's avatar
Yann Gautier committed
3
4
5
6
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

7
8
#ifndef STM32MP_PMIC_H
#define STM32MP_PMIC_H
Yann Gautier's avatar
Yann Gautier committed
9
10
11

#include <stdbool.h>

12
#include <platform_def.h>
13

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * dt_pmic_status - Check PMIC status from device tree
 *
 * Returns the status of the PMIC (secure, non-secure), or a negative value on
 * error
 */
int dt_pmic_status(void);

/*
 * dt_pmic_configure_boot_on_regulators - Configure boot-on and always-on
 * regulators from device tree configuration
 *
 * Returns 0 on success, and negative values on errors
 */
int dt_pmic_configure_boot_on_regulators(void);

/*
 * initialize_pmic_i2c - Initialize I2C for the PMIC control
 *
 * Returns true if PMIC is available, false if not found, panics on errors
 */
bool initialize_pmic_i2c(void);

/*
 * initialize_pmic - Main PMIC initialization function, called at platform init
 *
 * Panics on errors
 */
Yann Gautier's avatar
Yann Gautier committed
42
void initialize_pmic(void);
43
44
45
46
47
48

/*
 * pmic_ddr_power_init - Initialize regulators required for DDR
 *
 * Returns 0 on success, and negative values on errors
 */
Yann Gautier's avatar
Yann Gautier committed
49
50
int pmic_ddr_power_init(enum ddr_type ddr_type);

51
#endif /* STM32MP_PMIC_H */