mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sander Vanheule <sander@svanheule.net>
To: linux-pm@vger.kernel.org, devicetree@vger.kernel.org
Cc: Sebastian Reichel <sre@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org,
	Sander Vanheule <sander@svanheule.net>
Subject: [RFC PATCH v1 1/3] dt-bindings: power: reset: Convert gpio-restart binding to schema
Date: Thu, 30 Dec 2021 19:06:01 +0100	[thread overview]
Message-ID: <c47705dbf6e9e287332f3ccb91578e81dbb81625.1640887456.git.sander@svanheule.net> (raw)
In-Reply-To: <cover.1640887456.git.sander@svanheule.net>

Convert the gpio-restart binding from plain text format to a schema
binding, maintaining the original content and updating formatting where
required.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
 .../bindings/power/reset/gpio-restart.txt     | 54 -----------
 .../bindings/power/reset/gpio-restart.yaml    | 92 +++++++++++++++++++
 2 files changed, 92 insertions(+), 54 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/power/reset/gpio-restart.txt
 create mode 100644 Documentation/devicetree/bindings/power/reset/gpio-restart.yaml

diff --git a/Documentation/devicetree/bindings/power/reset/gpio-restart.txt b/Documentation/devicetree/bindings/power/reset/gpio-restart.txt
deleted file mode 100644
index af3701bc15c4..000000000000
--- a/Documentation/devicetree/bindings/power/reset/gpio-restart.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-Drive a GPIO line that can be used to restart the system from a restart
-handler.
-
-This binding supports level and edge triggered reset.  At driver load
-time, the driver will request the given gpio line and install a restart
-handler. If the optional properties 'open-source' is not found, the GPIO line
-will be driven in the inactive state.  Otherwise its not driven until
-the restart is initiated.
-
-When the system is restarted, the restart handler will be invoked in
-priority order.  The gpio is configured as an output, and driven active,
-triggering a level triggered reset condition. This will also cause an
-inactive->active edge condition, triggering positive edge triggered
-reset. After a delay specified by active-delay, the GPIO is set to
-inactive, thus causing an active->inactive edge, triggering negative edge
-triggered reset. After a delay specified by inactive-delay, the GPIO
-is driven active again.  After a delay specified by wait-delay, the
-restart handler completes allowing other restart handlers to be attempted.
-
-Required properties:
-- compatible : should be "gpio-restart".
-- gpios : The GPIO to set high/low, see "gpios property" in
-  Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be
-  low to reset the board set it to "Active Low", otherwise set
-  gpio to "Active High".
-
-Optional properties:
-- open-source : Treat the GPIO as being open source and defer driving
-  it to when the restart is initiated.  If this optional property is not
-  specified, the GPIO is initialized as an output in its inactive state.
-- priority : A priority ranging from 0 to 255 (default 128) according to
-  the following guidelines:
-	0:	Restart handler of last resort, with limited restart
-		capabilities
-	128:	Default restart handler; use if no other restart handler is
-		expected to be available, and/or if restart functionality is
-		sufficient to restart the entire system
-	255:	Highest priority restart handler, will preempt all other
-		restart handlers
-- active-delay: Delay (default 100) to wait after driving gpio active [ms]
-- inactive-delay: Delay (default 100) to wait after driving gpio inactive [ms]
-- wait-delay: Delay (default 3000) to wait after completing restart
-  sequence [ms]
-
-Examples:
-
-gpio-restart {
-	compatible = "gpio-restart";
-	gpios = <&gpio 4 0>;
-	priority = <128>;
-	active-delay = <100>;
-	inactive-delay = <100>;
-	wait-delay = <3000>;
-};
diff --git a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
new file mode 100644
index 000000000000..6a1f4aeebf49
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/reset/gpio-restart.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO-driven system restart
+
+maintainers:
+  - TODO
+
+description:
+  Drive a GPIO line that can be used to restart the system from a restart
+  handler.
+
+  This binding supports level and edge triggered reset. At driver load time,
+  the driver will request the given gpio line and install a restart handler. If
+  the optional properties 'open-source' is not found, the GPIO line will be
+  driven in the inactive state. Otherwise its not driven until the restart is
+  initiated.
+
+  When the system is restarted, the restart handler will be invoked in priority
+  order. The gpio is configured as an output, and driven active, triggering a
+  level triggered reset condition. This will also cause an inactive->active
+  edge condition, triggering positive edge triggered reset. After a delay
+  specified by active-delay, the GPIO is set to inactive, thus causing an
+  active->inactive edge, triggering negative edge triggered reset. After a
+  delay specified by inactive-delay, the GPIO is driven active again. After a
+  delay specified by wait-delay, the restart handler completes allowing other
+  restart handlers to be attempted.
+
+properties:
+  compatible:
+    const: gpio-restart
+
+  gpios:
+    maxItems: 1
+    description:
+      The GPIO to set high/low, see "gpios property" in
+      Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be low
+      to reset the board set it to "Active Low", otherwise set gpio to "Active
+      High".
+
+  open-source:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Treat the GPIO as being open source and defer driving it to when the
+      restart is initiated. If this optional property is not specified, the
+      GPIO is initialized as an output in its inactive state.
+
+  priority:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      A priority ranging from 0 to 255 (default 128) according to the following
+      guidelines:
+      0:    Restart handler of last resort, with limited restart
+            capabilities
+      128:  Default restart handler; use if no other restart handler is
+            expected to be available, and/or if restart functionality is
+            sufficient to restart the entire system
+      255:  Highest priority restart handler, will preempt all other
+            restart handlers
+
+  active-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Delay (default 100) to wait after driving gpio active [ms]
+
+  inactive-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Delay (default 100) to wait after driving gpio inactive [ms]
+
+  wait-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay (default 3000) to wait after completing restart sequence [ms]
+
+required:
+  - compatible
+  - gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    gpio-restart {
+      compatible = "gpio-restart";
+      gpios = <&gpio 4 0>;
+      priority = <128>;
+      active-delay = <100>;
+      inactive-delay = <100>;
+      wait-delay = <3000>;
+    };
-- 
2.33.1


  reply	other threads:[~2021-12-30 18:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 18:06 [RFC PATCH v1 0/3] convert gpio-restart bindings to yaml Sander Vanheule
2021-12-30 18:06 ` Sander Vanheule [this message]
2021-12-30 18:11   ` [RFC PATCH v1 1/3] dt-bindings: power: reset: Convert gpio-restart binding to schema Sander Vanheule
2022-01-01 22:01   ` Rob Herring
2021-12-30 18:06 ` [RFC PATCH v1 2/3] dt-bindings: power: reset: gpio-restart: Add -ms suffix to delays Sander Vanheule
2022-01-10 20:38   ` Rob Herring
2022-01-10 20:55     ` Sander Vanheule
2021-12-30 18:06 ` [RFC PATCH v1 3/3] dt-bindings: power: reset: gpio-restart: Correct default priority Sander Vanheule

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c47705dbf6e9e287332f3ccb91578e81dbb81625.1640887456.git.sander@svanheule.net \
    --to=sander@svanheule.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome