This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LED
#1
Information 
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
I left this community in Aug 2017 due to ASUS bad product quality and ASUS community support that did not match my expectation.  Sad
Reply
#2
Thumbs Up 
(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.
Reply
#3
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)