backlight: Fix dimmed display doesn't go to sleep

Firmware didn't start sleep countdown if
1. Display was already dimmed
2. Fade out timer was set

You can reproduce this by:
1. Set fade out timer. For example, 500ms
2. Wait till display will be dimmed and go to sleep
3. Switch hold ON or plug headphones

Change-Id: I27ca857aa8db4551bd9caad4815cd73a64bf6185
This commit is contained in:
Petr Mikhalicin 2026-01-03 20:16:20 +05:00 committed by Solomon Peachy
parent ad10ed806b
commit 246bf4af75

View file

@ -387,7 +387,8 @@ static void backlight_setup_fade_up(void)
static void backlight_setup_fade_down(void)
{
if (bl_fade_out_step > 0)
/* Start fading display if it's not dimmed yet */
if (bl_fade_out_step > 0 && bl_dim_current > 0)
{
backlight_dim(0);
}