← Documents Documentation/firmware-guide/acpi/dsd/leds.rst GitHub 원문 ↗

Linux 6.18.37 · Firmware

Describing and referring to LEDs in ACPI

ACPI _DSD LED node, reg 출력 번호와 camera flash-leds ASL 참조 예제 전문 번역입니다.

Source pathDocumentation/firmware-guide/acpi/dsd/leds.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

leds.rst:1-102

ACPI에서 개별 LED는 LED driver device 아래 `led@X → LEDX` hierarchical node로 기술하고, `LEDX`의 `reg=X`가 실제 driver output을 고유하게 식별한다. 이 번호는 firmware와 software가 공유하는 계약이다.

예제의 LED0은 `white:flash`로 최대 flash 전류 1000000 microamp, timeout 200000 us, 최대 LED 전류 100000 microamp를 가진다. LED1은 `red:indicator`로 최대 LED 전류 10000 microamp를 가진다.

Camera sensor `SEN`의 `flash-leds` property는 `^LED.LED0`과 `^LED.LED1`을 참조해 두 출력을 연결한다. Object name, 경로, property와 숫자 단위는 driver binding과 정확히 일치해야 한다.

ACPI LED 구성 검토
LED driver device의 led@X entry 확인대상 object LEDX 이름 확인reg=X와 output number 일치 확인전류·timeout·label property 검증소비 device의 flash-leds 참조 경로 확인각 참조가 실제 LEDX에 도달하는지 확인

Driver output 정의에서 소비 device 참조까지의 점검 순서다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2 .. include:: <isonum.txt>
3
4 ========================================
5 Describing and referring to LEDs in ACPI
6 ========================================
7
8 Individual LEDs are described by hierarchical data extension [5] nodes under the
9 device node, the LED driver chip. The "reg" property in the LED specific nodes
10 tells the numerical ID of each individual LED output to which the LEDs are
11 connected. [leds] The hierarchical data nodes are named "led@X", where X is the
12 number of the LED output.
13
14 Referring to LEDs in Device tree is documented in [video-interfaces], in
15 "flash-leds" property documentation. In short, LEDs are directly referred to by
16 using phandles.
17
18 ACPI allows (as does DT) using integer arguments after the reference. A
19 combination of the LED driver device reference and an integer argument,
20 referring to the "reg" property of the relevant LED, is used to identify
21 individual LEDs. The value of the "reg" property is a contract between the
22 firmware and software, it uniquely identifies the LED driver outputs.
23
24 Under the LED driver device, The first hierarchical data extension package list
25 entry shall contain the string "led@" followed by the number of the LED,
26 followed by the referred object name. That object shall be named "LED" followed
27 by the number of the LED.
28
29 Example
30 =======
31
32 An ASL example of a camera sensor device and a LED driver device for two LEDs is
33 show below. Objects not relevant for LEDs or the references to them have been
34 omitted. ::
35
36 Device (LED)
37 {
38 Name (_DSD, Package () {
39 ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
40 Package () {
41 Package () { "led@0", LED0 },
42 Package () { "led@1", LED1 },
43 }
44 })
45 Name (LED0, Package () {
46 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
47 Package () {
48 Package () { "reg", 0 },
49 Package () { "flash-max-microamp", 1000000 },
50 Package () { "flash-timeout-us", 200000 },
51 Package () { "led-max-microamp", 100000 },
52 Package () { "label", "white:flash" },
53 }
54 })
55 Name (LED1, Package () {
56 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
57 Package () {
58 Package () { "reg", 1 },
59 Package () { "led-max-microamp", 10000 },
60 Package () { "label", "red:indicator" },
61 }
62 })
63 }
64
65 Device (SEN)
66 {
67 Name (_DSD, Package () {
68 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
69 Package () {
70 Package () {
71 "flash-leds",
72 Package () { "^LED.LED0", "^LED.LED1" },
73 }
74 }
75 })
76 }
77
78 where
79 ::
80
81 LED LED driver device
82 LED0 First LED
83 LED1 Second LED
84 SEN Camera sensor device (or another device the LED is related to)
85
86 References
87 ==========
88
89 [acpi] Advanced Configuration and Power Interface Specification.
90 https://uefi.org/specifications/ACPI/6.4/, referenced 2021-11-30.
91
92 [data-node-ref] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
93
94 [devicetree] Devicetree. https://www.devicetree.org, referenced 2019-02-21.
95
96 [dsd-guide] DSD Guide.
97 https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
98 2021-11-30.
99
100 [leds] Documentation/devicetree/bindings/leds/common.yaml
101
102 [video-interfaces] Documentation/devicetree/bindings/media/video-interfaces.yaml
103

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

ACPI LED 노드와 참조 규칙

1-28

개별 LED는 LED driver chip인 device node 아래의 hierarchical data extension [5] node로 기술한다. 각 LED 전용 node의 `reg` property는 LED가 연결된 개별 LED output의 숫자 ID를 나타낸다 [leds]. Hierarchical data node 이름은 `led@X`이고 X는 LED output number다.

