Tinker Board Forum

Full Version: LED
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here is corrected LED DeviceTree GPIO binding and sample usage:

Code:
        gpio-leds {
                compatible = "gpio-leds";
                pwr-led {
                        gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "default-on";
                };
                act-led {
                        gpios=<&gpio1 24 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger="mmc0";
                };
                heartbeat-led {
                        gpios=<&gpio1 25 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger="heartbeat";
                };
        };

red led - steady light
green led (middle) - blink on mmc0 operation
yellow led - heartbeat (see https://www.kernel.org/doc/Documentation...common.txt)

To make heartbeat work need to enhance kernel configuration, like:

Code:
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_GPIO=y

Happy blinking  Idea
(04-16-2017, 12:23 PM)mcerveny Wrote: [ -> ]Here is corrected LED DeviceTree GPIO binding and sample usage:

Code:
        gpio-leds {
                compatible = "gpio-leds";
                pwr-led {
                        gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "default-on";
                };
                act-led {
                        gpios=<&gpio1 24 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger="mmc0";
                };
                heartbeat-led {
                        gpios=<&gpio1 25 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger="heartbeat";
                };
        };

red led - steady light
green led (middle) - blink on mmc0 operation
yellow led - heartbeat (see https://www.kernel.org/doc/Documentation...common.txt)

To make heartbeat work need to enhance kernel configuration, like:

Code:
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_GPIO=y

Happy blinking  Idea

Awesome.  I have gotten the device tree updated (sans camera bits, I forgot about them in my debugging of the other things)  I'll update that on my next round, the rk3288.dtsi is actually where most of the work had to be done...  In any case, using the LED bits from Eddie Cai's patch I have the LED's working in Armbian, it should be in tomorrow's nightly build.  Next for the actual driver work.

Oh, the vopl hack-fix is in there too, so 4k works properly.
thanks for the led info! succeeded.

but now i have to stop, to much vodka for hacking.

Big Grin

btw: looks nice in my self-printed semi-transparent case