backlight: pwm_bl: fix the state check in power-off

If the default-brightness-level is 0 and related pwm
has been enabled in uboot, the pwm_backlight may not
actually be turned off.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I92c0c363a13040e300dd8aa2d40edcad87fa50d0
This commit is contained in:
Damon Ding
2023-10-26 15:29:32 +08:00
committed by Tao Huang
parent 99f2737534
commit 18df0d10b7

View File

@@ -74,7 +74,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb)
struct pwm_state state;
pwm_get_state(pb->pwm, &state);
if (!pb->enabled)
if (!pb->enabled && !state.enabled)
return;
if (pb->enable_gpio)