summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 17:14:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 17:14:06 +0000
commite616d72f8b12df275e5afd05b0f5ed251f6d56a1 (patch)
treecfbdd162315fce0266b5aa12c070ff08a6d8f4a7 /drivers/leds
parentReleasing progress-linux version 6.9.2-1~exp1~progress7.99u1. (diff)
downloadlinux-e616d72f8b12df275e5afd05b0f5ed251f6d56a1.tar.xz
linux-e616d72f8b12df275e5afd05b0f5ed251f6d56a1.zip
Merging upstream version 6.9.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--drivers/leds/led-class.c6
-rw-r--r--drivers/leds/leds-pwm.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 24fcff682b..ba1be15cfd 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -552,12 +552,6 @@ int led_classdev_register_ext(struct device *parent,
led_init_core(led_cdev);
#ifdef CONFIG_LEDS_TRIGGERS
- /*
- * If no default trigger was given and hw_control_trigger is set,
- * make it the default trigger.
- */
- if (!led_cdev->default_trigger && led_cdev->hw_control_trigger)
- led_cdev->default_trigger = led_cdev->hw_control_trigger;
led_trigger_set_default(led_cdev);
#endif
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 4e3936a39d..e1b414b403 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -53,7 +53,13 @@ static int led_pwm_set(struct led_classdev *led_cdev,
duty = led_dat->pwmstate.period - duty;
led_dat->pwmstate.duty_cycle = duty;
- led_dat->pwmstate.enabled = true;
+ /*
+ * Disabling a PWM doesn't guarantee that it emits the inactive level.
+ * So keep it on. Only for suspending the PWM should be disabled because
+ * otherwise it refuses to suspend. The possible downside is that the
+ * LED might stay (or even go) on.
+ */
+ led_dat->pwmstate.enabled = !(led_cdev->flags & LED_SUSPENDED);
return pwm_apply_might_sleep(led_dat->pwm, &led_dat->pwmstate);
}