leds: Add documentation about possible subsystem improvements
PATCH 1/1 leds: Add documentation about possible subsystem improvements
commit f91fdbb47959537df6175cb4f0e6eb75757540f7
Author: Pavel Machek <[email protected]> Date: Fri Sep 25 11:29:17 2020 +0200
leds: Add documentation about possible subsystem improvements
Help welcome :-).
drivers/leds/TODO new file +58 -0
@@ -0,0 +1,58 @@ +-*- org -*- + +* On/off LEDs should have max_brightness of 1 +* Get rid of enum led_brightness + +It is really an integer, as maximum is configurable. Get rid of it, or +make it into typedef or something. + +* Review atomicity requirements in LED subsystem + +Calls that may and that may not block are mixed in same structure, and +semantics is sometimes non-intuitive. (For example blink callback may +not sleep.) Review the requirements for any bugs and document them +clearly. + +* LED names are still a mess + +No two LEDs have same name, so the names are probably unusable for the +userland. Nudge authors into creating common LED names for common +functionality. + +? Perhaps check for known LED names during boot, and warn if there are +LEDs not on the list? + +* Split drivers into subdirectories + +The number of drivers is getting big, and driver for on/off LED on a +i/o port is really quite different from camera flash LED, which is +really different from driver for RGB color LED that can run its own +microcode. Split the drivers somehow. + +* Figure out what to do with RGB leds + +Multicolor is a bit too abstract. Yes, we can have +Green-Magenta-Ultraviolet LED, but so far all the LEDs we support are +RGB, and not even RGB-White or RGB-Yellow variants emerged. + +Multicolor is not a good fit for RGB LED. It does not really know +about LED color. In particular, there's no way to make LED "white". + +Userspace is interested in knowing "this LED can produce arbitrary +color", which not all multicolor LEDs can. + + Proposal: let's add "rgb" to led_colors in drivers/leds/led-core.c, + add corresponding device tree defines, and use that, instead of + multicolor for RGB LEDs. + + We really need to do that now; "white" stuff can wait. + +RGB LEDs are quite common, and it would be good to be able to turn LED +white and to turn it into any arbitrary color. It is essential that +userspace is able to set arbitrary colors, and it might be good to +have that ability from kernel, too... to allow full-color triggers. + +* Command line utility to manipulate the LEDs? + +/sys interface is not really suitable to use by hand, should we have +an utility to perform LED control?
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
drivers/leds/TODO line 58
Quoted 6 lines · On Fri, 25 Sep 2020 11:33:18 +0200 Pavel Machek <[email protected]> wrote:
drivers/leds/TODO new file +4
-0+* Command line utility to manipulate the LEDs? + +/sys interface is not really suitable to use by hand, should we have +an utility to perform LED control?
I will try to implement ledtool.
Quoted 9 lines · Marek Behun
drivers/leds/TODO line 58
Quoted 4 lines · On Fri, 25 Sep 2020 11:33:18 +0200 Pavel Machek <[email protected]> wrote:
drivers/leds/TODO new file +4
-0+* Command line utility to manipulate the LEDs? + +/sys interface is not really suitable to use by hand, should we have +an utility to perform LED control?I will try to implement ledtool.
Actually.. I started something. How do you like Rust?
https://gitlab.com/tui/tui/-/blob/master/led/src/main.rs
In future, I'd like utility to accept both old and new names while we clean them up.
It would be also nice to have useful listing mode -- name, type, current brightness/trigger...
In future, it would be good to be able to set rgb led to particular color.
And probably user-friendly interface to access LEDs for particular ethernet interface would be nice.
Best regards,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 4 lines · On Sun, 27 Sep 2020 22:33:09 +0200 Pavel Machek <[email protected]> wrote:
Quoted 3 lines · Marek Behun
On Fri, 25 Sep 2020 11:33:18 +0200
Pavel Machek <[email protected]> wrote:
Quoted 9 lines
Quoted 6 lines
drivers/leds/TODO line 58
Quoted 4 lines
drivers/leds/TODO new file +4
-0+* Command line utility to manipulate the LEDs? + +/sys interface is not really suitable to use by hand, should we have +an utility to perform LED control?I will try to implement ledtool.
Actually.. I started something. How do you like Rust?
I've never written anything in Rust. I am not opposed to the language, since I don't know much about it (although I've heart praise for Rust from some people), but am not much enthuiastic about this program in particular to be written in it.
For embedded systems, for example, gcc was for a long time the only needed compiler. Now embedded system often need at least Python/Lua/Perl. If I wanted to embed this ledtool and it is written in Rust, I will need one more compiler and its environment.
So if you insist on Rust for ledtool, I will most probably pass, but I am still interested in working on the kernel part of the LED subsystem.
Marek
Quoted 17 lines
https://gitlab.com/tui/tui/-/blob/master/led/src/main.rs
In future, I'd like utility to accept both old and new names while we clean them up.
It would be also nice to have useful listing mode -- name, type, current brightness/trigger...
In future, it would be good to be able to set rgb led to particular color.
And probably user-friendly interface to access LEDs for particular ethernet interface would be nice.
Best regards,
Pavel
Quoted 17 lines · On Mon, 28 Sep 2020 01:10:39 +0200 Marek Behun <[email protected]> wrote:
Quoted 3 lines · On Sun, 27 Sep 2020 22:33:09 +0200 Pavel Machek <[email protected]> wrote:
Actually.. I started something. How do you like Rust?
I've never written anything in Rust. I am not opposed to the language, since I don't know much about it (although I've heart praise for Rust from some people), but am not much enthuiastic about this program in particular to be written in it.
For embedded systems, for example, gcc was for a long time the only needed compiler. Now embedded system often need at least Python/Lua/Perl. If I wanted to embed this ledtool and it is written in Rust, I will need one more compiler and its environment.
Quoted 5 lines
So if you insist on Rust for ledtool, I will most probably pass, but I am still interested in working on the kernel part of the LED subsystem.
Marek
In fact until recently I managed to avoid Rust on my system (Gentoo), and was annoyed when suddenly one library needed Rust as a dependency (librsvg) and Rust had to be installed.
Not because of dislike of Rust, but because of dislike of the idea of having compilers for 50 different languages on the system...
Marek