Skip to content

Commit 4600619

Browse files
6by9popcornmix
authored andcommitted
regulator/rpi-panel-v2: Disable the PWM when off
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent e349a24 commit 4600619

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/regulator/rpi-panel-v2-regulator.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ static int rpi_panel_v2_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
4848
return regmap_write(regmap, REG_PWM, 0);
4949

5050
duty = pwm_get_relative_duty_cycle(state, PWM_BL_MASK);
51-
return regmap_write(regmap, REG_PWM, duty | PWM_BL_ENABLE);
51+
if (duty)
52+
duty |= PWM_BL_ENABLE;
53+
54+
return regmap_write(regmap, REG_PWM, duty);
5255
}
5356

5457
static const struct pwm_ops rpi_panel_v2_pwm_ops = {

0 commit comments

Comments
 (0)