xref: /freebsd/sys/contrib/device-tree/Bindings/power/reset/gpio-poweroff.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2e67e8565SEmmanuel Vadot%YAML 1.2
3e67e8565SEmmanuel Vadot---
4e67e8565SEmmanuel Vadot$id: http://devicetree.org/schemas/power/reset/gpio-poweroff.yaml#
5e67e8565SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6e67e8565SEmmanuel Vadot
7e67e8565SEmmanuel Vadottitle: GPIO controlled power off
8e67e8565SEmmanuel Vadot
9e67e8565SEmmanuel Vadotmaintainers:
10e67e8565SEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
11e67e8565SEmmanuel Vadot
12e67e8565SEmmanuel Vadotdescription: >
13e67e8565SEmmanuel Vadot  System power off support via a GPIO line. When a shutdown is
14e67e8565SEmmanuel Vadot  executed the operating system is expected to switch the GPIO
15e67e8565SEmmanuel Vadot  from inactive to active. After a delay (active-delay-ms) it
16e67e8565SEmmanuel Vadot  is expected to be switched back to inactive. After another
17e67e8565SEmmanuel Vadot  delay (inactive-delay-ms) it is configured as active again.
18e67e8565SEmmanuel Vadot  Finally the operating system assumes the power off failed if
19e67e8565SEmmanuel Vadot  the system is still running after waiting some time (timeout-ms).
20e67e8565SEmmanuel Vadot
21*84943d6fSEmmanuel VadotallOf:
22*84943d6fSEmmanuel Vadot  - $ref: restart-handler.yaml#
23*84943d6fSEmmanuel Vadot
24e67e8565SEmmanuel Vadotproperties:
25e67e8565SEmmanuel Vadot  compatible:
26e67e8565SEmmanuel Vadot    const: gpio-poweroff
27e67e8565SEmmanuel Vadot
28e67e8565SEmmanuel Vadot  gpios:
29e67e8565SEmmanuel Vadot    maxItems: 1
30e67e8565SEmmanuel Vadot
31e67e8565SEmmanuel Vadot  input:
32e67e8565SEmmanuel Vadot    type: boolean
33e67e8565SEmmanuel Vadot    description: >
34e67e8565SEmmanuel Vadot      Initially configure the GPIO line as an input. Only reconfigure
35e67e8565SEmmanuel Vadot      it to an output when the power-off sequence is initiated. If this optional
36e67e8565SEmmanuel Vadot      property is not specified, the GPIO is initialized as an output in its inactive state.
37e67e8565SEmmanuel Vadot
38e67e8565SEmmanuel Vadot  active-delay-ms:
39e67e8565SEmmanuel Vadot    default: 100
40e67e8565SEmmanuel Vadot    description: Delay to wait after driving gpio active
41e67e8565SEmmanuel Vadot
42e67e8565SEmmanuel Vadot  inactive-delay-ms:
43e67e8565SEmmanuel Vadot    default: 100
44e67e8565SEmmanuel Vadot    description: Delay to wait after driving gpio inactive
45e67e8565SEmmanuel Vadot
46*84943d6fSEmmanuel Vadot  priority:
47*84943d6fSEmmanuel Vadot    default: 0
48*84943d6fSEmmanuel Vadot
49e67e8565SEmmanuel Vadot  timeout-ms:
50e67e8565SEmmanuel Vadot    default: 3000
51e67e8565SEmmanuel Vadot    description: Time to wait before assuming the power off sequence failed.
52e67e8565SEmmanuel Vadot
53e67e8565SEmmanuel Vadotrequired:
54e67e8565SEmmanuel Vadot  - compatible
55e67e8565SEmmanuel Vadot  - gpios
56e67e8565SEmmanuel Vadot
57e67e8565SEmmanuel VadotadditionalProperties: false
58e67e8565SEmmanuel Vadot
59e67e8565SEmmanuel Vadotexamples:
60e67e8565SEmmanuel Vadot  - |
61e67e8565SEmmanuel Vadot    gpio-poweroff {
62e67e8565SEmmanuel Vadot        compatible = "gpio-poweroff";
63e67e8565SEmmanuel Vadot        gpios = <&gpio 4 0>;
64e67e8565SEmmanuel Vadot        timeout-ms = <3000>;
65e67e8565SEmmanuel Vadot    };
66