Thread (25 messages) 25 messages, 4 authors, 2024-01-25

Re: [PATCH 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616

From: Chen-Yu Tsai <wens@kernel.org>
Date: 2024-01-25 14:32:07
Also in: dmaengine, linux-devicetree, linux-sound, linux-sunxi, lkml

On Tue, Jan 23, 2024 at 2:18 AM Conor Dooley [off-list ref] wrote:
On Tue, Jan 23, 2024 at 01:05:15AM +0800, Chen-Yu Tsai wrote:
quoted
From: Chen-Yu Tsai <redacted>

The DMA controllers found on the H616 and H618 are the same as the one
found on the H6. The only difference is the DMA endpoint (DRQ) layout.

Since the number of channels and endpoints are described with additional
generic properties, just add a new H616-specific compatible string and
fallback to the H6 one.

Signed-off-by: Chen-Yu Tsai <redacted>
---
 .../bindings/dma/allwinner,sun50i-a64-dma.yaml    | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
index ec2d7a789ffe..e5693be378bd 100644
--- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
+++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
@@ -28,6 +28,9 @@ properties:
       - items:
           - const: allwinner,sun8i-r40-dma
           - const: allwinner,sun50i-a64-dma
+      - items:
+          - const: allwinner,sun50i-h616-dma
+          - const: allwinner,sun50i-h6-dma

   reg:
     maxItems: 1
@@ -59,10 +62,14 @@ required:
 if:
   properties:
     compatible:
-      enum:
-        - allwinner,sun20i-d1-dma
-        - allwinner,sun50i-a100-dma
-        - allwinner,sun50i-h6-dma
+      oneOf:
+        - enum:
+            - allwinner,sun20i-d1-dma
+            - allwinner,sun50i-a100-dma
+            - allwinner,sun50i-h6-dma
+        - items:
+            - const: allwinner,sun50i-h616-dma
+            - const: allwinner,sun50i-h6-dma
Instead of introducing this complexity, could you instead use "contains"
here? Unless I am missing soemthing, you can achieve the same thing here
with:
|if:
|  properties:
|    compatible:
|      constains:
|        enum:
|          - allwinner,sun20i-d1-dma
|          - allwinner,sun50i-a100-dma
|          - allwinner,sun50i-h6-dma
Thank you for the reminder. I had a vague impression that something
simpler worked, but couldn't remember what exactly.

ChenYu

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help