1c66ec88fSEmmanuel VadotSpecifying wakeup capability for devices 2c66ec88fSEmmanuel Vadot============================================ 3c66ec88fSEmmanuel Vadot 4c66ec88fSEmmanuel VadotAny device nodes 5c66ec88fSEmmanuel Vadot---------------- 68d13bc63SEmmanuel VadotNodes that describe devices which have wakeup capability may contain a 7c66ec88fSEmmanuel Vadot"wakeup-source" boolean property. 8c66ec88fSEmmanuel Vadot 98d13bc63SEmmanuel VadotIf the device is marked as a wakeup-source, interrupt wake capability depends 108d13bc63SEmmanuel Vadoton the device specific "interrupt-names" property. If no interrupts are labeled 118d13bc63SEmmanuel Vadotas wake capable, then it is up to the device to determine which interrupts can 128d13bc63SEmmanuel Vadotwake the system. 13c66ec88fSEmmanuel Vadot 148d13bc63SEmmanuel VadotHowever if a device has a dedicated interrupt as the wakeup source, then it 158d13bc63SEmmanuel Vadotneeds to specify/identify it using a device specific interrupt name. In such 168d13bc63SEmmanuel Vadotcases only that interrupt can be used as a wakeup interrupt. 178d13bc63SEmmanuel Vadot 188d13bc63SEmmanuel VadotWhile various legacy interrupt names exist, new devices should use "wakeup" as 198d13bc63SEmmanuel Vadotthe canonical interrupt name. 20c66ec88fSEmmanuel Vadot 21c66ec88fSEmmanuel VadotList of legacy properties and respective binding document 22c66ec88fSEmmanuel Vadot--------------------------------------------------------- 23c66ec88fSEmmanuel Vadot 248bab661aSEmmanuel Vadot1. "gpio-key,wakeup" Documentation/devicetree/bindings/input/gpio-keys{,-polled}.txt 258bab661aSEmmanuel Vadot2. "has-tpo" Documentation/devicetree/bindings/rtc/rtc-opal.txt 268bab661aSEmmanuel Vadot3. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt 27c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/mfd/tc3589x.txt 28*b2d2a78aSEmmanuel Vadot Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml 29*b2d2a78aSEmmanuel Vadot4. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8921-keypad.yaml 3001950c46SEmmanuel Vadot5. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml 318bab661aSEmmanuel Vadot6. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt 32c66ec88fSEmmanuel Vadot 33c66ec88fSEmmanuel VadotExamples 34c66ec88fSEmmanuel Vadot-------- 35c66ec88fSEmmanuel Vadot 36c66ec88fSEmmanuel Vadot1. With "wakeup" interrupt name 37c66ec88fSEmmanuel Vadot 38c66ec88fSEmmanuel Vadot device@10000 { 39c66ec88fSEmmanuel Vadot compatible = "vendor,device-id"; 40c66ec88fSEmmanuel Vadot reg = <0x10000 0x1000>; 41c66ec88fSEmmanuel Vadot interrupts = <0 19 4>, <0 21 4>, <0 22 4>; 42c66ec88fSEmmanuel Vadot interrupt-names = "ack", "err", "wakeup"; 43c66ec88fSEmmanuel Vadot wakeup-source; 44c66ec88fSEmmanuel Vadot }; 45c66ec88fSEmmanuel Vadot 46c66ec88fSEmmanuel Vadot2. Without "wakeup" interrupt name 47c66ec88fSEmmanuel Vadot 48c66ec88fSEmmanuel Vadot embedded-controller { 49c66ec88fSEmmanuel Vadot compatible = "google,cros-ec-i2c"; 50c66ec88fSEmmanuel Vadot reg = <0x1e>; 51c66ec88fSEmmanuel Vadot interrupts = <6 0>; 52c66ec88fSEmmanuel Vadot interrupt-parent = <&gpx1>; 53c66ec88fSEmmanuel Vadot pinctrl-names = "default"; 54c66ec88fSEmmanuel Vadot pinctrl-0 = <&ec_irq>; 55c66ec88fSEmmanuel Vadot wakeup-source; 56c66ec88fSEmmanuel Vadot }; 57c66ec88fSEmmanuel Vadot 58c66ec88fSEmmanuel Vadot3. Without interrupts 59c66ec88fSEmmanuel Vadot 60c66ec88fSEmmanuel Vadot gpio_keys { 61c66ec88fSEmmanuel Vadot compatible = "gpio-keys"; 62c66ec88fSEmmanuel Vadot #address-cells = <1>; 63c66ec88fSEmmanuel Vadot #size-cells = <0>; 64c66ec88fSEmmanuel Vadot 65c66ec88fSEmmanuel Vadot button@1 { 66c66ec88fSEmmanuel Vadot debounce-interval = <50>; 67c66ec88fSEmmanuel Vadot wakeup-source; 68c66ec88fSEmmanuel Vadot linux,code = <116>; 69c66ec88fSEmmanuel Vadot label = "POWER"; 70c66ec88fSEmmanuel Vadot gpios = <&iofpga_gpio0 0 0x4>; 71c66ec88fSEmmanuel Vadot }; 72c66ec88fSEmmanuel Vadot [....] 73c66ec88fSEmmanuel Vadot }; 74