Hello,
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 {
lable="led_red";
gpios = <&gpio2 4 0>;
}
Not looking to use triggers also.
Can anyone give pointers how to do that ? any referance code .
Thanks,
Surendra
Note:
The SysFs driver has been tested and is working. It has been accepted into the mainline kernel and the old char mode GPIO driver that didn't work with arch/powerpc has been removed from the tree.
The SysFs interface is a very simple way to access the GPIO from user space and has the advantage of requiring very little setup.
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------