[PATCH 5/5] led: Add default-on trigger
Sascha Hauer
s.hauer at pengutronix.de
Fri Feb 28 09:24:55 EST 2014
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/led/led-triggers.c | 3 +++
include/led.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/led/led-triggers.c b/drivers/led/led-triggers.c
index 7555eee..5eaf732 100644
--- a/drivers/led/led-triggers.c
+++ b/drivers/led/led-triggers.c
@@ -124,6 +124,9 @@ int led_set_trigger(enum led_trigger trigger, struct led *led)
triggers[trigger].led = led;
+ if (trigger == LED_TRIGGER_DEFAULT_ON)
+ led_set(triggers[trigger].led, triggers[trigger].led->max_value);
+
return 0;
}
diff --git a/include/led.h b/include/led.h
index 0217f4b..f17621e 100644
--- a/include/led.h
+++ b/include/led.h
@@ -33,6 +33,7 @@ enum led_trigger {
LED_TRIGGER_NET_RX,
LED_TRIGGER_NET_TX,
LED_TRIGGER_NET_TXRX,
+ LED_TRIGGER_DEFAULT_ON,
LED_TRIGGER_MAX,
};
--
1.8.5.3
More information about the barebox
mailing list