dt-bindings: input: Centralize 'linux,input-type' definition
authorRob Herring <robh@kernel.org>
Wed, 8 Jun 2022 21:12:06 +0000 (15:12 -0600)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 8 Jul 2022 22:17:55 +0000 (15:17 -0700)
Multiple bindings use 'linux,input-type', but there is not a central
definition and type. Add 'linux,input-type' to input.yaml and update all
the users to use it.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220608211207.2058487-5-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
Documentation/devicetree/bindings/input/gpio-keys.yaml
Documentation/devicetree/bindings/input/input.yaml
Documentation/devicetree/bindings/input/iqs626a.yaml

index 70df4b8..aa41fa3 100644 (file)
@@ -467,7 +467,6 @@ patternProperties:
           linux,code: true
 
           linux,input-type:
-            $ref: /schemas/types.yaml#/definitions/uint32
             enum: [1, 5]
             default: 1
             description:
index 01a9a1c..645dfa1 100644 (file)
@@ -36,12 +36,7 @@ patternProperties:
           description: Key / Axis code to emit.
 
         linux,input-type:
-          description:
-            Specify event type this button/key generates. If not specified defaults to
-            <1> == EV_KEY.
-          $ref: /schemas/types.yaml#/definitions/uint32
-
-          default: 1
+          default: 1  # EV_KEY
 
         linux,input-value:
           description: |
index e3701a0..17512f4 100644 (file)
@@ -31,6 +31,17 @@ properties:
     $ref: /schemas/types.yaml#/definitions/uint32
     maximum: 0x2ff
 
+  linux,input-type:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum:
+      - 1   # EV_KEY
+      - 2   # EV_REL
+      - 3   # EV_ABS
+      - 5   # EV_SW
+    description:
+      Specifies whether the event is to be interpreted as a key, relative,
+      absolute, or switch.
+
   poll-interval:
     description: Poll interval time in milliseconds.
     $ref: /schemas/types.yaml#/definitions/uint32
@@ -47,4 +58,7 @@ properties:
       reset automatically. Device with key pressed reset feature can specify
       this property.
 
+dependencies:
+  linux,input-type: [ "linux,code" ]
+
 additionalProperties: true
index 1340dcc..7a27502 100644 (file)
@@ -491,16 +491,12 @@ patternProperties:
           linux,code: true
 
           linux,input-type:
-            $ref: /schemas/types.yaml#/definitions/uint32
             enum: [1, 5]
             description:
               Specifies whether the event is to be interpreted as a key (1) or
               a switch (5). By default, Hall-channel events are interpreted as
               switches and all others are interpreted as keys.
 
-        dependencies:
-          linux,input-type: ["linux,code"]
-
         additionalProperties: false
 
     dependencies: