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

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

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2024-08-19 17:14:29
Also in: linux-devicetree, linux-input, linux-samsung-soc, lkml

On Mon, Aug 19, 2024 at 05:48:06PM +0100, Conor Dooley wrote:
On Mon, Aug 19, 2024 at 08:49:10AM -0700, Dmitry Torokhov wrote:
quoted
On Mon, Aug 19, 2024 at 03:02:07PM +0200, Krzysztof Kozlowski wrote:
quoted
On Sun, Aug 18, 2024 at 09:58:06PM -0700, Dmitry Torokhov wrote:
quoted
quoted
quoted
+      - 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.
Hmm, there is already "allOf" at the beginning of the file, so adding
another one results in complaints about duplicate "allOf". I can move it
all to the top, like this:

allOf:
  - $ref: input.yaml#
  - $ref: matrix-keymap.yaml#
  - if:
      required:
        - linux,keymap
    then:
      properties:
        samsung,keypad-num-columns: false
        samsung,keypad-num-rows: false
      patternProperties:
        '^key-[0-9a-z]+$': false
    else:
      properties:
        keypad,num-columns: false
        keypad,num-rows: false
      required:
        - samsung,keypad-num-columns
        - samsung,keypad-num-rows

Is this OK? I don't quite like that "tweaks" are listed before main
body of properties.
The normal thing to do is to put the allOf at the end, not the start, in
cases like this, for the reason you mention.
I see, thanks. It would be nice if it could combine several "allOf"s
into one internally.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help