diff mbox series

[RFC,v1,2/3] dt-bindings: power: reset: gpio-restart: Add -ms suffix to delays

Message ID 35e4da34fb7e18ea7e3af2405db4c5a2a7ba2dfe.1640887456.git.sander@svanheule.net
State New
Headers show
Series convert gpio-restart bindings to yaml | expand

Commit Message

Sander Vanheule Dec. 30, 2021, 6:06 p.m. UTC
The delay properties are expressed in milliseconds, so the property
names should have a -ms suffix. Add the suffix, and deprecate the
original properties.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
 .../bindings/power/reset/gpio-restart.yaml    | 27 ++++++++++++-------
 1 file changed, 18 insertions(+), 9 deletions(-)

Comments

Rob Herring (Arm) Jan. 10, 2022, 8:38 p.m. UTC | #1
On Thu, Dec 30, 2021 at 07:06:02PM +0100, Sander Vanheule wrote:
> The delay properties are expressed in milliseconds, so the property
> names should have a -ms suffix. Add the suffix, and deprecate the
> original properties.
> 
> Signed-off-by: Sander Vanheule <sander@svanheule.net>
> ---
>  .../bindings/power/reset/gpio-restart.yaml    | 27 ++++++++++++-------
>  1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> index 6a1f4aeebf49..13827fe7b395 100644
> --- a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> @@ -62,17 +62,26 @@ properties:
>              restart handlers
>  
>    active-delay:
> -    $ref: /schemas/types.yaml#/definitions/uint32
> -    description: Delay (default 100) to wait after driving gpio active [ms]
> +    $ref: '#/properties/active-delay-ms'

While 'active-delay-ms' has a type because '.*-ms' has a type, you just 
removed the type for this property. Now 'active-delay = "foo"' is valid.

While it would be nice to change this, we're pretty much stuck with it 
forever. I don't think supporting both versions in the kernel is worth 
it.

Rob
Sander Vanheule Jan. 10, 2022, 8:55 p.m. UTC | #2
Hi Rob,

On Mon, 2022-01-10 at 14:38 -0600, Rob Herring wrote:
> On Thu, Dec 30, 2021 at 07:06:02PM +0100, Sander Vanheule wrote:
> > The delay properties are expressed in milliseconds, so the property
> > names should have a -ms suffix. Add the suffix, and deprecate the
> > original properties.
> > 
> > Signed-off-by: Sander Vanheule <sander@svanheule.net>
> > ---
> >  .../bindings/power/reset/gpio-restart.yaml    | 27 ++++++++++++-------
> >  1 file changed, 18 insertions(+), 9 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> > b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> > index 6a1f4aeebf49..13827fe7b395 100644
> > --- a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> > +++ b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
> > @@ -62,17 +62,26 @@ properties:
> >              restart handlers
> >  
> >    active-delay:
> > -    $ref: /schemas/types.yaml#/definitions/uint32
> > -    description: Delay (default 100) to wait after driving gpio active [ms]
> > +    $ref: '#/properties/active-delay-ms'
> 
> While 'active-delay-ms' has a type because '.*-ms' has a type, you just 
> removed the type for this property. Now 'active-delay = "foo"' is valid.

Good to know, I would've expected the type to be inherited.

> While it would be nice to change this, we're pretty much stuck with it 
> forever. I don't think supporting both versions in the kernel is worth 
> it.

Figured as much. I'll just keep patch 3/3 then.

Thanks for the feedback!

Best,
Sander
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
index 6a1f4aeebf49..13827fe7b395 100644
--- a/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
+++ b/Documentation/devicetree/bindings/power/reset/gpio-restart.yaml
@@ -62,17 +62,26 @@  properties:
             restart handlers
 
   active-delay:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: Delay (default 100) to wait after driving gpio active [ms]
+    $ref: '#/properties/active-delay-ms'
+    deprecated: true
 
   inactive-delay:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: Delay (default 100) to wait after driving gpio inactive [ms]
+    $ref: '#/properties/inactive-delay-ms'
+    deprecated: true
 
   wait-delay:
-    $ref: /schemas/types.yaml#/definitions/uint32
+    $ref: '#/properties/wait-delay-ms'
+    deprecated: true
+
+  active-delay-ms:
+    description: Delay (default 100 ms) to wait after driving gpio active
+
+  inactive-delay-ms:
+    description: Delay (default 100 ms) to wait after driving gpio inactive
+
+  wait-delay-ms:
     description:
-      Delay (default 3000) to wait after completing restart sequence [ms]
+      Delay (default 3000 ms) to wait after completing restart sequence
 
 required:
   - compatible
@@ -86,7 +95,7 @@  examples:
       compatible = "gpio-restart";
       gpios = <&gpio 4 0>;
       priority = <128>;
-      active-delay = <100>;
-      inactive-delay = <100>;
-      wait-delay = <3000>;
+      active-delay-ms = <100>;
+      inactive-delay-ms = <100>;
+      wait-delay-ms = <3000>;
     };