[PATCH] LED: add LED trigger tupport

Add support for LED triggers to the LED subsystem.  "Triggers" are events
which change the state of an LED.  Two kinds of trigger are available, simple
ones which can be added to exising code with minimum disruption and complex
ones for implementing new or more complex functionality.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Richard Purdie
2006-03-31 02:31:05 -08:00
committed by Linus Torvalds
parent c72a1d608d
commit c3bc9956ec
6 changed files with 333 additions and 0 deletions

View File

@@ -28,4 +28,17 @@ static inline void led_set_brightness(struct led_classdev *led_cdev,
extern rwlock_t leds_list_lock;
extern struct list_head leds_list;
#ifdef CONFIG_LEDS_TRIGGERS
void led_trigger_set_default(struct led_classdev *led_cdev);
void led_trigger_set(struct led_classdev *led_cdev,
struct led_trigger *trigger);
#else
#define led_trigger_set_default(x) do {} while(0)
#define led_trigger_set(x, y) do {} while(0)
#endif
ssize_t led_trigger_store(struct class_device *dev, const char *buf,
size_t count);
ssize_t led_trigger_show(struct class_device *dev, char *buf);
#endif /* __LEDS_H_INCLUDED */