1c66ec88fSEmmanuel VadotSpecifying wakeup capability for devices
2c66ec88fSEmmanuel Vadot============================================
3c66ec88fSEmmanuel Vadot
4c66ec88fSEmmanuel VadotAny device nodes
5c66ec88fSEmmanuel Vadot----------------
6*8d13bc63SEmmanuel VadotNodes that describe devices which have wakeup capability may contain a
7c66ec88fSEmmanuel Vadot"wakeup-source" boolean property.
8c66ec88fSEmmanuel Vadot
9*8d13bc63SEmmanuel VadotIf the device is marked as a wakeup-source, interrupt wake capability depends
10*8d13bc63SEmmanuel Vadoton the device specific "interrupt-names" property. If no interrupts are labeled
11*8d13bc63SEmmanuel Vadotas wake capable, then it is up to the device to determine which interrupts can
12*8d13bc63SEmmanuel Vadotwake the system.
13c66ec88fSEmmanuel Vadot
14*8d13bc63SEmmanuel VadotHowever if a device has a dedicated interrupt as the wakeup source, then it
15*8d13bc63SEmmanuel Vadotneeds to specify/identify it using a device specific interrupt name. In such
16*8d13bc63SEmmanuel Vadotcases only that interrupt can be used as a wakeup interrupt.
17*8d13bc63SEmmanuel Vadot
18*8d13bc63SEmmanuel VadotWhile various legacy interrupt names exist, new devices should use "wakeup" as
19*8d13bc63SEmmanuel 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
28c66ec88fSEmmanuel Vadot				Documentation/devicetree/bindings/input/touchscreen/ads7846.txt
298bab661aSEmmanuel Vadot4. "linux,keypad-wakeup"	Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
308bab661aSEmmanuel Vadot5. "linux,input-wakeup"		Documentation/devicetree/bindings/input/samsung-keypad.txt
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