Merge tag 'rproc-v5.3' of git://github.com/andersson/remoteproc
[sfrench/cifs-2.6.git] / Documentation / acpi / dsd / leds.txt
1 Describing and referring to LEDs in ACPI
2
3 Individual LEDs are described by hierarchical data extension [6] nodes under the
4 device node, the LED driver chip. The "reg" property in the LED specific nodes
5 tells the numerical ID of each individual LED output to which the LEDs are
6 connected. [3] The hierarchical data nodes are named "led@X", where X is the
7 number of the LED output.
8
9 Referring to LEDs in Device tree is documented in [4], in "flash-leds" property
10 documentation. In short, LEDs are directly referred to by using phandles.
11
12 While Device tree allows referring to any node in the tree[1], in ACPI
13 references are limited to device nodes only [2]. For this reason using the same
14 mechanism on ACPI is not possible. A mechanism to refer to non-device ACPI nodes
15 is documented in [7].
16
17 ACPI allows (as does DT) using integer arguments after the reference. A
18 combination of the LED driver device reference and an integer argument,
19 referring to the "reg" property of the relevant LED, is used to identify
20 individual LEDs. The value of the "reg" property is a contract between the
21 firmware and software, it uniquely identifies the LED driver outputs.
22
23 Under the LED driver device, The first hierarchical data extension package list
24 entry shall contain the string "led@" followed by the number of the LED,
25 followed by the referred object name. That object shall be named "LED" followed
26 by the number of the LED.
27
28 An ASL example of a camera sensor device and a LED driver device for two LEDs.
29 Objects not relevant for LEDs or the references to them have been omitted.
30
31         Device (LED)
32         {
33                 Name (_DSD, Package () {
34                         ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
35                         Package () {
36                                 Package () { "led@0", LED0 },
37                                 Package () { "led@1", LED1 },
38                         }
39                 })
40                 Name (LED0, Package () {
41                         ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
42                         Package () {
43                                 Package () { "reg", 0 },
44                                 Package () { "flash-max-microamp", 1000000 },
45                                 Package () { "flash-timeout-us", 200000 },
46                                 Package () { "led-max-microamp", 100000 },
47                                 Package () { "label", "white:flash" },
48                         }
49                 })
50                 Name (LED1, Package () {
51                         ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
52                         Package () {
53                                 Package () { "reg", 1 },
54                                 Package () { "led-max-microamp", 10000 },
55                                 Package () { "label", "red:indicator" },
56                         }
57                 })
58         }
59
60         Device (SEN)
61         {
62                 Name (_DSD, Package () {
63                         ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
64                         Package () {
65                                 Package () {
66                                         "flash-leds",
67                                         Package () { ^LED, "led@0", ^LED, "led@1" },
68                                 }
69                         }
70                 })
71         }
72
73 where
74
75         LED     LED driver device
76         LED0    First LED
77         LED1    Second LED
78         SEN     Camera sensor device (or another device the LED is
79                 related to)
80
81 [1] Device tree. <URL:http://www.devicetree.org>, referenced 2019-02-21.
82
83 [2] Advanced Configuration and Power Interface Specification.
84     <URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,
85     referenced 2019-02-21.
86
87 [3] Documentation/devicetree/bindings/leds/common.txt
88
89 [4] Documentation/devicetree/bindings/media/video-interfaces.txt
90
91 [5] Device Properties UUID For _DSD.
92     <URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
93     referenced 2019-02-21.
94
95 [6] Hierarchical Data Extension UUID For _DSD.
96     <URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
97     referenced 2019-02-21.
98
99 [7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst