linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion
@ 2022-06-08 21:12 Rob Herring
  2022-06-08 21:12 ` [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff Rob Herring
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Rob Herring @ 2022-06-08 21:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

This series refactors the common 'linux,code', 'linux,keycodes', and
'linux,input-type' properties defined in various binding schemas. As the
properties are common, they should only have a single common schema type
definition. Note that 'linux,input-value' was not included here as it is
only used in 1 binding (gpio-keys).

The clean-ups are are result of the discussion on v1 of the adc-keys
binding conversion[1].

Rob

[1] https://lore.kernel.org/all/20220606184243.1057145-1-robh@kernel.org/


Rob Herring (5):
  dt-bindings: input: Increase maximum keycode value to 0x2ff
  dt-bindings: input: Centralize 'linux,code' definition
  dt-bindings: input: Use common 'linux,keycodes' definition
  dt-bindings: input: Centralize 'linux,input-type' definition
  dt-bindings: input: Convert adc-keys to DT schema

 .../bindings/input/adc-joystick.yaml          |   2 +-
 .../devicetree/bindings/input/adc-keys.txt    |  67 ------------
 .../devicetree/bindings/input/adc-keys.yaml   | 103 ++++++++++++++++++
 .../input/allwinner,sun4i-a10-lradc-keys.yaml |   5 +-
 .../bindings/input/azoteq,iqs7222.yaml        |   8 +-
 .../devicetree/bindings/input/gpio-keys.yaml  |   8 +-
 .../devicetree/bindings/input/input.yaml      |  24 +++-
 .../devicetree/bindings/input/iqs269a.yaml    |  15 +--
 .../devicetree/bindings/input/iqs626a.yaml    |  11 +-
 .../bindings/input/iqs62x-keys.yaml           |   9 +-
 .../bindings/input/max77650-onkey.yaml        |   8 +-
 11 files changed, 150 insertions(+), 110 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/adc-keys.txt
 create mode 100644 Documentation/devicetree/bindings/input/adc-keys.yaml

-- 
2.34.1


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

* [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
  2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
@ 2022-06-08 21:12 ` Rob Herring
  2022-06-09  1:29   ` Jeff LaBundy
  2022-06-09  5:46   ` Heinrich Schuchardt
  2022-06-08 21:12 ` [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition Rob Herring
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Rob Herring @ 2022-06-08 21:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
users and examples with values greater than 0xff, but the schema is not
yet applied in those cases.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/input/input.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
index d41d8743aad4..43d2f299c332 100644
--- a/Documentation/devicetree/bindings/input/input.yaml
+++ b/Documentation/devicetree/bindings/input/input.yaml
@@ -21,7 +21,7 @@ properties:
     $ref: /schemas/types.yaml#/definitions/uint32-array
     items:
       minimum: 0
-      maximum: 0xff
+      maximum: 0x2ff
 
   poll-interval:
     description: Poll interval time in milliseconds.
-- 
2.34.1


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

* [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
  2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
  2022-06-08 21:12 ` [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff Rob Herring
@ 2022-06-08 21:12 ` Rob Herring
  2022-06-09  1:32   ` Jeff LaBundy
                     ` (2 more replies)
  2022-06-08 21:12 ` [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition Rob Herring
                   ` (3 subsequent siblings)
  5 siblings, 3 replies; 17+ messages in thread
From: Rob Herring @ 2022-06-08 21:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

Multiple bindings use 'linux,code', but there is not a central
definition and type. Add 'linux,code' to input.yaml and update all the
users to use it.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/input/adc-joystick.yaml   |  2 +-
 .../input/allwinner,sun4i-a10-lradc-keys.yaml     |  5 ++---
 .../devicetree/bindings/input/azoteq,iqs7222.yaml |  7 ++-----
 .../devicetree/bindings/input/gpio-keys.yaml      |  1 -
 .../devicetree/bindings/input/input.yaml          |  8 ++++++++
 .../devicetree/bindings/input/iqs269a.yaml        | 15 ++++++---------
 .../devicetree/bindings/input/iqs626a.yaml        |  5 ++---
 .../devicetree/bindings/input/iqs62x-keys.yaml    |  5 ++---
 .../devicetree/bindings/input/max77650-onkey.yaml |  8 ++++----
 9 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/adc-joystick.yaml b/Documentation/devicetree/bindings/input/adc-joystick.yaml
index 2ee04e03bc22..64d961458ac7 100644
--- a/Documentation/devicetree/bindings/input/adc-joystick.yaml
+++ b/Documentation/devicetree/bindings/input/adc-joystick.yaml
@@ -45,6 +45,7 @@ additionalProperties: false
 patternProperties:
   "^axis@[0-9a-f]+$":
     type: object
+    $ref: input.yaml#
     description: >
       Represents a joystick axis bound to the given ADC channel.
       For each entry in the io-channels list, one axis subnode with a matching
@@ -57,7 +58,6 @@ patternProperties:
         description: Index of an io-channels list entry bound to this axis.
 
       linux,code:
-        $ref: /schemas/types.yaml#/definitions/uint32
         description: EV_ABS specific event code generated by the axis.
 
       abs-range:
diff --git a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
index 3399fc288afb..9700dc468b25 100644
--- a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
+++ b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
@@ -44,14 +44,13 @@ properties:
 patternProperties:
   "^button-[0-9]+$":
     type: object
+    $ref: input.yaml#
     properties:
       label:
         $ref: /schemas/types.yaml#/definitions/string
         description: Descriptive name of the key
 
-      linux,code:
-        $ref: /schemas/types.yaml#/definitions/uint32
-        description: Keycode to emit
+      linux,code: true
 
       channel:
         $ref: /schemas/types.yaml#/definitions/uint32
diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
index a3a1e5a65306..5ea10fe7ffe9 100644
--- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
+++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
@@ -421,6 +421,7 @@ patternProperties:
     patternProperties:
       "^event-(prox|touch)$":
         type: object
+        $ref: input.yaml#
         description:
           Represents a proximity or touch event reported by the channel.
 
@@ -467,11 +468,7 @@ patternProperties:
               The IQS7222B does not feature channel-specific timeouts; the time-
               out specified for any one channel applies to all channels.
 
-          linux,code:
-            $ref: /schemas/types.yaml#/definitions/uint32
-            description:
-              Numeric key or switch code associated with the event. Specify
-              KEY_RESERVED (0) to opt out of event reporting.
+          linux,code: true
 
           linux,input-type:
             $ref: /schemas/types.yaml#/definitions/uint32
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
index 7fe1966ea28a..cd07107fd5ed 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
@@ -34,7 +34,6 @@ patternProperties:
 
         linux,code:
           description: Key / Axis code to emit.
-          $ref: /schemas/types.yaml#/definitions/uint32
 
         linux,input-type:
           description:
diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
index 43d2f299c332..e3701a0bc500 100644
--- a/Documentation/devicetree/bindings/input/input.yaml
+++ b/Documentation/devicetree/bindings/input/input.yaml
@@ -23,6 +23,14 @@ properties:
       minimum: 0
       maximum: 0x2ff
 
+  linux,code:
+    description:
+      Specifies a single numeric keycode value to be used for reporting
+      button/switch events. Specify KEY_RESERVED (0) to opt out of event
+      reporting.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maximum: 0x2ff
+
   poll-interval:
     description: Poll interval time in milliseconds.
     $ref: /schemas/types.yaml#/definitions/uint32
diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml b/Documentation/devicetree/bindings/input/iqs269a.yaml
index 9c154e5e1a91..c22f8f27913a 100644
--- a/Documentation/devicetree/bindings/input/iqs269a.yaml
+++ b/Documentation/devicetree/bindings/input/iqs269a.yaml
@@ -370,6 +370,7 @@ patternProperties:
     patternProperties:
       "^event-prox(-alt)?$":
         type: object
+        $ref: input.yaml#
         description:
           Represents a proximity event reported by the channel in response to
           a decrease in counts. Node names suffixed with '-alt' instead corre-
@@ -396,14 +397,13 @@ patternProperties:
             default: 10
             description: Specifies the threshold for the event.
 
-          linux,code:
-            $ref: /schemas/types.yaml#/definitions/uint32
-            description: Numeric key or switch code associated with the event.
+          linux,code: true
 
         additionalProperties: false
 
       "^event-touch(-alt)?$":
         type: object
+        $ref: input.yaml#
         description: Represents a touch event reported by the channel.
 
         properties:
@@ -421,14 +421,13 @@ patternProperties:
             default: 4
             description: Specifies the hysteresis for the event.
 
-          linux,code:
-            $ref: /schemas/types.yaml#/definitions/uint32
-            description: Numeric key or switch code associated with the event.
+          linux,code: true
 
         additionalProperties: false
 
       "^event-deep(-alt)?$":
         type: object
+        $ref: input.yaml#
         description: Represents a deep-touch event reported by the channel.
 
         properties:
@@ -446,9 +445,7 @@ patternProperties:
             default: 0
             description: Specifies the hysteresis for the event.
 
-          linux,code:
-            $ref: /schemas/types.yaml#/definitions/uint32
-            description: Numeric key or switch code associated with the event.
+          linux,code: true
 
         additionalProperties: false
 
diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
index 0cb736c541c9..e645521da8ba 100644
--- a/Documentation/devicetree/bindings/input/iqs626a.yaml
+++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
@@ -449,6 +449,7 @@ patternProperties:
     patternProperties:
       "^event-(prox|touch|deep)(-alt)?$":
         type: object
+        $ref: input.yaml#
         description:
           Represents a proximity, touch or deep-touch event reported by the
           channel in response to a decrease in counts. Node names suffixed with
@@ -487,9 +488,7 @@ patternProperties:
               Specifies the hysteresis for the event (touch and deep-touch
               events only).
 
-          linux,code:
-            $ref: /schemas/types.yaml#/definitions/uint32
-            description: Numeric key or switch code associated with the event.
+          linux,code: true
 
           linux,input-type:
             $ref: /schemas/types.yaml#/definitions/uint32
diff --git a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
index 77fe3b545b35..e677e31fe8fe 100644
--- a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
+++ b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
@@ -89,15 +89,14 @@ properties:
 patternProperties:
   "^hall-switch-(north|south)$":
     type: object
+    $ref: input.yaml#
     description:
       Represents north/south-field Hall-effect sensor touch or proximity
       events. Note that north/south-field orientation is reversed on the
       IQS620AXzCSR device due to its flip-chip package.
 
     properties:
-      linux,code:
-        $ref: /schemas/types.yaml#/definitions/uint32
-        description: Numeric switch code associated with the event.
+      linux,code: true
 
       azoteq,use-prox:
         $ref: /schemas/types.yaml#/definitions/flag
diff --git a/Documentation/devicetree/bindings/input/max77650-onkey.yaml b/Documentation/devicetree/bindings/input/max77650-onkey.yaml
index 3a2ad6ec64db..48edc0c8c1dd 100644
--- a/Documentation/devicetree/bindings/input/max77650-onkey.yaml
+++ b/Documentation/devicetree/bindings/input/max77650-onkey.yaml
@@ -16,15 +16,15 @@ description: |
   The onkey controller is represented as a sub-node of the PMIC node on
   the device tree.
 
+allOf:
+  - $ref: input.yaml#
+
 properties:
   compatible:
     const: maxim,max77650-onkey
 
   linux,code:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description:
-      The key-code to be reported when the key is pressed. Defaults
-      to KEY_POWER.
+    default: 116  # KEY_POWER
 
   maxim,onkey-slide:
     $ref: /schemas/types.yaml#/definitions/flag
-- 
2.34.1


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

* [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition
  2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
  2022-06-08 21:12 ` [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff Rob Herring
  2022-06-08 21:12 ` [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition Rob Herring
@ 2022-06-08 21:12 ` Rob Herring
  2022-06-09  1:34   ` Jeff LaBundy
  2022-06-08 21:12 ` [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition Rob Herring
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2022-06-08 21:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

The common input schema, input.yaml, already defines 'linux,keycodes'
property. Update the users to use it.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/input/iqs626a.yaml     | 2 +-
 Documentation/devicetree/bindings/input/iqs62x-keys.yaml | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
index e645521da8ba..008959f2d425 100644
--- a/Documentation/devicetree/bindings/input/iqs626a.yaml
+++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
@@ -510,6 +510,7 @@ patternProperties:
 
   "^trackpad-3x[2-3]$":
     type: object
+    $ref: input.yaml#
     description:
       Represents all channels associated with the trackpad. The channels are
       collectively active if the trackpad is defined and inactive otherwise.
@@ -678,7 +679,6 @@ patternProperties:
           Specifies the raw count filter strength during low-power mode.
 
       linux,keycodes:
-        $ref: /schemas/types.yaml#/definitions/uint32-array
         minItems: 1
         maxItems: 6
         description: |
diff --git a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
index e677e31fe8fe..0aa951f0ab92 100644
--- a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
+++ b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
@@ -9,6 +9,9 @@ title: Azoteq IQS620A/621/622/624/625 Keys and Switches
 maintainers:
   - Jeff LaBundy <jeff@labundy.com>
 
+allOf:
+  - $ref: input.yaml#
+
 description: |
   The Azoteq IQS620A, IQS621, IQS622, IQS624 and IQS625 multi-function sensors
   feature a variety of self-capacitive, mutual-inductive and Hall-effect sens-
@@ -30,7 +33,6 @@ properties:
       - azoteq,iqs625-keys
 
   linux,keycodes:
-    $ref: /schemas/types.yaml#/definitions/uint32-array
     minItems: 1
     maxItems: 16
     description: |
-- 
2.34.1


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

* [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition
  2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
                   ` (2 preceding siblings ...)
  2022-06-08 21:12 ` [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition Rob Herring
@ 2022-06-08 21:12 ` Rob Herring
  2022-06-09  1:38   ` Jeff LaBundy
  2022-06-08 21:12 ` [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema Rob Herring
  2022-06-28 17:51 ` [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
  5 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2022-06-08 21:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

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>
---
 .../devicetree/bindings/input/azoteq,iqs7222.yaml  |  1 -
 .../devicetree/bindings/input/gpio-keys.yaml       |  7 +------
 Documentation/devicetree/bindings/input/input.yaml | 14 ++++++++++++++
 .../devicetree/bindings/input/iqs626a.yaml         |  4 ----
 4 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
index 5ea10fe7ffe9..a13bd3e41dd3 100644
--- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
+++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
@@ -471,7 +471,6 @@ patternProperties:
           linux,code: true
 
           linux,input-type:
-            $ref: /schemas/types.yaml#/definitions/uint32
             enum: [1, 5]
             default: 1
             description:
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
index cd07107fd5ed..6b49b1afdd95 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
@@ -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: |
diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
index e3701a0bc500..17512f4347fd 100644
--- a/Documentation/devicetree/bindings/input/input.yaml
+++ b/Documentation/devicetree/bindings/input/input.yaml
@@ -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
diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
index 008959f2d425..4df27646c980 100644
--- a/Documentation/devicetree/bindings/input/iqs626a.yaml
+++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
@@ -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:
-- 
2.34.1


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

* [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema
  2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
                   ` (3 preceding siblings ...)
  2022-06-08 21:12 ` [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition Rob Herring
@ 2022-06-08 21:12 ` Rob Herring
  2022-06-09  5:49   ` Heinrich Schuchardt
  2022-06-28 17:51 ` [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
  5 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2022-06-08 21:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

Convert the adc-keys binding to DT schema format.

The old binding has 'label' as required, but it should never be
required given it's just a human readable description.

Signed-off-by: Rob Herring <robh@kernel.org>
---
v2:
 - Drop Heinrich as a maintainer
 - Use common linux,code definition
 - Drop label as required
---
 .../devicetree/bindings/input/adc-keys.txt    |  67 ------------
 .../devicetree/bindings/input/adc-keys.yaml   | 103 ++++++++++++++++++
 2 files changed, 103 insertions(+), 67 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/adc-keys.txt
 create mode 100644 Documentation/devicetree/bindings/input/adc-keys.yaml

diff --git a/Documentation/devicetree/bindings/input/adc-keys.txt b/Documentation/devicetree/bindings/input/adc-keys.txt
deleted file mode 100644
index 6c8be6a9ace2..000000000000
--- a/Documentation/devicetree/bindings/input/adc-keys.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-ADC attached resistor ladder buttons
-------------------------------------
-
-Required properties:
- - compatible: "adc-keys"
- - io-channels: Phandle to an ADC channel
- - io-channel-names = "buttons";
- - keyup-threshold-microvolt: Voltage above or equal to which all the keys are
-			      considered up.
-
-Optional properties:
-	- poll-interval: Poll interval time in milliseconds
-	- autorepeat: Boolean, Enable auto repeat feature of Linux input
-	  subsystem.
-
-Each button (key) is represented as a sub-node of "adc-keys":
-
-Required subnode-properties:
-	- label: Descriptive name of the key.
-	- linux,code: Keycode to emit.
-	- press-threshold-microvolt: voltage above or equal to which this key is
-				     considered pressed.
-
-No two values of press-threshold-microvolt may be the same.
-All values of press-threshold-microvolt must be less than
-keyup-threshold-microvolt.
-
-Example:
-
-#include <dt-bindings/input/input.h>
-
-	adc-keys {
-		compatible = "adc-keys";
-		io-channels = <&lradc 0>;
-		io-channel-names = "buttons";
-		keyup-threshold-microvolt = <2000000>;
-
-		button-up {
-			label = "Volume Up";
-			linux,code = <KEY_VOLUMEUP>;
-			press-threshold-microvolt = <1500000>;
-		};
-
-		button-down {
-			label = "Volume Down";
-			linux,code = <KEY_VOLUMEDOWN>;
-			press-threshold-microvolt = <1000000>;
-		};
-
-		button-enter {
-			label = "Enter";
-			linux,code = <KEY_ENTER>;
-			press-threshold-microvolt = <500000>;
-		};
-	};
-
-+--------------------------------+------------------------+
-| 2.000.000 <= value             | no key pressed         |
-+--------------------------------+------------------------+
-| 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed   |
-+--------------------------------+------------------------+
-| 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |
-+--------------------------------+------------------------+
-|   500.000 <= value < 1.000.000 | KEY_ENTER pressed      |
-+--------------------------------+------------------------+
-|              value <   500.000 | no key pressed         |
-+--------------------------------+------------------------+
diff --git a/Documentation/devicetree/bindings/input/adc-keys.yaml b/Documentation/devicetree/bindings/input/adc-keys.yaml
new file mode 100644
index 000000000000..7aa078dead37
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/adc-keys.yaml
@@ -0,0 +1,103 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/adc-keys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADC attached resistor ladder buttons
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+allOf:
+  - $ref: input.yaml#
+
+properties:
+  compatible:
+    const: adc-keys
+
+  io-channels:
+    maxItems: 1
+
+  io-channel-names:
+    const: buttons
+
+  keyup-threshold-microvolt:
+    description:
+      Voltage above or equal to which all the keys are considered up.
+
+  poll-interval: true
+  autorepeat: true
+
+patternProperties:
+  '^button-':
+    type: object
+    $ref: input.yaml#
+    additionalProperties: false
+    description:
+      Each button (key) is represented as a sub-node.
+
+    properties:
+      label: true
+
+      linux,code: true
+
+      press-threshold-microvolt:
+        description:
+          Voltage above or equal to which this key is considered pressed. No
+          two values of press-threshold-microvolt may be the same. All values
+          of press-threshold-microvolt must be less than
+          keyup-threshold-microvolt.
+
+    required:
+      - linux,code
+      - press-threshold-microvolt
+
+required:
+  - compatible
+  - io-channels
+  - io-channel-names
+  - keyup-threshold-microvolt
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/input/input.h>
+    // +--------------------------------+------------------------+
+    // | 2.000.000 <= value             | no key pressed         |
+    // +--------------------------------+------------------------+
+    // | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed   |
+    // +--------------------------------+------------------------+
+    // | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |
+    // +--------------------------------+------------------------+
+    // |   500.000 <= value < 1.000.000 | KEY_ENTER pressed      |
+    // +--------------------------------+------------------------+
+    // |              value <   500.000 | no key pressed         |
+    // +--------------------------------+------------------------+
+
+    adc-keys {
+        compatible = "adc-keys";
+        io-channels = <&lradc 0>;
+        io-channel-names = "buttons";
+        keyup-threshold-microvolt = <2000000>;
+
+        button-up {
+            label = "Volume Up";
+            linux,code = <KEY_VOLUMEUP>;
+            press-threshold-microvolt = <1500000>;
+        };
+
+        button-down {
+            label = "Volume Down";
+            linux,code = <KEY_VOLUMEDOWN>;
+            press-threshold-microvolt = <1000000>;
+        };
+
+        button-enter {
+            label = "Enter";
+            linux,code = <KEY_ENTER>;
+            press-threshold-microvolt = <500000>;
+        };
+    };
+...
-- 
2.34.1


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

* Re: [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
  2022-06-08 21:12 ` [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff Rob Herring
@ 2022-06-09  1:29   ` Jeff LaBundy
  2022-06-09  5:46   ` Heinrich Schuchardt
  1 sibling, 0 replies; 17+ messages in thread
From: Jeff LaBundy @ 2022-06-09  1:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni,
	Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	linux-input, devicetree, linux-kernel

Hi Rob,

On Wed, Jun 08, 2022 at 03:12:03PM -0600, Rob Herring wrote:
> The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
> users and examples with values greater than 0xff, but the schema is not
> yet applied in those cases.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

As the creator of a few said examples:

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  Documentation/devicetree/bindings/input/input.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> index d41d8743aad4..43d2f299c332 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -21,7 +21,7 @@ properties:
>      $ref: /schemas/types.yaml#/definitions/uint32-array
>      items:
>        minimum: 0
> -      maximum: 0xff
> +      maximum: 0x2ff
>  
>    poll-interval:
>      description: Poll interval time in milliseconds.
> -- 
> 2.34.1
> 

Thank you for driving this series.

Kind regards,
Jeff LaBundy

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

* Re: [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
  2022-06-08 21:12 ` [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition Rob Herring
@ 2022-06-09  1:32   ` Jeff LaBundy
  2022-06-12 16:17   ` Artur Rojek
  2022-07-03  5:29   ` Samuel Holland
  2 siblings, 0 replies; 17+ messages in thread
From: Jeff LaBundy @ 2022-06-09  1:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni,
	Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	linux-input, devicetree, linux-kernel

Hi Rob,

On Wed, Jun 08, 2022 at 03:12:04PM -0600, Rob Herring wrote:
> Multiple bindings use 'linux,code', but there is not a central
> definition and type. Add 'linux,code' to input.yaml and update all the
> users to use it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

For *iqs*.yaml:

Acked-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  .../devicetree/bindings/input/adc-joystick.yaml   |  2 +-
>  .../input/allwinner,sun4i-a10-lradc-keys.yaml     |  5 ++---
>  .../devicetree/bindings/input/azoteq,iqs7222.yaml |  7 ++-----
>  .../devicetree/bindings/input/gpio-keys.yaml      |  1 -
>  .../devicetree/bindings/input/input.yaml          |  8 ++++++++
>  .../devicetree/bindings/input/iqs269a.yaml        | 15 ++++++---------
>  .../devicetree/bindings/input/iqs626a.yaml        |  5 ++---
>  .../devicetree/bindings/input/iqs62x-keys.yaml    |  5 ++---
>  .../devicetree/bindings/input/max77650-onkey.yaml |  8 ++++----
>  9 files changed, 27 insertions(+), 29 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/adc-joystick.yaml b/Documentation/devicetree/bindings/input/adc-joystick.yaml
> index 2ee04e03bc22..64d961458ac7 100644
> --- a/Documentation/devicetree/bindings/input/adc-joystick.yaml
> +++ b/Documentation/devicetree/bindings/input/adc-joystick.yaml
> @@ -45,6 +45,7 @@ additionalProperties: false
>  patternProperties:
>    "^axis@[0-9a-f]+$":
>      type: object
> +    $ref: input.yaml#
>      description: >
>        Represents a joystick axis bound to the given ADC channel.
>        For each entry in the io-channels list, one axis subnode with a matching
> @@ -57,7 +58,6 @@ patternProperties:
>          description: Index of an io-channels list entry bound to this axis.
>  
>        linux,code:
> -        $ref: /schemas/types.yaml#/definitions/uint32
>          description: EV_ABS specific event code generated by the axis.
>  
>        abs-range:
> diff --git a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> index 3399fc288afb..9700dc468b25 100644
> --- a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> @@ -44,14 +44,13 @@ properties:
>  patternProperties:
>    "^button-[0-9]+$":
>      type: object
> +    $ref: input.yaml#
>      properties:
>        label:
>          $ref: /schemas/types.yaml#/definitions/string
>          description: Descriptive name of the key
>  
> -      linux,code:
> -        $ref: /schemas/types.yaml#/definitions/uint32
> -        description: Keycode to emit
> +      linux,code: true
>  
>        channel:
>          $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> index a3a1e5a65306..5ea10fe7ffe9 100644
> --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> @@ -421,6 +421,7 @@ patternProperties:
>      patternProperties:
>        "^event-(prox|touch)$":
>          type: object
> +        $ref: input.yaml#
>          description:
>            Represents a proximity or touch event reported by the channel.
>  
> @@ -467,11 +468,7 @@ patternProperties:
>                The IQS7222B does not feature channel-specific timeouts; the time-
>                out specified for any one channel applies to all channels.
>  
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description:
> -              Numeric key or switch code associated with the event. Specify
> -              KEY_RESERVED (0) to opt out of event reporting.
> +          linux,code: true
>  
>            linux,input-type:
>              $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> index 7fe1966ea28a..cd07107fd5ed 100644
> --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> @@ -34,7 +34,6 @@ patternProperties:
>  
>          linux,code:
>            description: Key / Axis code to emit.
> -          $ref: /schemas/types.yaml#/definitions/uint32
>  
>          linux,input-type:
>            description:
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> index 43d2f299c332..e3701a0bc500 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -23,6 +23,14 @@ properties:
>        minimum: 0
>        maximum: 0x2ff
>  
> +  linux,code:
> +    description:
> +      Specifies a single numeric keycode value to be used for reporting
> +      button/switch events. Specify KEY_RESERVED (0) to opt out of event
> +      reporting.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    maximum: 0x2ff
> +
>    poll-interval:
>      description: Poll interval time in milliseconds.
>      $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml b/Documentation/devicetree/bindings/input/iqs269a.yaml
> index 9c154e5e1a91..c22f8f27913a 100644
> --- a/Documentation/devicetree/bindings/input/iqs269a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs269a.yaml
> @@ -370,6 +370,7 @@ patternProperties:
>      patternProperties:
>        "^event-prox(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description:
>            Represents a proximity event reported by the channel in response to
>            a decrease in counts. Node names suffixed with '-alt' instead corre-
> @@ -396,14 +397,13 @@ patternProperties:
>              default: 10
>              description: Specifies the threshold for the event.
>  
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with the event.
> +          linux,code: true
>  
>          additionalProperties: false
>  
>        "^event-touch(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description: Represents a touch event reported by the channel.
>  
>          properties:
> @@ -421,14 +421,13 @@ patternProperties:
>              default: 4
>              description: Specifies the hysteresis for the event.
>  
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with the event.
> +          linux,code: true
>  
>          additionalProperties: false
>  
>        "^event-deep(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description: Represents a deep-touch event reported by the channel.
>  
>          properties:
> @@ -446,9 +445,7 @@ patternProperties:
>              default: 0
>              description: Specifies the hysteresis for the event.
>  
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with the event.
> +          linux,code: true
>  
>          additionalProperties: false
>  
> diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
> index 0cb736c541c9..e645521da8ba 100644
> --- a/Documentation/devicetree/bindings/input/iqs626a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
> @@ -449,6 +449,7 @@ patternProperties:
>      patternProperties:
>        "^event-(prox|touch|deep)(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description:
>            Represents a proximity, touch or deep-touch event reported by the
>            channel in response to a decrease in counts. Node names suffixed with
> @@ -487,9 +488,7 @@ patternProperties:
>                Specifies the hysteresis for the event (touch and deep-touch
>                events only).
>  
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with the event.
> +          linux,code: true
>  
>            linux,input-type:
>              $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> index 77fe3b545b35..e677e31fe8fe 100644
> --- a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> @@ -89,15 +89,14 @@ properties:
>  patternProperties:
>    "^hall-switch-(north|south)$":
>      type: object
> +    $ref: input.yaml#
>      description:
>        Represents north/south-field Hall-effect sensor touch or proximity
>        events. Note that north/south-field orientation is reversed on the
>        IQS620AXzCSR device due to its flip-chip package.
>  
>      properties:
> -      linux,code:
> -        $ref: /schemas/types.yaml#/definitions/uint32
> -        description: Numeric switch code associated with the event.
> +      linux,code: true
>  
>        azoteq,use-prox:
>          $ref: /schemas/types.yaml#/definitions/flag
> diff --git a/Documentation/devicetree/bindings/input/max77650-onkey.yaml b/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> index 3a2ad6ec64db..48edc0c8c1dd 100644
> --- a/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> +++ b/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> @@ -16,15 +16,15 @@ description: |
>    The onkey controller is represented as a sub-node of the PMIC node on
>    the device tree.
>  
> +allOf:
> +  - $ref: input.yaml#
> +
>  properties:
>    compatible:
>      const: maxim,max77650-onkey
>  
>    linux,code:
> -    $ref: /schemas/types.yaml#/definitions/uint32
> -    description:
> -      The key-code to be reported when the key is pressed. Defaults
> -      to KEY_POWER.
> +    default: 116  # KEY_POWER
>  
>    maxim,onkey-slide:
>      $ref: /schemas/types.yaml#/definitions/flag
> -- 
> 2.34.1
> 

Kind regards,
Jeff LaBundy

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

* Re: [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition
  2022-06-08 21:12 ` [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition Rob Herring
@ 2022-06-09  1:34   ` Jeff LaBundy
  0 siblings, 0 replies; 17+ messages in thread
From: Jeff LaBundy @ 2022-06-09  1:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni,
	Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	linux-input, devicetree, linux-kernel

Hi Rob,

On Wed, Jun 08, 2022 at 03:12:05PM -0600, Rob Herring wrote:
> The common input schema, input.yaml, already defines 'linux,keycodes'
> property. Update the users to use it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  Documentation/devicetree/bindings/input/iqs626a.yaml     | 2 +-
>  Documentation/devicetree/bindings/input/iqs62x-keys.yaml | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
> index e645521da8ba..008959f2d425 100644
> --- a/Documentation/devicetree/bindings/input/iqs626a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
> @@ -510,6 +510,7 @@ patternProperties:
>  
>    "^trackpad-3x[2-3]$":
>      type: object
> +    $ref: input.yaml#
>      description:
>        Represents all channels associated with the trackpad. The channels are
>        collectively active if the trackpad is defined and inactive otherwise.
> @@ -678,7 +679,6 @@ patternProperties:
>            Specifies the raw count filter strength during low-power mode.
>  
>        linux,keycodes:
> -        $ref: /schemas/types.yaml#/definitions/uint32-array
>          minItems: 1
>          maxItems: 6
>          description: |
> diff --git a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> index e677e31fe8fe..0aa951f0ab92 100644
> --- a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> @@ -9,6 +9,9 @@ title: Azoteq IQS620A/621/622/624/625 Keys and Switches
>  maintainers:
>    - Jeff LaBundy <jeff@labundy.com>
>  
> +allOf:
> +  - $ref: input.yaml#
> +
>  description: |
>    The Azoteq IQS620A, IQS621, IQS622, IQS624 and IQS625 multi-function sensors
>    feature a variety of self-capacitive, mutual-inductive and Hall-effect sens-
> @@ -30,7 +33,6 @@ properties:
>        - azoteq,iqs625-keys
>  
>    linux,keycodes:
> -    $ref: /schemas/types.yaml#/definitions/uint32-array
>      minItems: 1
>      maxItems: 16
>      description: |
> -- 
> 2.34.1
> 

Kind regards,
Jeff LaBundy

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

* Re: [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition
  2022-06-08 21:12 ` [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition Rob Herring
@ 2022-06-09  1:38   ` Jeff LaBundy
  0 siblings, 0 replies; 17+ messages in thread
From: Jeff LaBundy @ 2022-06-09  1:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni,
	Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	linux-input, devicetree, linux-kernel

Hi Rob,

On Wed, Jun 08, 2022 at 03:12:06PM -0600, Rob Herring wrote:
> 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>

For *iqs*.yaml:

Acked-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  .../devicetree/bindings/input/azoteq,iqs7222.yaml  |  1 -
>  .../devicetree/bindings/input/gpio-keys.yaml       |  7 +------
>  Documentation/devicetree/bindings/input/input.yaml | 14 ++++++++++++++
>  .../devicetree/bindings/input/iqs626a.yaml         |  4 ----
>  4 files changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> index 5ea10fe7ffe9..a13bd3e41dd3 100644
> --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> @@ -471,7 +471,6 @@ patternProperties:
>            linux,code: true
>  
>            linux,input-type:
> -            $ref: /schemas/types.yaml#/definitions/uint32
>              enum: [1, 5]
>              default: 1
>              description:
> diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> index cd07107fd5ed..6b49b1afdd95 100644
> --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> @@ -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: |
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> index e3701a0bc500..17512f4347fd 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -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
> diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml b/Documentation/devicetree/bindings/input/iqs626a.yaml
> index 008959f2d425..4df27646c980 100644
> --- a/Documentation/devicetree/bindings/input/iqs626a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
> @@ -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:
> -- 
> 2.34.1
> 

Kind regards,
Jeff LaBundy

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

* Re: [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
  2022-06-08 21:12 ` [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff Rob Herring
  2022-06-09  1:29   ` Jeff LaBundy
@ 2022-06-09  5:46   ` Heinrich Schuchardt
  2022-06-10 13:23     ` Rob Herring
  1 sibling, 1 reply; 17+ messages in thread
From: Heinrich Schuchardt @ 2022-06-09  5:46 UTC (permalink / raw)
  To: Rob Herring, Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Hans de Goede, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Bartosz Golaszewski, Artur Rojek, Maxime Ripard, Jeff LaBundy,
	linux-input, devicetree, linux-kernel

On 6/8/22 23:12, Rob Herring wrote:
> The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
> users and examples with values greater than 0xff, but the schema is not
> yet applied in those cases.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   Documentation/devicetree/bindings/input/input.yaml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> index d41d8743aad4..43d2f299c332 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -21,7 +21,7 @@ properties:
>       $ref: /schemas/types.yaml#/definitions/uint32-array
>       items:
>         minimum: 0
> -      maximum: 0xff
> +      maximum: 0x2ff

Can this value of 0x2ff be make exportable such that we can use it as a
reference in devicetree/bindings/input/adc-keys.yaml. E.g. define a type
that only take values in the 0-0x2ff range?

Best regards

Heinrich

>
>     poll-interval:
>       description: Poll interval time in milliseconds.


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

* Re: [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema
  2022-06-08 21:12 ` [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema Rob Herring
@ 2022-06-09  5:49   ` Heinrich Schuchardt
  0 siblings, 0 replies; 17+ messages in thread
From: Heinrich Schuchardt @ 2022-06-09  5:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: Hans de Goede, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Bartosz Golaszewski, Artur Rojek, Maxime Ripard, Jeff LaBundy,
	linux-input, devicetree, linux-kernel, Alexandre Belloni,
	Krzysztof Kozlowski, Dmitry Torokhov

On 6/8/22 23:12, Rob Herring wrote:
> Convert the adc-keys binding to DT schema format.
>
> The old binding has 'label' as required, but it should never be
> required given it's just a human readable description.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> v2:
>   - Drop Heinrich as a maintainer
>   - Use common linux,code definition
>   - Drop label as required
> ---
>   .../devicetree/bindings/input/adc-keys.txt    |  67 ------------
>   .../devicetree/bindings/input/adc-keys.yaml   | 103 ++++++++++++++++++
>   2 files changed, 103 insertions(+), 67 deletions(-)
>   delete mode 100644 Documentation/devicetree/bindings/input/adc-keys.txt
>   create mode 100644 Documentation/devicetree/bindings/input/adc-keys.yaml
>
> diff --git a/Documentation/devicetree/bindings/input/adc-keys.txt b/Documentation/devicetree/bindings/input/adc-keys.txt
> deleted file mode 100644
> index 6c8be6a9ace2..000000000000
> --- a/Documentation/devicetree/bindings/input/adc-keys.txt
> +++ /dev/null
> @@ -1,67 +0,0 @@
> -ADC attached resistor ladder buttons
> -------------------------------------
> -
> -Required properties:
> - - compatible: "adc-keys"
> - - io-channels: Phandle to an ADC channel
> - - io-channel-names = "buttons";
> - - keyup-threshold-microvolt: Voltage above or equal to which all the keys are
> -			      considered up.
> -
> -Optional properties:
> -	- poll-interval: Poll interval time in milliseconds
> -	- autorepeat: Boolean, Enable auto repeat feature of Linux input
> -	  subsystem.
> -
> -Each button (key) is represented as a sub-node of "adc-keys":
> -
> -Required subnode-properties:
> -	- label: Descriptive name of the key.
> -	- linux,code: Keycode to emit.
> -	- press-threshold-microvolt: voltage above or equal to which this key is
> -				     considered pressed.
> -
> -No two values of press-threshold-microvolt may be the same.
> -All values of press-threshold-microvolt must be less than
> -keyup-threshold-microvolt.
> -
> -Example:
> -
> -#include <dt-bindings/input/input.h>
> -
> -	adc-keys {
> -		compatible = "adc-keys";
> -		io-channels = <&lradc 0>;
> -		io-channel-names = "buttons";
> -		keyup-threshold-microvolt = <2000000>;
> -
> -		button-up {
> -			label = "Volume Up";
> -			linux,code = <KEY_VOLUMEUP>;
> -			press-threshold-microvolt = <1500000>;
> -		};
> -
> -		button-down {
> -			label = "Volume Down";
> -			linux,code = <KEY_VOLUMEDOWN>;
> -			press-threshold-microvolt = <1000000>;
> -		};
> -
> -		button-enter {
> -			label = "Enter";
> -			linux,code = <KEY_ENTER>;
> -			press-threshold-microvolt = <500000>;
> -		};
> -	};
> -
> -+--------------------------------+------------------------+
> -| 2.000.000 <= value             | no key pressed         |
> -+--------------------------------+------------------------+
> -| 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed   |
> -+--------------------------------+------------------------+
> -| 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |
> -+--------------------------------+------------------------+
> -|   500.000 <= value < 1.000.000 | KEY_ENTER pressed      |
> -+--------------------------------+------------------------+
> -|              value <   500.000 | no key pressed         |
> -+--------------------------------+------------------------+
> diff --git a/Documentation/devicetree/bindings/input/adc-keys.yaml b/Documentation/devicetree/bindings/input/adc-keys.yaml
> new file mode 100644
> index 000000000000..7aa078dead37
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/adc-keys.yaml
> @@ -0,0 +1,103 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/adc-keys.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ADC attached resistor ladder buttons
> +
> +maintainers:
> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
> +
> +allOf:
> +  - $ref: input.yaml#
> +
> +properties:
> +  compatible:
> +    const: adc-keys
> +
> +  io-channels:
> +    maxItems: 1
> +
> +  io-channel-names:
> +    const: buttons
> +
> +  keyup-threshold-microvolt:
> +    description:
> +      Voltage above or equal to which all the keys are considered up.
> +
> +  poll-interval: true
> +  autorepeat: true
> +
> +patternProperties:
> +  '^button-':
> +    type: object
> +    $ref: input.yaml#
> +    additionalProperties: false
> +    description:
> +      Each button (key) is represented as a sub-node.
> +
> +    properties:
> +      label: true
> +
> +      linux,code: true

Can we provide a reference to a new type in
Documentation/devicetree/bindings/input/input.yaml limiting the range to
0 - 0x2ff?

Best regards

Heinrich

> +
> +      press-threshold-microvolt:
> +        description:
> +          Voltage above or equal to which this key is considered pressed. No
> +          two values of press-threshold-microvolt may be the same. All values
> +          of press-threshold-microvolt must be less than
> +          keyup-threshold-microvolt.
> +
> +    required:
> +      - linux,code
> +      - press-threshold-microvolt
> +
> +required:
> +  - compatible
> +  - io-channels
> +  - io-channel-names
> +  - keyup-threshold-microvolt
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/input/input.h>
> +    // +--------------------------------+------------------------+
> +    // | 2.000.000 <= value             | no key pressed         |
> +    // +--------------------------------+------------------------+
> +    // | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed   |
> +    // +--------------------------------+------------------------+
> +    // | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |
> +    // +--------------------------------+------------------------+
> +    // |   500.000 <= value < 1.000.000 | KEY_ENTER pressed      |
> +    // +--------------------------------+------------------------+
> +    // |              value <   500.000 | no key pressed         |
> +    // +--------------------------------+------------------------+
> +
> +    adc-keys {
> +        compatible = "adc-keys";
> +        io-channels = <&lradc 0>;
> +        io-channel-names = "buttons";
> +        keyup-threshold-microvolt = <2000000>;
> +
> +        button-up {
> +            label = "Volume Up";
> +            linux,code = <KEY_VOLUMEUP>;
> +            press-threshold-microvolt = <1500000>;
> +        };
> +
> +        button-down {
> +            label = "Volume Down";
> +            linux,code = <KEY_VOLUMEDOWN>;
> +            press-threshold-microvolt = <1000000>;
> +        };
> +
> +        button-enter {
> +            label = "Enter";
> +            linux,code = <KEY_ENTER>;
> +            press-threshold-microvolt = <500000>;
> +        };
> +    };
> +...


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

* Re: [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff
  2022-06-09  5:46   ` Heinrich Schuchardt
@ 2022-06-10 13:23     ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2022-06-10 13:23 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni,
	Hans de Goede, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Bartosz Golaszewski, Artur Rojek, Maxime Ripard, Jeff LaBundy,
	linux-input, devicetree, linux-kernel

On Thu, Jun 09, 2022 at 07:46:51AM +0200, Heinrich Schuchardt wrote:
> On 6/8/22 23:12, Rob Herring wrote:
> > The maximum keycode value for Linux is 0x2ff, not 0xff. There's already
> > users and examples with values greater than 0xff, but the schema is not
> > yet applied in those cases.
> > 
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >   Documentation/devicetree/bindings/input/input.yaml | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> > index d41d8743aad4..43d2f299c332 100644
> > --- a/Documentation/devicetree/bindings/input/input.yaml
> > +++ b/Documentation/devicetree/bindings/input/input.yaml
> > @@ -21,7 +21,7 @@ properties:
> >       $ref: /schemas/types.yaml#/definitions/uint32-array
> >       items:
> >         minimum: 0
> > -      maximum: 0xff
> > +      maximum: 0x2ff
> 
> Can this value of 0x2ff be make exportable such that we can use it as a
> reference in devicetree/bindings/input/adc-keys.yaml. E.g. define a type
> that only take values in the 0-0x2ff range?

There's no need. The $ref to input.yaml in does that effectively 
already. That's why 'linux,code' doesn't need any schema constraints 
unless it has additional constraints. max77650-onkey.yaml in patch 2 has 
an example of that. If you wanted to add a new, custom property with 
those constraints, then we could do something like this:

$defs:
  input-codes:
    minimum: 0
    maximum: 0x2ff
    ...

And then have: $ref: input.yaml#/$defs/input-codes

Rob

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

* Re: [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
  2022-06-08 21:12 ` [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition Rob Herring
  2022-06-09  1:32   ` Jeff LaBundy
@ 2022-06-12 16:17   ` Artur Rojek
  2022-07-03  5:29   ` Samuel Holland
  2 siblings, 0 replies; 17+ messages in thread
From: Artur Rojek @ 2022-06-12 16:17 UTC (permalink / raw)
  To: Rob Herring
  Cc: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni,
	Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Maxime Ripard, Jeff LaBundy,
	linux-input, devicetree, linux-kernel

On 2022-06-08 23:12, Rob Herring wrote:
> Multiple bindings use 'linux,code', but there is not a central
> definition and type. Add 'linux,code' to input.yaml and update all the
> users to use it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
For adc-joystick.yaml:

Acked-by: Artur Rojek <contact@artur-rojek.eu>

> ---
>  .../devicetree/bindings/input/adc-joystick.yaml   |  2 +-
>  .../input/allwinner,sun4i-a10-lradc-keys.yaml     |  5 ++---
>  .../devicetree/bindings/input/azoteq,iqs7222.yaml |  7 ++-----
>  .../devicetree/bindings/input/gpio-keys.yaml      |  1 -
>  .../devicetree/bindings/input/input.yaml          |  8 ++++++++
>  .../devicetree/bindings/input/iqs269a.yaml        | 15 ++++++---------
>  .../devicetree/bindings/input/iqs626a.yaml        |  5 ++---
>  .../devicetree/bindings/input/iqs62x-keys.yaml    |  5 ++---
>  .../devicetree/bindings/input/max77650-onkey.yaml |  8 ++++----
>  9 files changed, 27 insertions(+), 29 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/adc-joystick.yaml
> b/Documentation/devicetree/bindings/input/adc-joystick.yaml
> index 2ee04e03bc22..64d961458ac7 100644
> --- a/Documentation/devicetree/bindings/input/adc-joystick.yaml
> +++ b/Documentation/devicetree/bindings/input/adc-joystick.yaml
> @@ -45,6 +45,7 @@ additionalProperties: false
>  patternProperties:
>    "^axis@[0-9a-f]+$":
>      type: object
> +    $ref: input.yaml#
>      description: >
>        Represents a joystick axis bound to the given ADC channel.
>        For each entry in the io-channels list, one axis subnode with a 
> matching
> @@ -57,7 +58,6 @@ patternProperties:
>          description: Index of an io-channels list entry bound to this 
> axis.
> 
>        linux,code:
> -        $ref: /schemas/types.yaml#/definitions/uint32
>          description: EV_ABS specific event code generated by the axis.
> 
>        abs-range:
> diff --git
> a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> index 3399fc288afb..9700dc468b25 100644
> ---
> a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> +++
> b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
> @@ -44,14 +44,13 @@ properties:
>  patternProperties:
>    "^button-[0-9]+$":
>      type: object
> +    $ref: input.yaml#
>      properties:
>        label:
>          $ref: /schemas/types.yaml#/definitions/string
>          description: Descriptive name of the key
> 
> -      linux,code:
> -        $ref: /schemas/types.yaml#/definitions/uint32
> -        description: Keycode to emit
> +      linux,code: true
> 
>        channel:
>          $ref: /schemas/types.yaml#/definitions/uint32
> diff --git
> a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> index a3a1e5a65306..5ea10fe7ffe9 100644
> --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
> @@ -421,6 +421,7 @@ patternProperties:
>      patternProperties:
>        "^event-(prox|touch)$":
>          type: object
> +        $ref: input.yaml#
>          description:
>            Represents a proximity or touch event reported by the 
> channel.
> 
> @@ -467,11 +468,7 @@ patternProperties:
>                The IQS7222B does not feature channel-specific
> timeouts; the time-
>                out specified for any one channel applies to all 
> channels.
> 
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description:
> -              Numeric key or switch code associated with the event. 
> Specify
> -              KEY_RESERVED (0) to opt out of event reporting.
> +          linux,code: true
> 
>            linux,input-type:
>              $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml
> b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> index 7fe1966ea28a..cd07107fd5ed 100644
> --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> @@ -34,7 +34,6 @@ patternProperties:
> 
>          linux,code:
>            description: Key / Axis code to emit.
> -          $ref: /schemas/types.yaml#/definitions/uint32
> 
>          linux,input-type:
>            description:
> diff --git a/Documentation/devicetree/bindings/input/input.yaml
> b/Documentation/devicetree/bindings/input/input.yaml
> index 43d2f299c332..e3701a0bc500 100644
> --- a/Documentation/devicetree/bindings/input/input.yaml
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -23,6 +23,14 @@ properties:
>        minimum: 0
>        maximum: 0x2ff
> 
> +  linux,code:
> +    description:
> +      Specifies a single numeric keycode value to be used for 
> reporting
> +      button/switch events. Specify KEY_RESERVED (0) to opt out of 
> event
> +      reporting.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    maximum: 0x2ff
> +
>    poll-interval:
>      description: Poll interval time in milliseconds.
>      $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml
> b/Documentation/devicetree/bindings/input/iqs269a.yaml
> index 9c154e5e1a91..c22f8f27913a 100644
> --- a/Documentation/devicetree/bindings/input/iqs269a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs269a.yaml
> @@ -370,6 +370,7 @@ patternProperties:
>      patternProperties:
>        "^event-prox(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description:
>            Represents a proximity event reported by the channel in 
> response to
>            a decrease in counts. Node names suffixed with '-alt' 
> instead corre-
> @@ -396,14 +397,13 @@ patternProperties:
>              default: 10
>              description: Specifies the threshold for the event.
> 
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with 
> the event.
> +          linux,code: true
> 
>          additionalProperties: false
> 
>        "^event-touch(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description: Represents a touch event reported by the channel.
> 
>          properties:
> @@ -421,14 +421,13 @@ patternProperties:
>              default: 4
>              description: Specifies the hysteresis for the event.
> 
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with 
> the event.
> +          linux,code: true
> 
>          additionalProperties: false
> 
>        "^event-deep(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description: Represents a deep-touch event reported by the 
> channel.
> 
>          properties:
> @@ -446,9 +445,7 @@ patternProperties:
>              default: 0
>              description: Specifies the hysteresis for the event.
> 
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with 
> the event.
> +          linux,code: true
> 
>          additionalProperties: false
> 
> diff --git a/Documentation/devicetree/bindings/input/iqs626a.yaml
> b/Documentation/devicetree/bindings/input/iqs626a.yaml
> index 0cb736c541c9..e645521da8ba 100644
> --- a/Documentation/devicetree/bindings/input/iqs626a.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs626a.yaml
> @@ -449,6 +449,7 @@ patternProperties:
>      patternProperties:
>        "^event-(prox|touch|deep)(-alt)?$":
>          type: object
> +        $ref: input.yaml#
>          description:
>            Represents a proximity, touch or deep-touch event reported 
> by the
>            channel in response to a decrease in counts. Node names 
> suffixed with
> @@ -487,9 +488,7 @@ patternProperties:
>                Specifies the hysteresis for the event (touch and 
> deep-touch
>                events only).
> 
> -          linux,code:
> -            $ref: /schemas/types.yaml#/definitions/uint32
> -            description: Numeric key or switch code associated with 
> the event.
> +          linux,code: true
> 
>            linux,input-type:
>              $ref: /schemas/types.yaml#/definitions/uint32
> diff --git a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> index 77fe3b545b35..e677e31fe8fe 100644
> --- a/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> +++ b/Documentation/devicetree/bindings/input/iqs62x-keys.yaml
> @@ -89,15 +89,14 @@ properties:
>  patternProperties:
>    "^hall-switch-(north|south)$":
>      type: object
> +    $ref: input.yaml#
>      description:
>        Represents north/south-field Hall-effect sensor touch or 
> proximity
>        events. Note that north/south-field orientation is reversed on 
> the
>        IQS620AXzCSR device due to its flip-chip package.
> 
>      properties:
> -      linux,code:
> -        $ref: /schemas/types.yaml#/definitions/uint32
> -        description: Numeric switch code associated with the event.
> +      linux,code: true
> 
>        azoteq,use-prox:
>          $ref: /schemas/types.yaml#/definitions/flag
> diff --git
> a/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> b/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> index 3a2ad6ec64db..48edc0c8c1dd 100644
> --- a/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> +++ b/Documentation/devicetree/bindings/input/max77650-onkey.yaml
> @@ -16,15 +16,15 @@ description: |
>    The onkey controller is represented as a sub-node of the PMIC node 
> on
>    the device tree.
> 
> +allOf:
> +  - $ref: input.yaml#
> +
>  properties:
>    compatible:
>      const: maxim,max77650-onkey
> 
>    linux,code:
> -    $ref: /schemas/types.yaml#/definitions/uint32
> -    description:
> -      The key-code to be reported when the key is pressed. Defaults
> -      to KEY_POWER.
> +    default: 116  # KEY_POWER
> 
>    maxim,onkey-slide:
>      $ref: /schemas/types.yaml#/definitions/flag

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

* Re: [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion
  2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
                   ` (4 preceding siblings ...)
  2022-06-08 21:12 ` [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema Rob Herring
@ 2022-06-28 17:51 ` Rob Herring
  2022-07-08 22:20   ` Dmitry Torokhov
  5 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2022-06-28 17:51 UTC (permalink / raw)
  To: Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Bartosz Golaszewski, Artur Rojek, Maxime Ripard,
	Jeff LaBundy, linux-input, devicetree, linux-kernel

On Wed, Jun 08, 2022 at 03:12:02PM -0600, Rob Herring wrote:
> This series refactors the common 'linux,code', 'linux,keycodes', and
> 'linux,input-type' properties defined in various binding schemas. As the
> properties are common, they should only have a single common schema type
> definition. Note that 'linux,input-value' was not included here as it is
> only used in 1 binding (gpio-keys).
> 
> The clean-ups are are result of the discussion on v1 of the adc-keys
> binding conversion[1].
> 
> Rob
> 
> [1] https://lore.kernel.org/all/20220606184243.1057145-1-robh@kernel.org/
> 
> 
> Rob Herring (5):
>   dt-bindings: input: Increase maximum keycode value to 0x2ff
>   dt-bindings: input: Centralize 'linux,code' definition
>   dt-bindings: input: Use common 'linux,keycodes' definition
>   dt-bindings: input: Centralize 'linux,input-type' definition
>   dt-bindings: input: Convert adc-keys to DT schema

Dmitry, Any comments on this?

Rob

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

* Re: [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition
  2022-06-08 21:12 ` [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition Rob Herring
  2022-06-09  1:32   ` Jeff LaBundy
  2022-06-12 16:17   ` Artur Rojek
@ 2022-07-03  5:29   ` Samuel Holland
  2 siblings, 0 replies; 17+ messages in thread
From: Samuel Holland @ 2022-07-03  5:29 UTC (permalink / raw)
  To: Rob Herring, Dmitry Torokhov, Krzysztof Kozlowski, Alexandre Belloni
  Cc: Heinrich Schuchardt, Hans de Goede, Chen-Yu Tsai, Jernej Skrabec,
	Bartosz Golaszewski, Artur Rojek, Maxime Ripard, Jeff LaBundy,
	linux-input, devicetree, linux-kernel

On 6/8/22 4:12 PM, Rob Herring wrote:
> Multiple bindings use 'linux,code', but there is not a central
> definition and type. Add 'linux,code' to input.yaml and update all the
> users to use it.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../devicetree/bindings/input/adc-joystick.yaml   |  2 +-
>  .../input/allwinner,sun4i-a10-lradc-keys.yaml     |  5 ++---

For allwinner,sun4i-a10-lradc-keys.yaml:

Acked-by: Samuel Holland <samuel@sholland.org>

>  .../devicetree/bindings/input/azoteq,iqs7222.yaml |  7 ++-----
>  .../devicetree/bindings/input/gpio-keys.yaml      |  1 -
>  .../devicetree/bindings/input/input.yaml          |  8 ++++++++
>  .../devicetree/bindings/input/iqs269a.yaml        | 15 ++++++---------
>  .../devicetree/bindings/input/iqs626a.yaml        |  5 ++---
>  .../devicetree/bindings/input/iqs62x-keys.yaml    |  5 ++---
>  .../devicetree/bindings/input/max77650-onkey.yaml |  8 ++++----
>  9 files changed, 27 insertions(+), 29 deletions(-)

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

* Re: [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion
  2022-06-28 17:51 ` [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
@ 2022-07-08 22:20   ` Dmitry Torokhov
  0 siblings, 0 replies; 17+ messages in thread
From: Dmitry Torokhov @ 2022-07-08 22:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Krzysztof Kozlowski, Alexandre Belloni, Heinrich Schuchardt,
	Hans de Goede, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Bartosz Golaszewski, Artur Rojek, Maxime Ripard, Jeff LaBundy,
	linux-input, devicetree, linux-kernel

On Tue, Jun 28, 2022 at 11:51:37AM -0600, Rob Herring wrote:
> On Wed, Jun 08, 2022 at 03:12:02PM -0600, Rob Herring wrote:
> > This series refactors the common 'linux,code', 'linux,keycodes', and
> > 'linux,input-type' properties defined in various binding schemas. As the
> > properties are common, they should only have a single common schema type
> > definition. Note that 'linux,input-value' was not included here as it is
> > only used in 1 binding (gpio-keys).
> > 
> > The clean-ups are are result of the discussion on v1 of the adc-keys
> > binding conversion[1].
> > 
> > Rob
> > 
> > [1] https://lore.kernel.org/all/20220606184243.1057145-1-robh@kernel.org/
> > 
> > 
> > Rob Herring (5):
> >   dt-bindings: input: Increase maximum keycode value to 0x2ff
> >   dt-bindings: input: Centralize 'linux,code' definition
> >   dt-bindings: input: Use common 'linux,keycodes' definition
> >   dt-bindings: input: Centralize 'linux,input-type' definition
> >   dt-bindings: input: Convert adc-keys to DT schema
> 
> Dmitry, Any comments on this?

Sorry, applied the lot, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2022-07-08 22:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 21:12 [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
2022-06-08 21:12 ` [PATCH v2 1/5] dt-bindings: input: Increase maximum keycode value to 0x2ff Rob Herring
2022-06-09  1:29   ` Jeff LaBundy
2022-06-09  5:46   ` Heinrich Schuchardt
2022-06-10 13:23     ` Rob Herring
2022-06-08 21:12 ` [PATCH v2 2/5] dt-bindings: input: Centralize 'linux,code' definition Rob Herring
2022-06-09  1:32   ` Jeff LaBundy
2022-06-12 16:17   ` Artur Rojek
2022-07-03  5:29   ` Samuel Holland
2022-06-08 21:12 ` [PATCH v2 3/5] dt-bindings: input: Use common 'linux,keycodes' definition Rob Herring
2022-06-09  1:34   ` Jeff LaBundy
2022-06-08 21:12 ` [PATCH v2 4/5] dt-bindings: input: Centralize 'linux,input-type' definition Rob Herring
2022-06-09  1:38   ` Jeff LaBundy
2022-06-08 21:12 ` [PATCH v2 5/5] dt-bindings: input: Convert adc-keys to DT schema Rob Herring
2022-06-09  5:49   ` Heinrich Schuchardt
2022-06-28 17:51 ` [PATCH v2 0/5] dt-bindings: input: Common property clean-ups and adc-keys conversion Rob Herring
2022-07-08 22:20   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).