[PATCH v2 02/48] dt-bindings: input: gpio-keys: reference input.yaml and document properties

Krzysztof Kozlowski posted 48 patches 2 years, 3 months ago
There is a newer version of this series
[PATCH v2 02/48] dt-bindings: input: gpio-keys: reference input.yaml and document properties
Posted by Krzysztof Kozlowski 2 years, 3 months ago
The original text bindings documented "autorepeat" and "label"
properties (in the device node, beside the nodes with keys).  DTS use
also poll-interval.  Reference the input.yaml to get these top-level
properties.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/input/gpio-keys.yaml  | 32 +++++++++++--------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
index 27bb5c6ab8d9..e722e681d237 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
@@ -15,6 +15,13 @@ properties:
       - gpio-keys
       - gpio-keys-polled
 
+  autorepeat: true
+
+  label:
+    description: Name of entire device
+
+  poll-interval: true
+
 patternProperties:
   "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
     $ref: input.yaml#
@@ -94,19 +101,18 @@ patternProperties:
 
     unevaluatedProperties: false
 
-if:
-  properties:
-    compatible:
-      const: gpio-keys-polled
-then:
-  properties:
-    poll-interval:
-      description:
-        Poll interval time in milliseconds
-      $ref: /schemas/types.yaml#/definitions/uint32
-
-  required:
-    - poll-interval
+allOf:
+  - $ref: input.yaml#
+  - if:
+      properties:
+        compatible:
+          const: gpio-keys-polled
+    then:
+      required:
+        - poll-interval
+    else:
+      properties:
+        poll-interval: false
 
 additionalProperties: false
 
-- 
2.34.1
Re: [PATCH v2 02/48] dt-bindings: input: gpio-keys: reference input.yaml and document properties
Posted by Rob Herring 2 years, 3 months ago
On Thu, 09 Jun 2022 13:39:04 +0200, Krzysztof Kozlowski wrote:
> The original text bindings documented "autorepeat" and "label"
> properties (in the device node, beside the nodes with keys).  DTS use
> also poll-interval.  Reference the input.yaml to get these top-level
> properties.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/input/gpio-keys.yaml  | 32 +++++++++++--------
>  1 file changed, 19 insertions(+), 13 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>