xref: /optee_os/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.h (revision c610605d51b82548ab6f8226b1576407083485c0)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright (c) 2017-2020, STMicroelectronics
4  */
5 
6 #ifndef __STM32MP1_PMIC_H__
7 #define __STM32MP1_PMIC_H__
8 
9 #include <kernel/panic.h>
10 
11 #ifdef CFG_STPMIC1
12 void stm32mp_pmic_apply_boot_on_config(void);
13 void stm32mp_pmic_apply_lp_config(const char *lp_state);
14 void stm32mp_get_pmic(void);
15 void stm32mp_put_pmic(void);
16 const char *stm32mp_pmic_get_cpu_supply_name(void);
17 
18 /* Get the PMIC regulator related to @name or NULL if not found */
19 struct regulator *stm32mp_pmic_get_regulator(const char *name);
20 #else
stm32mp_pmic_apply_boot_on_config(void)21 static inline void stm32mp_pmic_apply_boot_on_config(void)
22 {
23 }
24 
stm32mp_pmic_apply_lp_config(const char * lp_state __unused)25 static inline void stm32mp_pmic_apply_lp_config(const char *lp_state __unused)
26 {
27 }
28 
stm32mp_get_pmic(void)29 static inline void stm32mp_get_pmic(void)
30 {
31 	panic();
32 }
33 
stm32mp_put_pmic(void)34 static inline void stm32mp_put_pmic(void)
35 {
36 	panic();
37 }
38 
stm32mp_pmic_get_cpu_supply_name(void)39 static inline const char *stm32mp_pmic_get_cpu_supply_name(void)
40 {
41 	return NULL;
42 }
43 
44 static inline struct regulator *
stm32mp_pmic_get_regulator(const char * name __unused)45 stm32mp_pmic_get_regulator(const char *name __unused)
46 {
47 	return NULL;
48 }
49 #endif
50 
51 #endif /*__STM32MP1_PMIC_H__*/
52