Thread (39 messages) 39 messages, 5 authors, 2024-10-04

Re: [PATCH 09/14] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2024-08-19 13:02:12
Also in: linux-arm-kernel, linux-devicetree, linux-samsung-soc, lkml

On Sun, Aug 18, 2024 at 09:58:06PM -0700, Dmitry Torokhov wrote:
quoted hunk ↗ jump to hunk
The binding with a sub-node per each key is very verbose and is hard to
use with static device properties. Allow standard matrix keymap binding
in addition to the verbose one.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 .../input/samsung,s3c6410-keypad.yaml         | 57 ++++++++++++++++++-
 1 file changed, 54 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
index a53569aa0ee7..28a318a0ff7e 100644
--- a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
+++ b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
@@ -16,6 +16,10 @@ description:
 maintainers:
   - Krzysztof Kozlowski <krzk@kernel.org>
 
+allOf:
+  - $ref: input.yaml#
+  - $ref: matrix-keymap.yaml#
+
 properties:
   compatible:
     enum:
@@ -37,6 +41,10 @@ properties:
 
   wakeup-source: true
 
+  keypad,num-columns: true
+  keypad,num-rows: true
+  linux,keymap: true
+
   linux,input-no-autorepeat:
     type: boolean
     description:
@@ -81,12 +89,33 @@ patternProperties:
       - keypad,row
       - linux,code
 
+dependencies:
+  linux,keymap:
+    required:
Why "required" keyword? The dependencies should have just list of
properties. See example-schema.
+      - keypad,num-columns
+      - keypad,num-rows
+
 required:
   - compatible
   - reg
   - interrupts
-  - samsung,keypad-num-columns
-  - samsung,keypad-num-rows
+
+if:
put allOf: here and this within allOf, so you the "if" could grow in the
future.

Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help