leds: Add ability to blink via simple trigger
As blink API is now available, it's possible to add ability to blink via simple trigger. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
This commit is contained in:
parent
51d0756604
commit
0b9536c957
2 changed files with 23 additions and 0 deletions
|
@ -231,6 +231,26 @@ void led_trigger_event(struct led_trigger *trigger,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(led_trigger_event);
|
||||
|
||||
void led_trigger_blink(struct led_trigger *trigger,
|
||||
unsigned long *delay_on,
|
||||
unsigned long *delay_off)
|
||||
{
|
||||
struct list_head *entry;
|
||||
|
||||
if (!trigger)
|
||||
return;
|
||||
|
||||
read_lock(&trigger->leddev_list_lock);
|
||||
list_for_each(entry, &trigger->led_cdevs) {
|
||||
struct led_classdev *led_cdev;
|
||||
|
||||
led_cdev = list_entry(entry, struct led_classdev, trig_list);
|
||||
led_blink_set(led_cdev, delay_on, delay_off);
|
||||
}
|
||||
read_unlock(&trigger->leddev_list_lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(led_trigger_blink);
|
||||
|
||||
void led_trigger_register_simple(const char *name, struct led_trigger **tp)
|
||||
{
|
||||
struct led_trigger *trigger;
|
||||
|
|
|
@ -145,6 +145,9 @@ extern void led_trigger_register_simple(const char *name,
|
|||
extern void led_trigger_unregister_simple(struct led_trigger *trigger);
|
||||
extern void led_trigger_event(struct led_trigger *trigger,
|
||||
enum led_brightness event);
|
||||
extern void led_trigger_blink(struct led_trigger *trigger,
|
||||
unsigned long *delay_on,
|
||||
unsigned long *delay_off);
|
||||
|
||||
#else
|
||||
|
||||
|
|
Loading…
Reference in a new issue