From fd4ac69b105e45721b2d6316058afd24b4687ed0 Mon Sep 17 00:00:00 2001 From: Takumi Sueda Date: Tue, 28 Mar 2023 17:36:53 +0900 Subject: [PATCH] backlight: pwm_bl: wait 100us after setting duty cycle MXS PWM peripheral needs a little time to apply the latest config before being disabled --- drivers/video/backlight/pwm_bl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index e77d654791b4..04cefb0a83a7 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -80,10 +80,14 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) if (pb->pwm_off_delay) msleep(pb->pwm_off_delay); - state.enabled = false; state.duty_cycle = 0; pwm_apply_state(pb->pwm, &state); + udelay(100); + + state.enabled = false; + pwm_apply_state(pb->pwm, &state); + regulator_disable(pb->power_supply); pb->enabled = false; }