Skip to content

Commit 8dab919

Browse files
mchehabjacek-anaszewski
authored andcommitted
docs: leds: convert to ReST
Rename the leds documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
1 parent 25529ed commit 8dab919

25 files changed

Lines changed: 997 additions & 779 deletions

‎Documentation/laptops/thinkpad-acpi.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ status as "unknown". The available commands are:
679679
sysfs notes:
680680

681681
The ThinkLight sysfs interface is documented by the LED class
682-
documentation, in Documentation/leds/leds-class.txt. The ThinkLight LED name
682+
documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name
683683
is "tpacpi::thinklight".
684684

685685
Due to limitations in the sysfs LED class, if the status of the ThinkLight
@@ -779,7 +779,7 @@ All of the above can be turned on and off and can be made to blink.
779779
sysfs notes:
780780

781781
The ThinkPad LED sysfs interface is described in detail by the LED class
782-
documentation, in Documentation/leds/leds-class.txt.
782+
documentation, in Documentation/leds/leds-class.rst.
783783

784784
The LEDs are named (in LED ID order, from 0 to 12):
785785
"tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt",

‎Documentation/leds/index.rst‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
:orphan:
2+
3+
====
4+
LEDs
5+
====
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
leds-class
11+
leds-class-flash
12+
ledtrig-oneshot
13+
ledtrig-transient
14+
ledtrig-usbport
15+
16+
uleds
17+
18+
leds-blinkm
19+
leds-lm3556
20+
leds-lp3944
21+
leds-lp5521
22+
leds-lp5523
23+
leds-lp5562
24+
leds-lp55xx
25+
leds-mlxcpld
Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
==================
2+
Leds BlinkM driver
3+
==================
4+
15
The leds-blinkm driver supports the devices of the BlinkM family.
26

37
They are RGB-LED modules driven by a (AT)tiny microcontroller and
@@ -14,35 +18,36 @@ The interface this driver provides is 2-fold:
1418
a) LED class interface for use with triggers
1519
############################################
1620

17-
The registration follows the scheme:
18-
blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color>
21+
The registration follows the scheme::
22+
23+
blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color>
1924

20-
$ ls -h /sys/class/leds/blinkm-6-*
21-
/sys/class/leds/blinkm-6-9-blue:
22-
brightness device max_brightness power subsystem trigger uevent
25+
$ ls -h /sys/class/leds/blinkm-6-*
26+
/sys/class/leds/blinkm-6-9-blue:
27+
brightness device max_brightness power subsystem trigger uevent
2328

24-
/sys/class/leds/blinkm-6-9-green:
25-
brightness device max_brightness power subsystem trigger uevent
29+
/sys/class/leds/blinkm-6-9-green:
30+
brightness device max_brightness power subsystem trigger uevent
2631

27-
/sys/class/leds/blinkm-6-9-red:
28-
brightness device max_brightness power subsystem trigger uevent
32+
/sys/class/leds/blinkm-6-9-red:
33+
brightness device max_brightness power subsystem trigger uevent
2934

3035
(same is /sys/bus/i2c/devices/6-0009/leds)
3136

3237
We can control the colors separated into red, green and blue and
3338
assign triggers on each color.
3439

35-
E.g.:
40+
E.g.::
3641

37-
$ cat blinkm-6-9-blue/brightness
38-
05
42+
$ cat blinkm-6-9-blue/brightness
43+
05
3944

40-
$ echo 200 > blinkm-6-9-blue/brightness
41-
$
45+
$ echo 200 > blinkm-6-9-blue/brightness
46+
$
4247

43-
$ modprobe ledtrig-heartbeat
44-
$ echo heartbeat > blinkm-6-9-green/trigger
45-
$
48+
$ modprobe ledtrig-heartbeat
49+
$ echo heartbeat > blinkm-6-9-green/trigger
50+
$
4651

4752

4853
b) Sysfs group to control rgb, fade, hsb, scripts ...
@@ -52,29 +57,28 @@ This extended interface is available as folder blinkm
5257
in the sysfs folder of the I2C device.
5358
E.g. below /sys/bus/i2c/devices/6-0009/blinkm
5459

55-
$ ls -h /sys/bus/i2c/devices/6-0009/blinkm/
56-
blue green red test
60+
$ ls -h /sys/bus/i2c/devices/6-0009/blinkm/
61+
blue green red test
5762

5863
Currently supported is just setting red, green, blue
5964
and a test sequence.
6065

61-
E.g.:
66+
E.g.::
6267

63-
$ cat *
64-
00
65-
00
66-
00
67-
#Write into test to start test sequence!#
68+
$ cat *
69+
00
70+
00
71+
00
72+
#Write into test to start test sequence!#
6873

69-
$ echo 1 > test
70-
$
74+
$ echo 1 > test
75+
$
7176

72-
$ echo 255 > red
73-
$
77+
$ echo 255 > red
78+
$
7479

7580

7681

7782
as of 6/2012
7883

7984
dl9pf <at> gmx <dot> de
80-
Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
1+
==============================
22
Flash LED handling under Linux
33
==============================
44

