aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-triggers.c
diff options
context:
space:
mode:
authorFabio Baltieri <fabio.baltieri@gmail.com>2012-08-15 09:44:34 -0400
committerBryan Wu <bryan.wu@canonical.com>2012-09-11 06:32:40 -0400
commitd23a22a74fded23a12434c9463fe66cec2b0afcd (patch)
tree65b61353a251d780a7b5f854d1b56cb8d8ca4764 /drivers/leds/led-triggers.c
parent490dcee9b433302da4ec5325c3e69a0be1201473 (diff)
leds: delay led_set_brightness if stopping soft-blink
Delay execution of led_set_brightness() if need to stop soft-blink timer. This allows led_set_brightness to be called in hard-irq context even if soft-blink was activated on that LED. Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Cc: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds/led-triggers.c')
-rw-r--r--drivers/leds/led-triggers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 363975b3c925..b53bf54023f6 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -109,6 +109,8 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
109 list_del(&led_cdev->trig_list); 109 list_del(&led_cdev->trig_list);
110 write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock, 110 write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock,
111 flags); 111 flags);
112 cancel_work_sync(&led_cdev->set_brightness_work);
113 led_stop_software_blink(led_cdev);
112 if (led_cdev->trigger->deactivate) 114 if (led_cdev->trigger->deactivate)
113 led_cdev->trigger->deactivate(led_cdev); 115 led_cdev->trigger->deactivate(led_cdev);
114 led_cdev->trigger = NULL; 116 led_cdev->trigger = NULL;
@@ -224,7 +226,7 @@ void led_trigger_event(struct led_trigger *trig,
224 struct led_classdev *led_cdev; 226 struct led_classdev *led_cdev;
225 227
226 led_cdev = list_entry(entry, struct led_classdev, trig_list); 228 led_cdev = list_entry(entry, struct led_classdev, trig_list);
227 __led_set_brightness(led_cdev, brightness); 229 led_set_brightness(led_cdev, brightness);
228 } 230 }
229 read_unlock(&trig->leddev_list_lock); 231 read_unlock(&trig->leddev_list_lock);
230} 232}