mindboards/ev3dev-kernel — pull request #5 by dlech (2013-11-27 19:49:12+00:00)
Title: use leds-gpio dirver for LEDs

It turns out there is an existing kernel driver for gpio LEDs as well. It It lets you do cool things like use the LEDs to indicate CPU activity as well as indicating disk activity. There is also a timer mode that lets you flash the LEDs with a user specified duty cycle. And of course, you can just turn them on and off.

Docs: https://www.kernel.org/doc/Documentation/leds/leds-class.txt

I have this setup so that during boot, the left LED flashes orange to indicate CPU activity ("heartbeat") and the right LED flashes orange to indicate SD card activity ("mmc0"). I would like to add a script to the init so that when boot is complete, both LEDs turn solid green.

Also for this to work, we need to set some kernel options:
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y