led: Implement software led blinking
If hardware (or driver) doesn't support leds blinking, it's
now possible to use software implementation of blinking instead.
This relies on cyclic functions.
Signed-off-by: Michael Polyntsov <michael.polyntsov@iopsys.eu>
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig
index 9837960..bee74b2 100644
--- a/drivers/led/Kconfig
+++ b/drivers/led/Kconfig
@@ -65,7 +65,7 @@
Linux compatible ofdata.
config LED_BLINK
- bool "Support LED blinking"
+ bool "Support hardware LED blinking"
depends on LED
help
Some drivers can support automatic blinking of LEDs with a given
@@ -73,6 +73,20 @@
This option enables support for this which adds slightly to the
code size.
+config LED_SW_BLINK
+ bool "Support software LED blinking"
+ depends on LED
+ select CYCLIC
+ help
+ Turns on led blinking implemented in the software, useful when
+ the hardware doesn't support led blinking. Half of the period
+ led will be ON and the rest time it will be OFF. Standard
+ led commands can be used to configure blinking. Does nothing
+ if driver supports hardware blinking.
+ WARNING: Blinking may be inaccurate during execution of time
+ consuming commands (ex. flash reading). Also it completely
+ stops during OS booting.
+
config SPL_LED
bool "Enable LED support in SPL"
depends on SPL_DM