Linux Kernel Interface To Finally Allow For Programmable LED Patterns

Written by Michael Larabel in Linux Kernel on 22 October 2018 at 06:11 PM EDT. 32 Comments
LINUX KERNEL
It's not often we get to talk about the LED drivers for the Linux kernel... Yes, the class of Linux kernel drivers to support controlling the brightness of LEDs via supported drivers and exposing that to user-space. With Linux 4.20~5.0 comes finally the ability to program "patterns" for LEDs.

The feature seems long overdue given all of the RGB lighting rage among PC enthusiasts and a lot of Windows LED control software allowing pre-set patterns to be applied to LED lights. With the next kernel cycle will come the ability to have a - standardized interface - for pattern triggers within the LED class of Linux kernel drivers. This functionality was proposed years ago for the Linux kernel LED drivers but failed to materialize until recently.

From user-space (a new pattern file within /sys/class/leds) allows writing a pattern that consists of a series of brightness levels for the LED and durations (in milliseconds) for being able to loop through a series of LED brightness levels on a timed basis. The pattern can be repeated based upon a new repeat sysfs file.

Besides these software patterns, the new core code also allows for hardware patterns to be applied -- contingent upon the LED hardware's capabilities and any built-in patterns it may support.

This LED pattern trigger support is the main addition as part of the LED updates submitted today for the Linux 4.20~5.0 cycle.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week