Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1351387
| From | Jacek Anaszewski <j.anaszewski@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's |
| Date | 2016-03-07 09:50 +0100 |
| Message-ID | <r9Z1v-uU-3@gated-at.bofh.it> (permalink) |
| References | <r95sm-4wI-23@gated-at.bofh.it> <r9NWq-1Fj-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Karl, On 03/06/2016 09:55 PM, Karl Palsson wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Heiner Kallweit <hkallweit1@gmail.com> wrote: >> Add generic support for RGB LED's. >> >> Basic idea is to use enum led_brightness also for the hue and >> saturation color components.This allows to implement the color >> extension w/o changes to struct led_classdev. >> >> Select LEDS_RGB to enable building drivers using the RGB >> extension. >> >> Flag LED_SET_HUE_SAT allows to specify that hue / saturation >> should be overridden even if the provided values are zero. >> >> Some examples for writing values to >> /sys/class/leds/<xx>/brightness: (now also hex notation can be >> used) >> >> 255 -> set full brightness and keep existing color if set 0 -> >> switch LED off but keep existing color so that it can be >> restored >> if the LED is switched on again later >> 0x1000000 -> switch LED off and set also hue and saturation to >> 0 0x00ffff -> set full brightness, full saturation and set hue >> to 0 (red) >> > > > I admit I hadn't seen this earlier, and I didn't spend all day > looking at previous attempts, but what's the motivation for > putting all this overloaded syntax into the "brightness" file? I > thought the point was to have a single value in each file, one of > the references I did find was With single value per file there would be problems with colour components setting synchronization. > http://www.spinics.net/lists/linux-leds/msg02995.html Is there > some thread where this was decided as advantageous? Surely 0-255 > for _brightness_ is what the brightness entry should do? You can find a reference to the related discussion in [1]. > I'd like to set the rgb colour of a led (or hsv, that can be it's > own file too) and separately ramp the brightness up and down. I > also think it's substantially simpler and easier to use from the > user's point of view, which is surely the place you want easy > right? I'm also not very keen on overloading the brightness attribute semantics. Nonetheless it seems impossible to add support for setting three colour components otherwise than through a single syscall, if we want to make it synchronous and compatible with LED triggers. HSV color scheme is also very convenient for adapting monochrome brightness semantics to the RGB realm. [1] http://www.spinics.net/lists/linux-leds/msg05477.html -- Best regards, Jacek Anaszewski
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v7 1/5] leds: core: add generic support for RGB LED's Heiner Kallweit <hkallweit1@gmail.com> - 2016-03-04 22:30 +0100
Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's Karl Palsson <karlp@tweak.net.au> - 2016-03-06 22:00 +0100
Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's Heiner Kallweit <hkallweit1@gmail.com> - 2016-03-06 23:30 +0100
Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's Karl Palsson <karlp@tweak.net.au> - 2016-03-07 00:10 +0100
Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-03-07 09:50 +0100
Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-03-11 09:40 +0100
Re: [PATCH v7 1/5] leds: core: add generic support for RGB LED's Heiner Kallweit <hkallweit1@gmail.com> - 2016-03-11 19:10 +0100
csiph-web