gpio-poweroff.yaml 1.6 KB

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