xref: /rk3399_ARM-atf/plat/mediatek/drivers/spm/version/pmic_wrap/inc/mt_spm_pmic_wrap.h (revision cf2df874cd09305ac7282fadb0fef6be597dfffb)
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_WRAP_H
8 #define MT_SPM_PMIC_WRAP_H
9 
10 struct pmic_wrap_cmd_setting {
11 	uint32_t spm_pwrap_addr;
12 	uint32_t cmd_addr;
13 	uint32_t cmd_data;
14 };
15 
16 struct pmic_wrap_phase_setting {
17 	struct pmic_wrap_cmd_setting *cmd;
18 	unsigned int nr_idx;
19 };
20 
21 struct pmic_wrap_setting {
22 	struct pmic_wrap_phase_setting *phase;
23 	const unsigned int phase_nr_idx;
24 };
25 
26 int mt_spm_pmic_wrap_set_phase(unsigned int phase);
27 int mt_spm_pmic_wrap_set_cmd(unsigned int phase,
28 			     unsigned int idx, unsigned int cmd_data);
29 unsigned long mt_spm_pmic_wrap_get_cmd(unsigned int phase, unsigned int idx);
30 void mt_spm_pmic_wrap_set_table(struct pmic_wrap_setting *pw);
31 
32 #endif /* MT_SPM_PMIC_WRAP_H */
33