devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/4] power: reset: gpio-poweroff: use sys-off handler API
@ 2023-09-28 12:32 Francesco Dolcini
       [not found] ` <20230928123728.21901-1-francesco@dolcini.it>
  0 siblings, 1 reply; 3+ messages in thread
From: Francesco Dolcini @ 2023-09-28 12:32 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Francesco Dolcini, linux-pm, devicetree, linux-kernel

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Use the new sys-off handler API for gpio-poweroff. This allows us to have more
than one power-off handler and to have a priority for the handler. Also, add a
priority property so we can use gpio-poweroff even when registering another
poweroff handler or using the legacy pm_power_off method.

Stefan Eichenberger (4):
  power: reset: gpio-poweroff: use a struct to store the module
    variables
  power: reset: gpio-poweroff: use sys-off handler API
  dt-bindings: power: reset: gpio-poweroff: Add priority property
  power: reset: gpio-poweroff: make sys handler priority configurable

 .../bindings/power/reset/gpio-poweroff.yaml   |  4 +
 drivers/power/reset/gpio-poweroff.c           | 82 ++++++++++---------
 2 files changed, 48 insertions(+), 38 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 3/4] dt-bindings: power: reset: gpio-poweroff: Add priority property
       [not found] ` <20230928123728.21901-1-francesco@dolcini.it>
@ 2023-09-28 12:37   ` Francesco Dolcini
  2023-10-02 16:39     ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Francesco Dolcini @ 2023-09-28 12:37 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Stefan Eichenberger, linux-pm, devicetree, linux-kernel,
	Francesco Dolcini

From: Stefan Eichenberger <stefan.eichenberger@toradex.com>

Add the priority property to the gpio-poweroff bindings description.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 .../devicetree/bindings/power/reset/gpio-poweroff.yaml        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
index b54ec003a1e0..c6404841bcd7 100644
--- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
+++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
@@ -40,6 +40,10 @@ properties:
     default: 100
     description: Delay to wait after driving gpio inactive
 
+  priority:
+    default: 0
+    description: Priority of the power off handler
+
   timeout-ms:
     default: 3000
     description: Time to wait before assuming the power off sequence failed.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 3/4] dt-bindings: power: reset: gpio-poweroff: Add priority property
  2023-09-28 12:37   ` [PATCH v1 3/4] dt-bindings: power: reset: gpio-poweroff: Add priority property Francesco Dolcini
@ 2023-10-02 16:39     ` Rob Herring
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2023-10-02 16:39 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Sebastian Reichel, Krzysztof Kozlowski, Conor Dooley,
	Stefan Eichenberger, linux-pm, devicetree, linux-kernel,
	Francesco Dolcini

On Thu, Sep 28, 2023 at 02:37:27PM +0200, Francesco Dolcini wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> 
> Add the priority property to the gpio-poweroff bindings description.
> 
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  .../devicetree/bindings/power/reset/gpio-poweroff.yaml        | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
> index b54ec003a1e0..c6404841bcd7 100644
> --- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
> @@ -40,6 +40,10 @@ properties:
>      default: 100
>      description: Delay to wait after driving gpio inactive
>  
> +  priority:
> +    default: 0
> +    description: Priority of the power off handler
> +

You also need a $ref to restart-handler.yaml (at the top level).

>    timeout-ms:
>      default: 3000
>      description: Time to wait before assuming the power off sequence failed.
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-02 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-28 12:32 [PATCH v1 0/4] power: reset: gpio-poweroff: use sys-off handler API Francesco Dolcini
     [not found] ` <20230928123728.21901-1-francesco@dolcini.it>
2023-09-28 12:37   ` [PATCH v1 3/4] dt-bindings: power: reset: gpio-poweroff: Add priority property Francesco Dolcini
2023-10-02 16:39     ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).