diff mbox series

[v2,1/2] dt-bindings: power: reset: gpio-poweroff: Add 'timeout_ms' property

Message ID 20180219225918.2311-1-mdf@kernel.org
State Changes Requested, archived
Headers show
Series [v2,1/2] dt-bindings: power: reset: gpio-poweroff: Add 'timeout_ms' property | expand

Commit Message

Moritz Fischer Feb. 19, 2018, 10:59 p.m. UTC
Add 'timeout_ms' property to support boards where the 3s timeout that the
current driver defaults to is too short.

Signed-off-by: Moritz Fischer <mdf@kernel.org>
---

Changes from v1:
- Addressed Rob's feedback (timeout -> timeout_ms)
- Added to old example rather than creating separate one

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

Comments

Andy Shevchenko Feb. 20, 2018, 2:12 p.m. UTC | #1
On Tue, Feb 20, 2018 at 12:59 AM, Moritz Fischer <mdf@kernel.org> wrote:
> Add support for reading a timeout value from devicetree.
> Fall back to previous default of 3s if nothing is specified.


> +       of_property_read_u32(pdev->dev.of_node, "timeout_ms", &timeout);

Perhaps stop being OF-centric by using device_property_read_u32() instead?
Rob Herring Feb. 20, 2018, 2:18 p.m. UTC | #2
On Mon, Feb 19, 2018 at 4:59 PM, Moritz Fischer <mdf@kernel.org> wrote:
> Add 'timeout_ms' property to support boards where the 3s timeout that the
> current driver defaults to is too short.
>
> Signed-off-by: Moritz Fischer <mdf@kernel.org>
> ---
>
> Changes from v1:
> - Addressed Rob's feedback (timeout -> timeout_ms)
> - Added to old example rather than creating separate one
>
> ---
>  Documentation/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 e62d53d844cc..3f557b344dc4 100644
> --- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
> +++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
> @@ -27,10 +27,13 @@ Optional properties:
>    it to an output when the power-off handler is called. If this optional
>    property is not specified, the GPIO is initialized as an output in its
>    inactive state.
> +- timeout_ms: Time to wait before asserting a WARN_ON(1). If nothing is
> +              specified, 3000 ms is used.

timeout-ms
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Moritz Fischer Feb. 20, 2018, 4:41 p.m. UTC | #3
On Tue, Feb 20, 2018 at 04:12:59PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 20, 2018 at 12:59 AM, Moritz Fischer <mdf@kernel.org> wrote:
> > Add support for reading a timeout value from devicetree.
> > Fall back to previous default of 3s if nothing is specified.
> 
> 
> > +       of_property_read_u32(pdev->dev.of_node, "timeout_ms", &timeout);
> 
> Perhaps stop being OF-centric by using device_property_read_u32() instead?

Good catch, will do. Should probably change commit message accordingly,
too.

Thanks,

Moritz
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
index e62d53d844cc..3f557b344dc4 100644
--- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
+++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt
@@ -27,10 +27,13 @@  Optional properties:
   it to an output when the power-off handler is called. If this optional
   property is not specified, the GPIO is initialized as an output in its
   inactive state.
+- timeout_ms: Time to wait before asserting a WARN_ON(1). If nothing is
+              specified, 3000 ms is used.
 
 Examples:
 
 gpio-poweroff {
 	compatible = "gpio-poweroff";
 	gpios = <&gpio 4 0>;
+	timeout_ms = <3000>;
 };