← Documents Documentation/devicetree/bindings/power/wakeup-source.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

Device Wakeup Source

Device wakeup capability와 dedicated interrupt naming 규칙입니다.

Source pathDocumentation/devicetree/bindings/power/wakeup-source.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

wakeup-source.txt:1-73

Canonical `wakeup` 이름, legacy 속성, named·unnamed·no-interrupt 예제를 비교합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Specifying wakeup capability for devices
2 ============================================
3
4 Any device nodes
5 ----------------
6 Nodes that describe devices which have wakeup capability may contain a
7 "wakeup-source" boolean property.
8
9 If the device is marked as a wakeup-source, interrupt wake capability depends
10 on the device specific "interrupt-names" property. If no interrupts are labeled
11 as wake capable, then it is up to the device to determine which interrupts can
12 wake the system.
13
14 However if a device has a dedicated interrupt as the wakeup source, then it
15 needs to specify/identify it using a device specific interrupt name. In such
16 cases only that interrupt can be used as a wakeup interrupt.
17
18 While various legacy interrupt names exist, new devices should use "wakeup" as
19 the canonical interrupt name.
20
21 List of legacy properties and respective binding document
22 ---------------------------------------------------------
23
24 1. "gpio-key,wakeup" Documentation/devicetree/bindings/input/gpio-keys{,-polled}.txt
25 2. "has-tpo" Documentation/devicetree/bindings/rtc/rtc-opal.txt
26 3. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml
27 Documentation/devicetree/bindings/mfd/tc3589x.txt
28 Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml
29 4. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8921-keypad.yaml
30 5. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
31 6. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt
32
33 Examples
34 --------
35
36 1. With "wakeup" interrupt name
37
38 device@10000 {
39 compatible = "vendor,device-id";
40 reg = <0x10000 0x1000>;
41 interrupts = <0 19 4>, <0 21 4>, <0 22 4>;
42 interrupt-names = "ack", "err", "wakeup";
43 wakeup-source;
44 };
45
46 2. Without "wakeup" interrupt name
47
48 embedded-controller {
49 compatible = "google,cros-ec-i2c";
50 reg = <0x1e>;
51 interrupts = <6 0>;
52 interrupt-parent = <&gpx1>;
53 pinctrl-names = "default";
54 pinctrl-0 = <&ec_irq>;
55 wakeup-source;
56 };
57
58 3. Without interrupts
59
60 gpio_keys {
61 compatible = "gpio-keys";
62 #address-cells = <1>;
63 #size-cells = <0>;
64
65 button@1 {
66 debounce-interval = <50>;
67 wakeup-source;
68 linux,code = <116>;
69 label = "POWER";
70 gpios = <&iofpga_gpio0 0 0x4>;
71 };
72 [....]
73 };
74

3. 한국어 전문 번역

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

Device wakeup capability

1-20

Wakeup capability가 있는 device를 설명하는 node에는 boolean `wakeup-source` property를 둘 수 있습니다.

Device가 wakeup source로 표시되면 interrupt wake capability는 device별 `interrupt-names` property에 따라 달라집니다. Wake capable로 label된 interrupt가 없으면 어떤 interrupt가 system을 깨울 수 있는지는 device가 결정합니다.

반대로 dedicated wakeup interrupt가 있으면 device별 interrupt 이름으로 그 interrupt를 지정해 식별해야 하며, 이 경우 그 interrupt만 wakeup interrupt로 사용할 수 있습니다.

여러 legacy interrupt 이름이 존재하지만 새 device는 canonical interrupt 이름 `wakeup`을 사용해야 합니다.

Legacy 속성과 binding 문서

21-32

기존 wakeup property와 각 property를 정의한 binding source path는 다음과 같습니다.

Legacy propertyBinding document
gpio-key,wakeupDocumentation/devicetree/bindings/input/gpio-keys{,-polled}.txt
has-tpoDocumentation/devicetree/bindings/rtc/rtc-opal.txt
linux,wakeupDocumentation/devicetree/bindings/input/gpio-matrix-keypad.yaml; Documentation/devicetree/bindings/mfd/tc3589x.txt; Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml
linux,keypad-wakeupDocumentation/devicetree/bindings/input/qcom,pm8921-keypad.yaml
linux,input-wakeupDocumentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
nvidia,wakeup-sourceDocumentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt

이름이 wakeup인 interrupt

33-45

세 interrupt 중 세 번째를 `interrupt-names = "ack", "err", "wakeup"`으로 지정하므로 그 interrupt가 dedicated wakeup source입니다.

device@10000 {
        compatible        = "vendor,device-id";
        reg                = <0x10000 0x1000>;
        interrupts        = <0 19 4>, <0 21 4>, <0 22 4>;
        interrupt-names        = "ack", "err", "wakeup";
        wakeup-source;
};

wakeup 이름이 없는 interrupt

46-57

Chrome OS embedded controller는 interrupt 하나와 `wakeup-source`를 가지지만 `interrupt-names`에 `wakeup` label이 없습니다. 따라서 wakeup interrupt 선택은 device가 결정합니다.

embedded-controller {
        compatible = "google,cros-ec-i2c";
        reg = <0x1e>;
        interrupts = <6 0>;
        interrupt-parent = <&gpx1>;
        pinctrl-names = "default";
        pinctrl-0 = <&ec_irq>;
        wakeup-source;
};

Interrupt가 없는 GPIO key

58-73

GPIO key의 POWER button node는 interrupt property 없이 `wakeup-source`를 선언합니다. GPIO, debounce interval, Linux input code 116을 통해 wakeup-capable key를 정의합니다.

gpio_keys {
        compatible = "gpio-keys";
        #address-cells = <1>;
        #size-cells = <0>;

        button@1 {
                debounce-interval = <50>;
                wakeup-source;
                linux,code = <116>;
                label = "POWER";
                gpios = <&iofpga_gpio0 0 0x4>;
        };
        [....]
};