[PATCH 2/2] backlight: pwm_bl: Don't disable the PWM to disable the backlight

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Jan 9 20:47:58 UTC 2023


Most but not all PWMs drive the PWM pin to its inactive state when
disabled. Rely on the lowlevel PWM implementation to implement
duty_cycle = 0 in an energy efficient way and don't disable the PWM.

This fixes backlight disabling e.g. on i.MX6 when an inverted PWM is
used.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 drivers/video/backlight/pwm_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 0509fecd5715..7bdc5d570a12 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -109,7 +109,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
 		pwm_backlight_power_off(pb);
 
 		pwm_get_state(pb->pwm, &state);
-		state.enabled = false;
+		state.enabled = true;
 		state.duty_cycle = 0;
 		pwm_apply_state(pb->pwm, &state);
 	}
-- 
2.39.0



More information about the dri-devel mailing list