← Documents Documentation/leds/well-known-leds.txt GitHub 원문 ↗

Linux 6.18.37 · LEDs

Well-known LED Names

기능별 권장·legacy LED 이름과 Ethernet MAC·PHY naming 규칙입니다.

Source pathDocumentation/leds/well-known-leds.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

well-known-leds.txt:1-111

Userspace는 Good 이름을 먼저 찾고 legacy 이름을 fallback으로 확인해야 합니다.

Ethernet LED에는 불안정한 netdev 이름 대신 MAC 또는 PHY controller의 고유 identity를 사용합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 -*- org -*-
2
3 It is somehow important to provide consistent interface to the
4 userland. LED devices have one problem there, and that is naming of
5 directories in /sys/class/leds. It would be nice if userland would
6 just know right "name" for given LED function, but situation got more
7 complex.
8
9 Anyway, if backwards compatibility is not an issue, new code should
10 use one of the "good" names from this list, and you should extend the
11 list where applicable.
12
13 Legacy names are listed, too; in case you are writing application that
14 wants to use particular feature, you should probe for good name, first,
15 but then try the legacy ones, too.
16
17 Notice there's a list of functions in include/dt-bindings/leds/common.h .
18
19 * Gamepads and joysticks
20
21 Game controllers may feature LEDs to indicate a player number. This is commonly
22 used on game consoles in which multiple controllers can be connected to a system.
23 The "player LEDs" are then programmed with a pattern to indicate a particular
24 player. For example, a game controller with 4 LEDs, may be programmed with "x---"
25 to indicate player 1, "-x--" to indicate player 2 etcetera where "x" means on.
26 Input drivers can utilize the LED class to expose the individual player LEDs
27 of a game controller using the function "player".
28 Note: tracking and management of Player IDs is the responsibility of user space,
29 though drivers may pick a default value.
30
31 Good: "input*:*:player-{1,2,3,4,5}
32
33 * Keyboards
34
35 Good: "input*:*:capslock"
36 Good: "input*:*:scrolllock"
37 Good: "input*:*:numlock"
38 Legacy: "shift-key-light" (Motorola Droid 4, capslock)
39
40 Set of common keyboard LEDs, going back to PC AT or so.
41
42 Legacy: "tpacpi::thinklight" (IBM/Lenovo Thinkpads)
43 Legacy: "lp5523:kb{1,2,3,4,5,6}" (Nokia N900)
44
45 Frontlight/backlight of main keyboard.
46
47 Legacy: "button-backlight" (Motorola Droid 4)
48
49 Some phones have touch buttons below screen; it is different from main
50 keyboard. And this is their backlight.
51
52 * Sound subsystem
53
54 Good: "platform:*:mute"
55 Good: "platform:*:micmute"
56
57 LEDs on notebook body, indicating that sound input / output is muted.
58
59 * System notification
60
61 Good: "rgb:status"
62 Legacy: "status-led:{red,green,blue}" (Motorola Droid 4)
63 Legacy: "lp5523:{r,g,b}" (Nokia N900)
64
65 Phones usually have multi-color status LED.
66
67 * Power management
68
69 Good: "platform:*:charging" (allwinner sun50i, leds-cht-wcove)
70
71 * Screen
72
73 Good: ":backlight" (Motorola Droid 4)
74
75 * Indicators
76
77 Good: ":indicator" (Blinkm)
78
79 * RGB
80
81 Good: ":rgb" (Blinkm)
82
83 * Ethernet LEDs
84
85 Currently two types of Network LEDs are support, those controlled by
86 the PHY and those by the MAC. In theory both can be present at the
87 same time for one Linux netdev, hence the names need to differ between
88 MAC and PHY.
89
90 Do not use the netdev name, such as eth0, enp1s0. These are not stable
91 and are not unique. They also don't differentiate between MAC and PHY.
92
93 ** MAC LEDs
94
95 Good: f1070000.ethernet:white:WAN
96 Good: mdio_mux-0.1:00:green:left
97 Good: 0000:02:00.0:yellow:top
98
99 The first part must uniquely name the MAC controller. Then follows the
100 colour. WAN/LAN should be used for a single LED. If there are
101 multiple LEDs, use left/right, or top/bottom to indicate their
102 position on the RJ45 socket.
103
104 ** PHY LEDs
105
106 Good: f1072004.mdio-mii:00: white:WAN
107 Good: !mdio-mux!mdio@2!switch@0!mdio:01:green:right
108 Good: r8169-0-200:00:yellow:bottom
109
110 The first part must uniquely name the PHY. This often means uniquely
111 identifying the MDIO bus controller, and the address on the bus.
112

