← Documents Documentation/devicetree/bindings/leds/leds-spi-byte.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

Single-byte SPI LED

MOSI byte 하나로 단일 LED 밝기를 제어하는 SPI 바인딩입니다.

Source pathDocumentation/devicetree/bindings/leds/leds-spi-byte.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

leds-spi-byte.txt:1-44

응답 없는 단방향 SPI protocol과 airCube status LED 예제를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 * Single Byte SPI LED Device Driver.
2
3 The driver can be used for controllers with a very simple SPI protocol:
4 - one LED is controlled by a single byte on MOSI
5 - the value of the byte gives the brightness between two values (lowest to
6 highest)
7 - no return value is necessary (no MISO signal)
8
9 The value for lowest and highest brightness is dependent on the device and
10 therefore on the compatible string.
11
12 Depending on the compatible string some special functions (like hardware
13 accelerated blinking) might can be supported too.
14
15 The driver currently only supports one LED. The properties of the LED are
16 configured in a sub-node in the device node.
17
18 Required properties:
19 - compatible: should be one of
20 * "ubnt,acb-spi-led" microcontroller (SONiX 8F26E611LA) based device
21 used for example in Ubiquiti airCube ISP
22
23 Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt
24 apply.
25
26 LED sub-node properties:
27 - label:
28 see Documentation/devicetree/bindings/leds/common.txt
29 - default-state:
30 see Documentation/devicetree/bindings/leds/common.txt
31 Only "on" and "off" are supported.
32
33 Example:
34
35 led-controller@0 {
36 compatible = "ubnt,acb-spi-led";
37 reg = <0>;
38 spi-max-frequency = <100000>;
39
40 led {
41 label = "white:status";
42 default-state = "on";
43 };
44 };
45

3. 한국어 전문 번역

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

단일 바이트 SPI LED 프로토콜

1-17

이 드라이버는 매우 단순한 SPI 프로토콜을 쓰는 controller용입니다. LED 하나를 MOSI의 단일 byte로 제어하고, 그 byte 값이 장치별 최저 밝기와 최고 밝기 사이의 밝기를 결정합니다. 반환 값은 필요하지 않으므로 MISO 신호도 필요하지 않습니다.

최저·최고 밝기 값은 장치와 `compatible` 문자열에 따라 달라집니다. 일부 `compatible`은 hardware-accelerated blinking 같은 특수 기능도 지원할 수 있습니다. 현재 드라이버는 LED 하나만 지원하며 LED 속성은 장치 노드의 하위 노드에 설정합니다.

SPI byte LED 데이터 경로
SPI controllerMOSI 1 byte
compatible별 변환최저~최고 밝기
단일 LED출력 밝기
MISO사용하지 않음

MOSI의 한 byte가 장치별 밝기 범위로 변환되며 응답 경로는 없습니다.

Controller와 LED 하위 노드

18-32

필수 `compatible` 값으로 현재 지원되는 것은 `ubnt,acb-spi-led`이며, Ubiquiti airCube ISP 등에 사용된 SONiX 8F26E611LA microcontroller 기반 장치를 가리킵니다. `Documentation/devicetree/bindings/spi/spi-bus.txt`의 SPI bus 속성 규칙도 적용됩니다.

LED 하위 노드의 `label`과 `default-state`는 `Documentation/devicetree/bindings/leds/common.txt`를 따릅니다. 이 드라이버에서 `default-state`는 `on`과 `off`만 지원합니다.

airCube status LED 예제

33-44

예제는 chip-select 0에서 최대 SPI 주파수 100000Hz를 사용합니다. 단일 하위 LED의 label은 `white:status`이며 초기 상태는 `on`입니다.

led-controller@0 {
        compatible = "ubnt,acb-spi-led";
        reg = <0>;
        spi-max-frequency = <100000>;

        led {
                label = "white:status";
                default-state = "on";
        };
};