^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) Specifying wakeup capability for devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) ============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Any device nodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Nodes that describe devices which has wakeup capability must contain an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) "wakeup-source" boolean property.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Also, if device is marked as a wakeup source, then all the primary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) interrupt(s) can be used as wakeup interrupt(s).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) However if the devices have dedicated interrupt as the wakeup source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) then they need to specify/identify the same using device specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) interrupt name. In such cases only that interrupt can be used as wakeup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) interrupt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) List of legacy properties and respective binding document
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) ---------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 1. "enable-sdio-wakeup" Documentation/devicetree/bindings/mmc/mmc.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 2. "gpio-key,wakeup" Documentation/devicetree/bindings/input/gpio-keys{,-polled}.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 3. "has-tpo" Documentation/devicetree/bindings/rtc/rtc-opal.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 4. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) Documentation/devicetree/bindings/mfd/tc3589x.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) Documentation/devicetree/bindings/input/touchscreen/ads7846.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 5. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 6. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung-keypad.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 7. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Examples
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) --------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 1. With "wakeup" interrupt name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) device@10000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) compatible = "vendor,device-id";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) reg = <0x10000 0x1000>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) interrupts = <0 19 4>, <0 21 4>, <0 22 4>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) interrupt-names = "ack", "err", "wakeup";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) wakeup-source;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 2. Without "wakeup" interrupt name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) embedded-controller {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) compatible = "google,cros-ec-i2c";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) reg = <0x1e>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) interrupts = <6 0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) interrupt-parent = <&gpx1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) pinctrl-names = "default";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) pinctrl-0 = <&ec_irq>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) wakeup-source;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 3. Without interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) gpio_keys {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) compatible = "gpio-keys";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) button@1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) debounce-interval = <50>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) wakeup-source;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) linux,code = <116>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) label = "POWER";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) gpios = <&iofpga_gpio0 0 0x4>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) [....]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) };