AnsweredAssumed Answered

How to use GPIO-LEDS in another driver without sys interface?

Question asked by Surendra Dhobale on Sep 28, 2017
Latest reply on Oct 1, 2017 by Pavel Chubakov


         We have developed one custom driver module and its working fine. Now we have blink,ON,OFF led on different conditions in the drivers. We know the conditions. But unable to understand how to drive the LEDS in the driver?

We are able to ON/OFF LED using the /sys/class/ interface.

But how we can do in the drivers with LED API, which directly control the LED.

Also we define the leds in the device tree. How use this in the driver.?

leds {

            compatible = "gpio-leds"

            led1 {


                                 gpios = <&gpio2 4 0>;


      Not looking to use triggers also.

Can anyone give pointers how to do that ? any referance code .