aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/led-core.c')
-rw-r--r--drivers/leds/led-core.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 2ab05af3de31..ce8921a753a3 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -103,13 +103,23 @@ void led_blink_set_oneshot(struct led_classdev *led_cdev,
103} 103}
104EXPORT_SYMBOL(led_blink_set_oneshot); 104EXPORT_SYMBOL(led_blink_set_oneshot);
105 105
106void led_set_brightness(struct led_classdev *led_cdev, 106void led_stop_software_blink(struct led_classdev *led_cdev)
107 enum led_brightness brightness)
108{ 107{
109 /* stop and clear soft-blink timer */
110 del_timer_sync(&led_cdev->blink_timer); 108 del_timer_sync(&led_cdev->blink_timer);
111 led_cdev->blink_delay_on = 0; 109 led_cdev->blink_delay_on = 0;
112 led_cdev->blink_delay_off = 0; 110 led_cdev->blink_delay_off = 0;
111}
112EXPORT_SYMBOL_GPL(led_stop_software_blink);
113
114void led_set_brightness(struct led_classdev *led_cdev,
115 enum led_brightness brightness)
116{
117 /* delay brightness setting if need to stop soft-blink timer */
118 if (led_cdev->blink_delay_on || led_cdev->blink_delay_off) {
119 led_cdev->delayed_set_value = brightness;
120 schedule_work(&led_cdev->set_brightness_work);
121 return;
122 }
113 123
114 __led_set_brightness(led_cdev, brightness); 124 __led_set_brightness(led_cdev, brightness);
115} 125}