3. 한국어 전문 번역

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

일관된 LED 이름 정책

1-19

Userspace에 일관된 interface를 제공하려면 `/sys/class/leds` directory 이름을 안정적으로 정해야 합니다. LED 기능별 올바른 이름을 userspace가 미리 알 수 있으면 좋지만 역사적 이름 때문에 상황이 복잡합니다.

Backward compatibility 문제가 없는 새 code는 이 문서의 `Good` 이름을 사용해야 하며 필요하면 목록을 확장해야 합니다.

Application은 특정 기능을 찾을 때 권장 이름을 먼저 probe하고, 찾지 못하면 legacy 이름도 시도해야 합니다. 공통 function 목록은 `include/dt-bindings/leds/common.h`에도 있습니다.

LED 이름 탐색 우선순위
`include/dt-bindings/leds/common.h`와 Good 목록 확인권장 이름으로 sysfs LED probe없으면 문서의 legacy 이름 probe새 기능이면 일관된 이름으로 목록 확장

새 이름을 우선하면서 기존 장치 호환성을 유지합니다.

-*- org -*-

It is somehow important to provide consistent interface to the
userland. LED devices have one problem there, and that is naming of
directories in /sys/class/leds. It would be nice if userland would
just know right "name" for given LED function, but situation got more
complex.

Anyway, if backwards compatibility is not an issue, new code should
use one of the "good" names from this list, and you should extend the
list where applicable.

Legacy names are listed, too; in case you are writing application that
wants to use particular feature, you should probe for good name, first,
but then try the legacy ones, too.

Notice there's a list of functions in include/dt-bindings/leds/common.h .

* Gamepads and joysticks

Gamepad·keyboard·sound·status 이름

20-68

Game controller는 player 번호를 나타내는 LED를 가질 수 있습니다. 네 LED에서 `x---`, `-x--` 같은 pattern으로 player 1·2를 표시하며 input driver는 function `player`로 각 LED를 노출합니다. Player ID 추적·관리는 userspace 책임이지만 driver가 기본값을 선택할 수 있습니다.

권장 player 이름은 원문 표기의 `input*:*:player-{1,2,3,4,5}`입니다. Keyboard lock LED는 `input*:*:capslock`, `input*:*:scrolllock`, `input*:*:numlock`을 사용합니다. `shift-key-light`, `tpacpi::thinklight`, `lp5523:kb{1,2,3,4,5,6}`, `button-backlight`는 장치별 legacy 이름입니다.

Sound mute 표시에는 `platform:*:mute`, microphone mute에는 `platform:*:micmute`를 권장합니다. Multi-color system notification은 `rgb:status`를 사용하며 `status-led:{red,green,blue}`와 `lp5523:{r,g,b}`는 legacy입니다.

Power charging은 `platform:*:charging`, screen backlight는 `:backlight`, 일반 indicator는 `:indicator`, RGB LED는 `:rgb`를 권장합니다.

Well-known 일반 LED 이름
기능GoodLegacy 예
Player`input*:*:player-{1,2,3,4,5}`-
Keyboard lock`input*:*:{capslock,scrolllock,numlock}``shift-key-light`
Keyboard light-`tpacpi::thinklight`, `lp5523:kb{...}`
Sound`platform:*:mute`, `platform:*:micmute`-
System status`rgb:status``status-led:{red,green,blue}`
Charging`platform:*:charging`-
Screen`:backlight`-
Indicator·RGB`:indicator`, `:rgb`-

기능별 Good 이름과 대표 legacy 이름입니다.


Game controllers may feature LEDs to indicate a player number. This is commonly
used on game consoles in which multiple controllers can be connected to a system.
The "player LEDs" are then programmed with a pattern to indicate a particular
player. For example, a game controller with 4 LEDs, may be programmed with "x---"
to indicate player 1, "-x--" to indicate player 2 etcetera where "x" means on.
Input drivers can utilize the LED class to expose the individual player LEDs
of a game controller using the function "player".
Note: tracking and management of Player IDs is the responsibility of user space,
though drivers may pick a default value.

