Re: [PATCH v5 1/9] leds: multicolor: Add sysfs interface definition

From: Jacek Anaszewski
Date: Mon Sep 16 2019 - 14:31:40 EST


Dan,

On 9/16/19 3:56 PM, Dan Murphy wrote:
> Hello
>
> On 9/15/19 8:57 AM, Jacek Anaszewski wrote:
>> Hi Dan,
>>
>> On 9/11/19 8:01 PM, Dan Murphy wrote:
>>> Add a documentation of LED Multicolor LED class specific
>>> sysfs attributes.
>>>
>>> Signed-off-by: Dan Murphy <dmurphy@xxxxxx>
>>> ---
>>> Â .../ABI/testing/sysfs-class-led-multicolorÂÂÂ | 73 +++++++++++++++++++
>>> Â 1 file changed, 73 insertions(+)
>>> Â create mode 100644
>>> Documentation/ABI/testing/sysfs-class-led-multicolor
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-class-led-multicolor
>>> b/Documentation/ABI/testing/sysfs-class-led-multicolor
>>> new file mode 100644
>>> index 000000000000..4ea54c2ad4c8
>>> --- /dev/null
>>> +++ b/Documentation/ABI/testing/sysfs-class-led-multicolor
>>> @@ -0,0 +1,73 @@
>>> +What:ÂÂÂÂÂÂÂ /sys/class/leds/<led>/brightness
>>> +Date:ÂÂÂÂÂÂÂ Sept 2019
>>> +KernelVersion:ÂÂÂ 5.5
>>> +Contact:ÂÂÂ Dan Murphy <dmurphy@xxxxxx>
>>> +Description:ÂÂÂ read/write
>>> +ÂÂÂÂÂÂÂ The multicolor class will redirect the device drivers call back
>>> +ÂÂÂÂÂÂÂ function for brightness control to the multicolor class
>>> +ÂÂÂÂÂÂÂ brightness control function.
>>> +
>>> +ÂÂÂÂÂÂÂ Writing to this file will update all LEDs within the group to a
>>> +ÂÂÂÂÂÂÂ calculated percentage of what each color LED in the group is
>>> set
>>> + to. The percentage is calculated via the equation below:
>>> +
>>> +ÂÂÂÂÂÂÂ led_brightness = requested_value *
>>> led_color_intensity/led_color_max_intensity
>>> +
>>> +ÂÂÂÂÂÂÂ For additional details please refer to
>>> +ÂÂÂÂÂÂÂ Documentation/leds/leds-class-multicolor.rst.
>>> +
>>> +ÂÂÂÂÂÂÂ The value of the color is from 0 to
>>> +ÂÂÂÂÂÂÂ /sys/class/leds/<led>/max_brightness.
>>> +
>>> +What:ÂÂÂÂÂÂÂ /sys/class/leds/<led>/colors/color_mix
>>> +Date:ÂÂÂÂÂÂÂ Sept 2019
>>> +KernelVersion:ÂÂÂ 5.5
>>> +Contact:ÂÂÂ Dan Murphy <dmurphy@xxxxxx>
>>> +Description:ÂÂÂ read/write
>>> +ÂÂÂÂÂÂÂ The values written to this file should contain the intensity
>>> +ÂÂÂÂÂÂÂ values of each multicolor LED within the colors directory. The
>>> +ÂÂÂÂÂÂÂ index of given color is reported by the color_id file
>>> present in
>>> +ÂÂÂÂÂÂÂ colors/<color> directory. The index determines the position in
>>> +ÂÂÂÂÂÂÂ the sequence ofÂÂÂ intensities on which the related intensity
>>> +ÂÂÂÂÂÂÂ should be passed to this file.
>>> +
>>> +ÂÂÂÂÂÂÂ For additional details please refer to
>>> +ÂÂÂÂÂÂÂ Documentation/leds/leds-class-multicolor.rst.
>> As already mentioned in the reply to Pavel - let's avoid the
>> introduction of another sysfs file with multiple values.
>
> OK for clarification remove the color_mix and color_id files and keep
> the intensity files?

Exactly.

--
Best regards,
Jacek Anaszewski