1 /* 2 * Copyright (c) 2025, Mediatek Inc. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef MT_SPM_STATS_H 8 #define MT_SPM_STATS_H 9 10 #include <stdint.h> 11 12 enum spm_stat_type { 13 SPM_SLP_COUNT, 14 SPM_SLP_DURATION, 15 }; 16 17 enum spm_stat_state { 18 SPM_STAT_MCUSYS, 19 SPM_STAT_F26M, 20 SPM_STAT_VCORE, 21 SPM_STAT_D1_2, 22 SPM_STAT_D2, 23 SPM_STAT_D3, 24 SPM_STAT_D4, 25 SPM_STAT_D6X, 26 NUM_SPM_STAT, 27 }; 28 29 struct spm_lp_stat_record { 30 uint64_t count; 31 uint64_t duration; 32 }; 33 34 struct spm_lp_stat { 35 struct spm_lp_stat_record record[NUM_SPM_STAT]; 36 }; 37 38 void mt_spm_update_lp_stat(struct spm_lp_stat *stat); 39 40 uint64_t mt_spm_get_lp_stat(struct spm_lp_stat *stat, 41 uint32_t index, uint32_t type); 42 43 #endif /* MT_SPM_STATS_H */ 44