Good: "input*:*:player-{1,2,3,4,5}

* Keyboards
  
Good: "input*:*:capslock"
Good: "input*:*:scrolllock"
Good: "input*:*:numlock"
Legacy: "shift-key-light" (Motorola Droid 4, capslock)

Set of common keyboard LEDs, going back to PC AT or so.

Legacy: "tpacpi::thinklight" (IBM/Lenovo Thinkpads)
Legacy: "lp5523:kb{1,2,3,4,5,6}" (Nokia N900)

Frontlight/backlight of main keyboard.

Legacy: "button-backlight" (Motorola Droid 4)

Some phones have touch buttons below screen; it is different from main
keyboard. And this is their backlight.

* Sound subsystem

Good: "platform:*:mute"
Good: "platform:*:micmute"

LEDs on notebook body, indicating that sound input / output is muted.

* System notification

Good: "rgb:status"
Legacy: "status-led:{red,green,blue}" (Motorola Droid 4)
Legacy: "lp5523:{r,g,b}" (Nokia N900)

Phones usually have multi-color status LED.

* Power management

Ethernet MAC·PHY LED 이름

69-111

Network LED는 PHY가 제어하는 유형과 MAC이 제어하는 유형이 있습니다. 하나의 Linux netdev에 두 유형이 동시에 존재할 수 있으므로 이름에서 MAC과 PHY를 구분해야 합니다.

`eth0`, `enp1s0` 같은 netdev 이름은 안정적이지 않고 고유하지 않으며 MAC과 PHY도 구분하지 못하므로 LED 이름에 사용하지 않습니다.

MAC LED 이름의 첫 부분은 MAC controller를 고유하게 식별하고 이어서 color와 위치·역할을 둡니다. LED 하나면 `WAN` 또는 `LAN`, 여러 개면 RJ45 socket의 `left/right` 또는 `top/bottom`을 사용합니다. 예는 `f1070000.ethernet:white:WAN`, `mdio_mux-0.1:00:green:left`, `0000:02:00.0:yellow:top`입니다.

PHY LED 이름의 첫 부분은 PHY를 고유하게 식별해야 하며 흔히 MDIO bus controller와 bus address가 필요합니다. 예는 원문의 `f1072004.mdio-mii:00: white:WAN`, `!mdio-mux!mdio@2!switch@0!mdio:01:green:right`, `r8169-0-200:00:yellow:bottom`입니다.

Ethernet LED naming
유형첫 부분끝 부분
MAC고유 MAC controllerColor + WAN/LAN 또는 위치`f1070000.ethernet:white:WAN`
MACPCI 또는 mux identityColor + 위치`0000:02:00.0:yellow:top`
PHYMDIO controller + addressColor + WAN/LAN 또는 위치`r8169-0-200:00:yellow:bottom`

Controller identity와 connector 위치를 이름에 포함합니다.

Good: "platform:*:charging" (allwinner sun50i, leds-cht-wcove)

* Screen

Good: ":backlight" (Motorola Droid 4)

* Indicators

Good: ":indicator" (Blinkm)

* RGB

Good: ":rgb" (Blinkm)

* Ethernet LEDs

Currently two types of Network LEDs are support, those controlled by
the PHY and those by the MAC. In theory both can be present at the
same time for one Linux netdev, hence the names need to differ between
MAC and PHY.

Do not use the netdev name, such as eth0, enp1s0. These are not stable
and are not unique. They also don't differentiate between MAC and PHY.

** MAC LEDs

Good: f1070000.ethernet:white:WAN
Good: mdio_mux-0.1:00:green:left
Good: 0000:02:00.0:yellow:top

The first part must uniquely name the MAC controller. Then follows the
colour.  WAN/LAN should be used for a single LED. If there are
multiple LEDs, use left/right, or top/bottom to indicate their
position on the RJ45 socket.

** PHY LEDs

Good: f1072004.mdio-mii:00: white:WAN
Good: !mdio-mux!mdio@2!switch@0!mdio:01:green:right
Good: r8169-0-200:00:yellow:bottom

The first part must uniquely name the PHY. This often means uniquely
identifying the MDIO bus controller, and the address on the bus.