arm-trusted-firmware/plat/mediatek/drivers/spm/mt8196/mt_spm_pmic_lp.h
Wenzhen Yu e8e87683f2 feat(mt8196): enable PMIC low power setting
During suspend, it is necessary to set some power rails of the PMIC
to enter low power mode to achieve power saving.

Signed-off-by: Wenzhen Yu <wenzhen.yu@mediatek.com>
Change-Id: Iaeadd15270e0209f027fab80f478ad621bd59ea7
2025-01-22 15:27:52 +08:00

74 lines
1.2 KiB
C

/*
* Copyright (c) 2025, Mediatek Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef MT_SPM_PMIC_LP_H
#define MT_SPM_PMIC_LP_H
enum SPM_PWR_TYPE {
SPM_LP_ENTER,
SPM_LP_RESUME
};
enum {
LP_MT6363 = 0,
LP_MT6373,
LP_MT6316_1,
LP_MT6316_2,
LP_MT6316_3,
LP_MT6316_4,
LP_PMIC_SLAVE_NUM,
};
#ifdef MTK_SPM_PMIC_LP_SUPPORT
void set_vcore_lp_enable(bool enable);
bool get_vcore_lp_enable(void);
void set_vsram_lp_enable(bool enable);
bool get_vsram_lp_enable(void);
void set_vsram_lp_volt(uint32_t volt);
uint32_t get_vsram_lp_volt(void);
int do_spm_low_power(enum SPM_PWR_TYPE type, uint32_t cmd);
#else
static inline void set_vcore_lp_enable(bool enable)
{
(void)enable;
}
static inline bool get_vcore_lp_enable(void)
{
return false;
}
static inline void set_vsram_lp_enable(bool enable)
{
(void)enable;
}
static inline bool get_vsram_lp_enable(void)
{
return false;
}
static inline void set_vsram_lp_volt(uint32_t volt)
{
(void)volt;
}
static inline uint32_t get_vsram_lp_volt(void)
{
return 0;
}
static inline int do_spm_low_power(enum SPM_PWR_TYPE type, uint32_t cmd)
{
(void)type;
(void)cmd;
return 0;
}
#endif /* MTK_SPM_PMIC_LP_SUPPORT */
#endif /* MT_SPM_PMIC_LP_H */