Hi Henning, On 07/05/2018 01:12 PM, Henning Schild wrote:
Hey, we are currently working on a led driver that we will eventually propose mainline. Our HW implies a kind of dominance where one LED can have multiple colors, but only one can be lid at once.
How does your hardware decide about LED color? Does it have e.g. a group of three outputs that are intended to be connected to a multicolor RGB LED component? Or maybe it has a group of outputs from each only one can be active at a time?
Lighting the dominant effectively (visible) turns off the recessive. The question is whether that visible effect should be reflected in the code. Or in other words, should the "brightness" in sysfs always correspond to what is actually visible? Our first version does not try to do that, because that would complicate the code a lot. LEDs would have to set each other and possibly remember to reset each other when they get toggled again. I doubt that being the first example of such an LED, but could not find a good example in the kernel. Maybe you can point out a driver that handles this problem in the "correct" way.
I don't have a full picture of your hw design, but as a first shot please compare drivers/leds/leds-bd2802.c RGB LED driver. In your case, let's say when setting red LED brightness you should set green and blue LEDs brightness to LED_OFF. It should not be too complicated AFAICS. -- Best regards, Jacek Anaszewski