xref: /rk3399_ARM-atf/plat/mediatek/drivers/spm/mt8196/mt_spm_pmic_lp.h (revision b62673c645752a78f649282cfa293e8da09e3bef)
1 /*
2  * Copyright (c) 2025, Mediatek Inc. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef MT_SPM_PMIC_LP_H
8 #define MT_SPM_PMIC_LP_H
9 
10 enum SPM_PWR_TYPE {
11 	SPM_LP_ENTER,
12 	SPM_LP_RESUME
13 };
14 
15 enum {
16 	LP_MT6363 = 0,
17 	LP_MT6373,
18 	LP_MT6316_1,
19 	LP_MT6316_2,
20 	LP_MT6316_3,
21 	LP_MT6316_4,
22 	LP_PMIC_SLAVE_NUM,
23 };
24 
25 #ifdef MTK_SPM_PMIC_LP_SUPPORT
26 void set_vcore_lp_enable(bool enable);
27 bool get_vcore_lp_enable(void);
28 
29 void set_vsram_lp_enable(bool enable);
30 bool get_vsram_lp_enable(void);
31 void set_vsram_lp_volt(uint32_t volt);
32 uint32_t get_vsram_lp_volt(void);
33 
34 int do_spm_low_power(enum SPM_PWR_TYPE type, uint32_t cmd);
35 #else
36 static inline void set_vcore_lp_enable(bool enable)
37 {
38 	(void)enable;
39 }
40 
41 static inline bool get_vcore_lp_enable(void)
42 {
43 	return false;
44 }
45 
46 static inline void set_vsram_lp_enable(bool enable)
47 {
48 	(void)enable;
49 }
50 
51 static inline bool get_vsram_lp_enable(void)
52 {
53 	return false;
54 }
55 
56 static inline void set_vsram_lp_volt(uint32_t volt)
57 {
58 	(void)volt;
59 }
60 
61 static inline uint32_t get_vsram_lp_volt(void)
62 {
63 	return 0;
64 }
65 
66 static inline int do_spm_low_power(enum SPM_PWR_TYPE type, uint32_t cmd)
67 {
68 	(void)type;
69 	(void)cmd;
70 	return 0;
71 }
72 #endif /* MTK_SPM_PMIC_LP_SUPPORT */
73 
74 #endif /* MT_SPM_PMIC_LP_H */
75