public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] 'force-mode' for gpio-poweroff driver
@ 2019-09-30 14:12 Oleksandr Suvorov
  2019-09-30 14:12 ` [PATCH v2 2/2] dt-bindings: power: reset: gpio-poweroff: Add 'force-mode' property Oleksandr Suvorov
  0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Suvorov @ 2019-09-30 14:12 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: Marcel Ziswiler, Jamie Lentin, linux-pm@vger.kernel.org,
	Andrew Lunn, Igor Opaniuk, Oleksandr Suvorov,
	devicetree@vger.kernel.org, Sebastian Reichel, Rob Herring,
	Mark Rutland

This patch introduces a feature to force gpio-poweroff module
to register its own pm_power_off handler even if someone has registered
this handler earlier.
Useful to change a way to power off the system using DT files.

Changes in v2:
Call next pm_power_off handler if the current one
fails to power system off.

Oleksandr Suvorov (2):
  power: reset: gpio-poweroff: add force mode
  dt-bindings: power: reset: gpio-poweroff: Add 'force-mode' property

 .../bindings/power/reset/gpio-poweroff.txt    |  3 ++
 drivers/power/reset/gpio-poweroff.c           | 34 +++++++++++++++----
 2 files changed, 31 insertions(+), 6 deletions(-)

-- 
2.20.1

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

* [PATCH v2 2/2] dt-bindings: power: reset: gpio-poweroff: Add 'force-mode' property
  2019-09-30 14:12 [PATCH v2 0/2] 'force-mode' for gpio-poweroff driver Oleksandr Suvorov
@ 2019-09-30 14:12 ` Oleksandr Suvorov
  2019-10-11 14:48   ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Suvorov @ 2019-09-30 14:12 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: Marcel Ziswiler, Jamie Lentin, linux-pm@vger.kernel.org,
	Andrew Lunn, Igor Opaniuk, Oleksandr Suvorov,
	devicetree@vger.kernel.org, Sebastian Reichel, Rob Herring,
	Mark Rutland

Add 'force-mode' property to allow the driver to load even if
someone has registered the pm_power_off hook earlier.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

---

Changes in v2: None

 .../devicetree/bindings/power/reset/gpio-poweroff.txt          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
index 3e56c1b34a4c..2056e299a472 100644
--- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
+++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
@@ -31,6 +31,9 @@ Optional properties:
 - inactive-delay-ms: Delay (default 100) to wait after driving gpio inactive
 - timeout-ms: Time to wait before asserting a WARN_ON(1). If nothing is
               specified, 3000 ms is used.
+- force-mode: Force replacing pm_power_off kernel hook.
+  If this optional property is not specified, the driver will fail to
+  load if someone has registered the pm_power_off hook earlier.
 
 Examples:
 
-- 
2.20.1

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

* Re: [PATCH v2 2/2] dt-bindings: power: reset: gpio-poweroff: Add 'force-mode' property
  2019-09-30 14:12 ` [PATCH v2 2/2] dt-bindings: power: reset: gpio-poweroff: Add 'force-mode' property Oleksandr Suvorov
@ 2019-10-11 14:48   ` Rob Herring
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2019-10-11 14:48 UTC (permalink / raw)
  To: Oleksandr Suvorov
  Cc: linux-kernel@vger.kernel.org, Marcel Ziswiler, Jamie Lentin,
	linux-pm@vger.kernel.org, Andrew Lunn, Igor Opaniuk,
	devicetree@vger.kernel.org, Sebastian Reichel, Mark Rutland

On Mon, Sep 30, 2019 at 02:12:53PM +0000, Oleksandr Suvorov wrote:
> Add 'force-mode' property to allow the driver to load even if
> someone has registered the pm_power_off hook earlier.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> ---
> 
> Changes in v2: None
> 
>  .../devicetree/bindings/power/reset/gpio-poweroff.txt          | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
> index 3e56c1b34a4c..2056e299a472 100644
> --- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
> +++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
> @@ -31,6 +31,9 @@ Optional properties:
>  - inactive-delay-ms: Delay (default 100) to wait after driving gpio inactive
>  - timeout-ms: Time to wait before asserting a WARN_ON(1). If nothing is
>                specified, 3000 ms is used.
> +- force-mode: Force replacing pm_power_off kernel hook.
> +  If this optional property is not specified, the driver will fail to
> +  load if someone has registered the pm_power_off hook earlier.

What if the init order changes?

This is too tied to a specific OS implementation to go in DT.

Rob

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

end of thread, other threads:[~2019-10-11 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-30 14:12 [PATCH v2 0/2] 'force-mode' for gpio-poweroff driver Oleksandr Suvorov
2019-09-30 14:12 ` [PATCH v2 2/2] dt-bindings: power: reset: gpio-poweroff: Add 'force-mode' property Oleksandr Suvorov
2019-10-11 14:48   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox