[PATCH v3 1/4] dt-bindings: input: adc-keys: allow all input properties

Nicolas Frattaroli nicolas.frattaroli at collabora.com
Wed Apr 8 10:49:39 PDT 2026


adc-keys, unlike gpio-keys, does not allow linux,input-type as a valid
property. This makes it impossible to model devices that have ADC inputs
that should generate switch events.

Replace "additionalProperties" with "unevaluatedProperties", so that any
of the properties in the referenced input.yaml schema can be used.
Consequently, throw out the explicit mention of "linux,code" and extend
the example to verify.

Suggested-by: Krzysztof Kozlowski <krzk at kernel.org>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
---
 Documentation/devicetree/bindings/input/adc-keys.yaml | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/adc-keys.yaml b/Documentation/devicetree/bindings/input/adc-keys.yaml
index 7aa078dead37..f216bb874f26 100644
--- a/Documentation/devicetree/bindings/input/adc-keys.yaml
+++ b/Documentation/devicetree/bindings/input/adc-keys.yaml
@@ -33,15 +33,13 @@ patternProperties:
   '^button-':
     type: object
     $ref: input.yaml#
-    additionalProperties: false
+    unevaluatedProperties: 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
@@ -65,7 +63,9 @@ examples:
   - |
     #include <dt-bindings/input/input.h>
     // +--------------------------------+------------------------+
-    // | 2.000.000 <= value             | no key pressed         |
+    // | 2.500.000 <= value             | no key pressed         |
+    // +--------------------------------+------------------------+
+    // | 2.000.000 <= value < 2.500.000 | Mic Insert Switch on   |
     // +--------------------------------+------------------------+
     // | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed   |
     // +--------------------------------+------------------------+
@@ -80,7 +80,14 @@ examples:
         compatible = "adc-keys";
         io-channels = <&lradc 0>;
         io-channel-names = "buttons";
-        keyup-threshold-microvolt = <2000000>;
+        keyup-threshold-microvolt = <2500000>;
+
+        button-headset-connected {
+          label = "Headset Microphone Connected";
+          linux,code = <SW_MICROPHONE_INSERT>;
+          linux,input-type = <EV_SW>;
+          press-threshold-microvolt = <2000000>;
+        };
 
         button-up {
             label = "Volume Up";

-- 
2.53.0




More information about the Linux-rockchip mailing list