diff options
author | Esben Haabendal <eha@doredevelopment.dk> | 2011-05-25 02:13:22 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 17:39:49 +0200 |
commit | fff26f8141145e01eae8f4d6e642ac8a0d500158 (patch) | |
tree | 4da2d503bbb242118fdde980e045779846864a14 /drivers/leds/ledtrig-timer.c | |
parent | MAINTAINERS: orphan DMFE, move Tobias Ringstrom to CREDITS (diff) | |
download | linux-fff26f8141145e01eae8f4d6e642ac8a0d500158.tar.xz linux-fff26f8141145e01eae8f4d6e642ac8a0d500158.zip |
leds: support automatic start of blinking with ledtrig-timer
By setting initial values blink_delay_on and blink_delay_off in a
led_classdev struct, this change starts the blinking when the led is
initialized.
With this patch, you can initialize blink_delay_on and blink_delay_off in
led_classdev with default_trigger set to "timer", and the led will start
up blinking. The current ledtrig-timer implementation ignores any initial
blink_delay_on/blink_delay_off settings, and requires setting
blink_delay_on/blink_delay_off (typically from userspace) before the led
blinks.
Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/leds/ledtrig-timer.c')
-rw-r--r-- | drivers/leds/ledtrig-timer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c index b09bcbeade9c..d87c9d02f786 100644 --- a/drivers/leds/ledtrig-timer.c +++ b/drivers/leds/ledtrig-timer.c @@ -91,6 +91,9 @@ static void timer_trig_activate(struct led_classdev *led_cdev) if (rc) goto err_out_delayon; + led_blink_set(led_cdev, &led_cdev->blink_delay_on, + &led_cdev->blink_delay_off); + led_cdev->trigger_data = (void *)1; return; |