diff options
author | Esben Haabendal <eha@doredevelopment.dk> | 2011-05-24 20:13:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:49 -0400 |
commit | fff26f8141145e01eae8f4d6e642ac8a0d500158 (patch) | |
tree | 4da2d503bbb242118fdde980e045779846864a14 /drivers/leds/leds.h | |
parent | 5ff77428e55c152ef75a6967f3266db79926fbde (diff) |
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/leds.h')
-rw-r--r-- | drivers/leds/leds.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h index 2dd8ecbfdc31..e77c7f8dcdd4 100644 --- a/drivers/leds/leds.h +++ b/drivers/leds/leds.h | |||
@@ -40,10 +40,17 @@ void led_trigger_set_default(struct led_classdev *led_cdev); | |||
40 | void led_trigger_set(struct led_classdev *led_cdev, | 40 | void led_trigger_set(struct led_classdev *led_cdev, |
41 | struct led_trigger *trigger); | 41 | struct led_trigger *trigger); |
42 | void led_trigger_remove(struct led_classdev *led_cdev); | 42 | void led_trigger_remove(struct led_classdev *led_cdev); |
43 | |||
44 | static inline void *led_get_trigger_data(struct led_classdev *led_cdev) | ||
45 | { | ||
46 | return led_cdev->trigger_data; | ||
47 | } | ||
48 | |||
43 | #else | 49 | #else |
44 | #define led_trigger_set_default(x) do {} while (0) | 50 | #define led_trigger_set_default(x) do {} while (0) |
45 | #define led_trigger_set(x, y) do {} while (0) | 51 | #define led_trigger_set(x, y) do {} while (0) |
46 | #define led_trigger_remove(x) do {} while (0) | 52 | #define led_trigger_remove(x) do {} while (0) |
53 | #define led_get_trigger_data(x) (NULL) | ||
47 | #endif | 54 | #endif |
48 | 55 | ||
49 | ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, | 56 | ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, |