Re: Implementing missing BlinkM LED features

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have begun look at the source code for the BlinkM driver and the pattern trigger to get an idea of the best way to implement an RGB-aware pattern trigger. I was thinking that instead of sending patterns of brightness values and time intervals, the user of the trigger could send RGB hex values and time intervals. Let me know if there is some other way that would make more sense.

The main roadblock I ran into was the way RGB is done in the subsystem currently. From what I gather, each color has its own sysfs class and there is a seperate pattern trigger for each. For an RGB-aware pattern trigger, I assume there would need to be a more general sysfs class. But again, struct led_classdev doesn't have a property for colors.

Additionally, in the current pattern trigger source code, after performing all of the necessary computations, it hands the brightness value off to the LED core with the led_set_brightness() function. Even if the pattern trigger computed RGB values from its input, they would have no place to go, since the LED subsystem has no interface for setting colors, only brightness. Therefore, do you have any suggestions on what would be the best way for the trigger to read RGB values and send those values to the device? Or did you mean that I should work on adding RGB support to the subsystem as a whole? I see that there have been some attempts at it before, but I'm not sure why those were never merged.

Best Regards,
Joe

On 22/08/22 12:35PM, Pavel Machek wrote:
> Hi!
>
> Please cc lists on communications.
>
> > Thank you. This would be my first time contributing to the kernel, so there are just a few things I wanted to clarify :)
> >
>
> Hmm, good luck.
>
> > I looked into the pattern trigger you mentioned, and from what I found in the sources and mailing list, it seems like an alternative to manually sending a stream of BlinkM script bytes. That is, the user instead sets a brightness and delay and then turns the LED on and off at whatever interval they choose. So it is preferable for the user to send their lighting sequence to the pattern trigger file, rather than with some other file/interface I create?
> >
>
> Yes, please. Use existing interface.
>
> > You also mentioned an RGB-aware pattern trigger, which would be necessary for implementing this driver feature. Did you mean I should first patch the existing ledtrig-pattern.c to support changing RGB values, or is that something I would implement within the BlinkM driver?
> >
>
> You should patch ledtrig-pattern.c first.
>
> Best regards,
> 										Pavel
> --
> People of Russia, stop Putin before his war on Ukraine escalates.







[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux