We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa172ba commit 974afccCopy full SHA for 974afcc
drivers/leds/leds-pwm.c
@@ -53,7 +53,13 @@ static int led_pwm_set(struct led_classdev *led_cdev,
53
duty = led_dat->pwmstate.period - duty;
54
55
led_dat->pwmstate.duty_cycle = duty;
56
- led_dat->pwmstate.enabled = true;
+ /*
57
+ * Disabling a PWM doesn't guarantee that it emits the inactive level.
58
+ * So keep it on. Only for suspending the PWM should be disabled because
59
+ * otherwise it refuses to suspend. The possible downside is that the
60
+ * LED might stay (or even go) on.
61
+ */
62
+ led_dat->pwmstate.enabled = !(led_cdev->flags & LED_SUSPENDED);
63
return pwm_apply_might_sleep(led_dat->pwm, &led_dat->pwmstate);
64
}
65
0 commit comments