요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
-*- 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
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
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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
일관된 LED 이름 정책
1-19Userspace에 일관된 interface를 제공하려면 `/sys/class/leds` directory 이름을 안정적으로 정해야 합니다. LED 기능별 올바른 이름을 userspace가 미리 알 수 있으면 좋지만 역사적 이름 때문에 상황이 복잡합니다.
Backward compatibility 문제가 없는 새 code는 이 문서의 `Good` 이름을 사용해야 하며 필요하면 목록을 확장해야 합니다.
Application은 특정 기능을 찾을 때 권장 이름을 먼저 probe하고, 찾지 못하면 legacy 이름도 시도해야 합니다. 공통 function 목록은 `include/dt-bindings/leds/common.h`에도 있습니다.
새 이름을 우선하면서 기존 장치 호환성을 유지합니다.
-*- 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-68Game 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`를 권장합니다.
기능별 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-111Network 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`입니다.
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.
요약·해설
well-known-leds.txt:1-111Userspace는 Good 이름을 먼저 찾고 legacy 이름을 fallback으로 확인해야 합니다.
Ethernet LED에는 불안정한 netdev 이름 대신 MAC 또는 PHY controller의 고유 identity를 사용합니다.