Device Tree에서 LED를 참조하는 방법은 [video-interfaces]의 `flash-leds` property 문서에 정의되어 있으며, 요약하면 phandle로 LED를 직접 참조한다.

ACPI도 DT와 마찬가지로 참조 뒤에 integer argument를 둘 수 있다. 개별 LED는 LED driver device reference와 관련 LED의 `reg` property를 가리키는 integer argument의 조합으로 식별한다.

`reg` 값은 firmware와 software 사이의 contract이며 LED driver output을 고유하게 식별한다. Firmware와 driver가 이 번호의 의미에 동의해야 같은 물리 출력을 선택할 수 있으므로, node의 나열 순서만으로 LED를 식별해서는 안 된다.

LED driver device 아래 첫 hierarchical data extension package list entry는 `led@` 문자열과 LED number를 결합한 key 뒤에 참조 object name을 둔다. 그 object는 `LED` 뒤에 LED number를 붙인 이름이어야 한다. 예를 들어 output 0은 `"led@0"` key와 `LED0` object를 사용한다.

ACPI LED 명명·식별 규칙
요소형식역할
Hierarchical data keyled@XLED output X의 node 연결
대상 object nameLEDXLED X의 property package
Object propertyreg = XFirmware·software 간 고유 output ID
외부 참조LED driver reference + integer argumentreg가 X인 개별 LED 식별

Hierarchical key, object name, reg 값이 동일한 LED output number를 공유한다.

개별 LED 해석
LED driver ACPI device 찾기Hierarchical entry led@X 확인대상 object LEDX 해석LEDX의 reg=X 일치 확인Driver output X와 개별 LED 연결

Device의 계층 entry에서 실제 LED driver output까지 연결하는 순서다.

.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>

========================================
Describing and referring to LEDs in ACPI
========================================

Individual LEDs are described by hierarchical data extension [5] nodes under the
device node, the LED driver chip. The "reg" property in the LED specific nodes
tells the numerical ID of each individual LED output to which the LEDs are
connected. [leds] The hierarchical data nodes are named "led@X", where X is the
number of the LED output.

Referring to LEDs in Device tree is documented in [video-interfaces], in
"flash-leds" property documentation. In short, LEDs are directly referred to by
using phandles.

ACPI allows (as does DT) using integer arguments after the reference. A
combination of the LED driver device reference and an integer argument,
referring to the "reg" property of the relevant LED, is used to identify
individual LEDs. The value of the "reg" property is a contract between the
firmware and software, it uniquely identifies the LED driver outputs.

Under the LED driver device, The first hierarchical data extension package list
entry shall contain the string "led@" followed by the number of the LED,
followed by the referred object name. That object shall be named "LED" followed
by the number of the LED.

두 출력 LED driver ASL 예제

29-64

예제는 두 LED를 위한 LED driver device와 camera sensor device를 ASL로 정의한다. LED 또는 그 참조와 무관한 object는 생략되어 있다.

`Device (LED)`의 `_DSD`는 Hierarchical Data Extension UUID `dbb8e3e6-5886-4ba6-8795-1319f52a966b`을 사용한다. 그 package는 `Package () { "led@0", LED0 }`과 `Package () { "led@1", LED1 }`을 통해 output 0·1을 각 property object에 연결한다.

`LED0`은 Device Properties UUID `daffd814-6eba-4d8c-8a91-bc9bbf4aa301` 아래에 `reg=0`, `flash-max-microamp=1000000`, `flash-timeout-us=200000`, `led-max-microamp=100000`, `label="white:flash"`를 제공한다. 즉 첫 LED는 white flash 역할과 연속·flash 전류 및 timeout 한계를 모두 가진다.

`LED1`은 같은 Device Properties UUID 아래에 `reg=1`, `led-max-microamp=10000`, `label="red:indicator"`를 제공한다. 두 번째 LED는 red indicator 역할이며 flash 전류나 timeout property는 없다.

LED driver 계층
Device LED_DSD Hierarchical Data Extension UUIDled@0 → LED0LED0: reg=0, white:flashled@1 → LED1LED1: reg=1, red:indicator

ASL package를 driver device에서 두 출력 object로 펼친 구조다.

LED0·LED1 속성
PropertyLED0LED1
reg01
flash-max-microamp1000000없음
flash-timeout-us200000없음
led-max-microamp10000010000
labelwhite:flashred:indicator

두 LED output의 reg, 전류, timeout, label을 원문 숫자 그대로 비교한다.

LED 전류·시간 단위 해석
LED제약원문 값
LED0최대 flash 전류1000000 microamp
LED0Flash timeout200000 us
LED0최대 LED 전류100000 microamp
LED1최대 LED 전류10000 microamp

