Skip to content

Commit edef2fa

Browse files
mchehabgregkh
authored andcommitted
docs: ABI: unify /sys/class/leds/<led>/brightness documentation
This ABI is defined twice, one for normal leds and another one for multicolor ones. Ensure that just one definition is there at ABI. Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/1115022e7f172b19ee8610f2ad28cc2f0ca93592.1604042072.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 637ae1f commit edef2fa

2 files changed

Lines changed: 28 additions & 20 deletions

File tree

Documentation/ABI/testing/sysfs-class-led

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,35 @@ Date: March 2006
33
KernelVersion: 2.6.17
44
Contact: Richard Purdie <rpurdie@rpsys.net>
55
Description:
6-
Set the brightness of the LED. Most LEDs don't
7-
have hardware brightness support, so will just be turned on for
8-
non-zero brightness settings. The value is between 0 and
6+
Set the brightness of the LED.
7+
8+
Most LEDs don't have hardware brightness support, so will
9+
just be turned on for non-zero brightness settings.
10+
11+
.. Note::
12+
13+
For multicolor LEDs, writing to this file will update all
14+
LEDs within the group to a calculated percentage of what
15+
each color LED intensity is set to.
16+
17+
The percentage is calculated for each grouped LED via
18+
the equation below::
19+
20+
led_brightness = brightness * multi_intensity/max_brightness
21+
22+
For additional details please refer to
23+
Documentation/leds/leds-class-multicolor.rst.
24+
25+
The value is between 0 and
926
/sys/class/leds/<led>/max_brightness.
1027

1128
Writing 0 to this file clears active trigger.
1229

1330
Writing non-zero to this file while trigger is active changes the
1431
top brightness trigger is going to use.
1532

33+
34+
1635
What: /sys/class/leds/<led>/max_brightness
1736
Date: March 2006
1837
KernelVersion: 2.6.17
Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
What: /sys/class/leds/<led>/brightness
2-
Date: March 2020
3-
KernelVersion: 5.9
4-
Contact: Dan Murphy <dmurphy@ti.com>
5-
Description: read/write
6-
Writing to this file will update all LEDs within the group to a
7-
calculated percentage of what each color LED intensity is set
8-
to. The percentage is calculated for each grouped LED via the
9-
equation below:
10-
11-
led_brightness = brightness * multi_intensity/max_brightness
12-
13-
For additional details please refer to
14-
Documentation/leds/leds-class-multicolor.rst.
15-
16-
The value of the LED is from 0 to
17-
/sys/class/leds/<led>/max_brightness.
181

192
What: /sys/class/leds/<led>/multi_index
203
Date: March 2020
@@ -25,6 +8,9 @@ Description: read
258
as an array of strings as they are indexed in the
269
multi_intensity file.
2710

11+
For additional details please refer to
12+
Documentation/leds/leds-class-multicolor.rst.
13+
2814
What: /sys/class/leds/<led>/multi_intensity
2915
Date: March 2020
3016
KernelVersion: 5.9
@@ -33,3 +19,6 @@ Description: read/write
3319
This file contains array of integers. Order of components is
3420
described by the multi_index array. The maximum intensity should
3521
not exceed /sys/class/leds/<led>/max_brightness.
22+
23+
For additional details please refer to
24+
Documentation/leds/leds-class-multicolor.rst.

0 commit comments

Comments
 (0)