55
Some LED devices provide two modes - torch and flash. In the LED subsystem
6-
those modes are supported by LED class (see Documentation/leds/leds-class.txt)
6+
those modes are supported by LED class (see Documentation/leds/leds-class.rst)
77
and LED Flash class respectively. The torch mode related features are enabled
88
by default and the flash ones only if a driver declares it by setting
99
LED_DEV_CAP_FLASH flag.
@@ -14,6 +14,7 @@ registered in the LED subsystem with led_classdev_flash_register function.
1414

1515
Following sysfs attributes are exposed for controlling flash LED devices:
1616
(see Documentation/ABI/testing/sysfs-class-led-flash)
17+
1718
- flash_brightness
1819
- max_flash_brightness
1920
- flash_timeout
@@ -31,30 +32,46 @@ be defined in the kernel config.
3132

3233
The driver must call the v4l2_flash_init function to get registered in the
3334
V4L2 subsystem. The function takes six arguments:
34-
- dev : flash device, e.g. an I2C device
35-
- of_node : of_node of the LED, may be NULL if the same as device's
36-
- fled_cdev : LED flash class device to wrap
37-
- iled_cdev : LED flash class device representing indicator LED associated with
38-
fled_cdev, may be NULL
39-
- ops : V4L2 specific ops
40-
* external_strobe_set - defines the source of the flash LED strobe -
35+
36+
- dev:
37+
flash device, e.g. an I2C device
38+
- of_node:
39+
of_node of the LED, may be NULL if the same as device's
40+
- fled_cdev:
41+
LED flash class device to wrap
42+
- iled_cdev:
43+
LED flash class device representing indicator LED associated with
44+
fled_cdev, may be NULL
45+
- ops:
46+
V4L2 specific ops
47+
48+
* external_strobe_set
49+
defines the source of the flash LED strobe -
4150
V4L2_CID_FLASH_STROBE control or external source, typically
4251
a sensor, which makes it possible to synchronise the flash
4352
strobe start with exposure start,
44-
* intensity_to_led_brightness and led_brightness_to_intensity - perform
53+
* intensity_to_led_brightness and led_brightness_to_intensity
54+
perform
4555
enum led_brightness <-> V4L2 intensity conversion in a device
4656
specific manner - they can be used for devices with non-linear
4757
LED current scale.
48-
- config : configuration for V4L2 Flash sub-device
49-
* dev_name - the name of the media entity, unique in the system,
50-
* flash_faults - bitmask of flash faults that the LED flash class
58+
- config:
59+
configuration for V4L2 Flash sub-device
60+
61+
* dev_name
62+
the name of the media entity, unique in the system,
63+
* flash_faults
64+
bitmask of flash faults that the LED flash class
5165
device can report; corresponding LED_FAULT* bit definitions are
5266
available in <linux/led-class-flash.h>,
53-
* torch_intensity - constraints for the LED in TORCH mode
67+
* torch_intensity
68+
constraints for the LED in TORCH mode
5469
in microamperes,
55-
* indicator_intensity - constraints for the indicator LED
70+
* indicator_intensity
71+
constraints for the indicator LED
5672
in microamperes,
57-
* has_external_strobe - determines whether the flash strobe source
73+
* has_external_strobe
74+
determines whether the flash strobe source
5875
can be switched to external,
5976

6077
On remove the v4l2_flash_release function has to be called, which takes one
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
========================
22
LED handling under Linux
33
========================
44

@@ -43,7 +43,7 @@ LED Device Naming
4343

4444
Is currently of the form:
4545

46-
"devicename:colour:function"
46+
"devicename:colour:function"
4747

4848
There have been calls for LED properties such as colour to be exported as
4949
individual led class attributes. As a solution which doesn't incur as much
@@ -57,9 +57,12 @@ Brightness setting API
5757

5858
LED subsystem core exposes following API for setting brightness:
5959

60-
- led_set_brightness : it is guaranteed not to sleep, passing LED_OFF stops
60+
- led_set_brightness:
61+
it is guaranteed not to sleep, passing LED_OFF stops
6162
blinking,
62-
- led_set_brightness_sync : for use cases when immediate effect is desired -
63+
64+
- led_set_brightness_sync:
65+
for use cases when immediate effect is desired -
6366
it can block the caller for the time required for accessing
6467
device registers and can sleep, passing LED_OFF stops hardware
6568
blinking, returns -EBUSY if software blink fallback is enabled.
@@ -70,7 +73,7 @@ LED registration API
7073

7174
A driver wanting to register a LED classdev for use by other drivers /
7275
userspace needs to allocate and fill a led_classdev struct and then call
73-
[devm_]led_classdev_register. If the non devm version is used the driver
76+
`[devm_]led_classdev_register`. If the non devm version is used the driver
7477
must call led_classdev_unregister from its remove function before
7578
free-ing the led_classdev struct.
7679

@@ -94,7 +97,7 @@ with brightness value LED_OFF, which should stop any software
9497
timers that may have been required for blinking.
9598

9699
The blink_set() function should choose a user friendly blinking value
97-
if it is called with *delay_on==0 && *delay_off==0 parameters. In this
100+
if it is called with `*delay_on==0` && `*delay_off==0` parameters. In this
98101
case the driver should give back the chosen value through delay_on and
99102
delay_off parameters to the leds subsystem.
100103

0 commit comments

Comments
 (0)