Property 이름에 포함된 단위를 유지해 값의 크기를 잘못 해석하지 않도록 한다.

Example
=======

An ASL example of a camera sensor device and a LED driver device for two LEDs is
show below. Objects not relevant for LEDs or the references to them have been
omitted. ::

        Device (LED)
        {
                Name (_DSD, Package () {
                        ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
                        Package () {
                                Package () { "led@0", LED0 },
                                Package () { "led@1", LED1 },
                        }
                })
                Name (LED0, Package () {
                        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                        Package () {
                                Package () { "reg", 0 },
                                Package () { "flash-max-microamp", 1000000 },
                                Package () { "flash-timeout-us", 200000 },
                                Package () { "led-max-microamp", 100000 },
                                Package () { "label", "white:flash" },
                        }
                })
                Name (LED1, Package () {
                        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                        Package () {
                                Package () { "reg", 1 },
                                Package () { "led-max-microamp", 10000 },
                                Package () { "label", "red:indicator" },
                        }
                })
        }

Camera sensor의 flash-leds 참조

65-85

`Device (SEN)`은 camera sensor device 또는 LED와 관련된 다른 device를 나타낸다. `SEN._DSD`는 Device Properties UUID를 사용하며 `flash-leds` property의 값으로 두 LED node reference를 담은 package를 제공한다.

참조 package는 `Package () { "^LED.LED0", "^LED.LED1" }`이다. `^`는 현재 `SEN` scope의 parent로 이동하고, `LED` device 아래의 `LED0`과 `LED1` object를 각각 직접 가리킨다. 따라서 sensor는 flash에 사용할 두 LED를 순서가 있는 참조 목록으로 얻는다.

SEN에서 LED 참조
Device SENSEN._DSD Device Properties UUIDflash-leds property^LED.LED0 → 첫 번째 LED^LED.LED1 → 두 번째 LEDDevice LED의 output 0·1 사용

Camera sensor의 flash-leds property가 driver의 개별 LED node로 연결되는 구조다.

예제 object 범례
Object의미
LEDLED driver device
LED0첫 번째 LED
LED1두 번째 LED
SENCamera sensor device 또는 LED와 관련된 다른 device

원문 where 블록의 네 object 이름과 역할이다.

이 예제는 앞 절에서 설명한 device reference와 integer argument 조합 대신 hierarchical LED object를 문자열 경로로 직접 참조하는 실제 ASL 표현을 보여준다. 원문의 두 설명과 예제 형식은 모두 아래에 그대로 보존한다.

        Device (SEN)
        {
                Name (_DSD, Package () {
                        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                        Package () {
                                Package () {
                                        "flash-leds",
                                        Package () { "^LED.LED0", "^LED.LED1" },
                                }
                        }
                })
        }

where
::

        LED        LED driver device
        LED0        First LED
        LED1        Second LED
        SEN        Camera sensor device (or another device the LED is related to)

참고 문서

86-102

[acpi]는 Advanced Configuration and Power Interface Specification이며 ACPI 6.4 URL `https://uefi.org/specifications/ACPI/6.4/`과 참조일 2021-11-30을 제시한다.

[data-node-ref]는 커널 내부 문서 `Documentation/firmware-guide/acpi/dsd/data-node-references.rst`다. Hierarchical data node의 문자열 경로 규칙은 이 문서를 따른다.

[devicetree]는 `https://www.devicetree.org`이며 참조일은 2019-02-21이다. [dsd-guide]는 `https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc`의 DSD Guide이며 참조일은 2021-11-30이다.

[leds]는 `Documentation/devicetree/bindings/leds/common.yaml`, [video-interfaces]는 `Documentation/devicetree/bindings/media/video-interfaces.yaml`이다. LED 공통 property와 `flash-leds` binding의 의미는 이 두 schema를 함께 확인한다.

LED 참고 자료
Label자료참조일·용도
acpiACPI Specification 6.42021-11-30
data-node-reffirmware-guide/acpi/dsd/data-node-references.rst계층 노드 참조
devicetreewww.devicetree.org2019-02-21
dsd-guideUEFI DSD Guide2021-11-30
ledsdevicetree/bindings/leds/common.yamlLED 공통 binding
video-interfacesdevicetree/bindings/media/video-interfaces.yamlflash-leds property

원문 label과 외부·커널 내부 문서 위치를 보존했다.

References
==========

[acpi] Advanced Configuration and Power Interface Specification.
    https://uefi.org/specifications/ACPI/6.4/, referenced 2021-11-30.

[data-node-ref] Documentation/firmware-guide/acpi/dsd/data-node-references.rst

[devicetree] Devicetree. https://www.devicetree.org, referenced 2019-02-21.

[dsd-guide] DSD Guide.
    https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
    2021-11-30.

[leds] Documentation/devicetree/bindings/leds/common.yaml

[video-interfaces] Documentation/devicetree/bindings/media/video-interfaces.yaml