|
32 | 32 | #include <zephyr/logging/log.h> |
33 | 33 | LOG_MODULE_REGISTER(rtl87x2g_pm, LOG_LEVEL_INF); |
34 | 34 |
|
| 35 | +#define REALTEK_PM_STATISTICS 0 |
| 36 | + |
35 | 37 | struct k_work work_timeout_process; |
36 | 38 | struct k_work work_device_resume; |
37 | 39 |
|
@@ -200,13 +202,32 @@ static int rtl87x2g_power_init(void) |
200 | 202 |
|
201 | 203 | z_arm_nmi_set_handler(NMI_Handler); |
202 | 204 |
|
| 205 | + LOG_INF("Original EXIT stage time = %d, Original ENTER stage time = %d", |
| 206 | + platform_pm_system.stage_time[PLATFORM_PM_EXIT], |
| 207 | + platform_pm_system.stage_time[PLATFORM_PM_ENTER]); |
| 208 | + |
| 209 | + platform_pm_system.stage_time[PLATFORM_PM_EXIT] = 30; |
| 210 | + platform_pm_system.stage_time[PLATFORM_PM_ENTER] = 50; |
| 211 | + |
| 212 | + LOG_INF("Updated EXIT stage time = %d, Updated ENTER stage time = %d", |
| 213 | + platform_pm_system.stage_time[PLATFORM_PM_EXIT], |
| 214 | + platform_pm_system.stage_time[PLATFORM_PM_ENTER]); |
| 215 | + |
203 | 216 | platform_pm_register_callback_func_with_priority((void *)pm_suspend_devices_rtk, |
204 | | - PLATFORM_PM_STORE, 1); |
| 217 | + PLATFORM_PM_ENTER, 1); |
205 | 218 | platform_pm_register_callback_func_with_priority((void *)pm_resume_devices_rtk, |
206 | 219 | PLATFORM_PM_PEND, -1); |
207 | 220 | platform_pm_register_callback_func_with_priority( |
208 | 221 | (void *)pm_reusme_systick_and_process_timeout, PLATFORM_PM_PEND, INT8_MAX); |
209 | 222 |
|
| 223 | +#if REALTEK_PM_STATISTICS |
| 224 | + platform_pm_feature_cfg.platform_stage_time = 1; |
| 225 | + platform_pm_feature_cfg.platform_statistics = 1; |
| 226 | + platform_pm_feature_cfg.platform_check_dbg = 1; |
| 227 | + platform_pm_feature_cfg.platform_enter_dbg = 1; |
| 228 | + platform_pm_feature_cfg.platform_exit_dbg = 1; |
| 229 | +#endif |
| 230 | + |
210 | 231 | return ret; |
211 | 232 | } |
212 | 233 |
|
|
0 commit comments