From 918acdfef05bde8242672031c7c10430a1e6c165 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Tue, 14 Feb 2023 10:11:34 +0900 Subject: [PATCH] display: change sleep reason to DISPLAY_OFF_TIMEOUT Technically, the sleep request of display plugin is triggered by timer, not by display off itself. 1. Display off, display state is changed to S_LCDOFF. 2. Start timer, 300ms. 3. On expiring the timer, display state is changed to S_SLEEP. 4. The display plugin requests power module to change its state to DEVICED_POWER_STATE_SLEEP. Therefore, it is proper to use enum DISPLAY_OFF_TIMEOUT instead of just DISPLAY_OFF. Change-Id: I93e6d092ebcc23e09db61f65d8f0b7e4dc5aac7e Signed-off-by: Youngjae Cho --- plugins/iot-headed/display/core.c | 2 +- plugins/mobile/display/core.c | 2 +- plugins/tv/display/core.c | 2 +- plugins/wearable/display/core.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/iot-headed/display/core.c b/plugins/iot-headed/display/core.c index 2b7aa60..8e2fd12 100644 --- a/plugins/iot-headed/display/core.c +++ b/plugins/iot-headed/display/core.c @@ -1534,7 +1534,7 @@ go_suspend: #ifdef ENABLE_PM_LOG pm_history_save(PM_LOG_SLEEP, get_pm_cur_state()); #endif - power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF); + power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT); return 0; go_lcd_off: diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c index 11fe205..9078ff4 100644 --- a/plugins/mobile/display/core.c +++ b/plugins/mobile/display/core.c @@ -1544,7 +1544,7 @@ go_suspend: #ifdef ENABLE_PM_LOG pm_history_save(PM_LOG_SLEEP, get_pm_cur_state()); #endif - power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF); + power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT); return 0; go_lcd_off: diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c index 444f02c..90f4e67 100644 --- a/plugins/tv/display/core.c +++ b/plugins/tv/display/core.c @@ -1534,7 +1534,7 @@ go_suspend: #ifdef ENABLE_PM_LOG pm_history_save(PM_LOG_SLEEP, get_pm_cur_state()); #endif - power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF); + power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT); return 0; go_lcd_off: diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index 958b19a..3947491 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -1805,7 +1805,7 @@ go_suspend: #ifdef ENABLE_PM_LOG pm_history_save(PM_LOG_SLEEP, get_pm_cur_state()); #endif - power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF); + power_request_change_state(DEVICED_POWER_STATE_SLEEP, HAL_DEVICE_POWER_TRANSITION_REASON_DISPLAY_OFF_TIMEOUT); return 0; go_lcd_off: -- 2.7.4