[PATCH v9 2/5] dt-bindings: gpu: img,powervr-rogue: Define power domains per variant

Michal Wilczynski posted 5 patches 2 months ago
There is a newer version of this series
[PATCH v9 2/5] dt-bindings: gpu: img,powervr-rogue: Define power domains per variant
Posted by Michal Wilczynski 2 months ago
Rework the PowerVR Rogue GPU binding to use an explicit, per variant
style for defining power domain properties.

The generic `if` block for `img,img-rogue`, is removed. It is replaced
with self-contained `if/then` blocks for each existing GPU variant. Each
block now explicitly defines power domain properties and requirements
for that specific variant, making the rules easier to read and
maintain.

This addresses feedback from the maintainer to explicitly list items
for each variant [1].

Link: https://lore.kernel.org/all/4d79c8dd-c5fb-442c-ac65-37e7176b0cdd@linaro.org/ [1]

Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
 .../devicetree/bindings/gpu/img,powervr-rogue.yaml | 36 ++++++++++------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
index 4450e2e73b3ccf74d29f0e31e2e6687d7cbe5d65..24ce46ba0b7015fca799f045ee2ccdd258088068 100644
--- a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
+++ b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
@@ -57,10 +57,8 @@ properties:
     maxItems: 2
 
   power-domain-names:
-    items:
-      - const: a
-      - const: b
     minItems: 1
+    maxItems: 2
 
   dma-coherent: true
 
@@ -77,18 +75,6 @@ required:
 additionalProperties: false
 
 allOf:
-  # Constraints added alongside the new compatible strings that would otherwise
-  # create an ABI break.
-  - if:
-      properties:
-        compatible:
-          contains:
-            const: img,img-rogue
-    then:
-      required:
-        - power-domains
-        - power-domain-names
-
   - if:
       properties:
         compatible:
@@ -97,9 +83,14 @@ allOf:
     then:
       properties:
         power-domains:
-          maxItems: 1
+          items:
+            - description: Power domain A
         power-domain-names:
-          maxItems: 1
+          items:
+            - const: a
+      required:
+        - power-domains
+        - power-domain-names
 
   - if:
       properties:
@@ -109,9 +100,16 @@ allOf:
     then:
       properties:
         power-domains:
-          minItems: 2
+          items:
+            - description: Power domain A
+            - description: Power domain B
         power-domain-names:
-          minItems: 2
+          items:
+            - const: a
+            - const: b
+      required:
+        - power-domains
+        - power-domain-names
 
   - if:
       properties:

-- 
2.34.1
Re: [PATCH v9 2/5] dt-bindings: gpu: img,powervr-rogue: Define power domains per variant
Posted by Krzysztof Kozlowski 2 months ago
On 31/07/2025 15:50, Michal Wilczynski wrote:
> Rework the PowerVR Rogue GPU binding to use an explicit, per variant
> style for defining power domain properties.
> 
> The generic `if` block for `img,img-rogue`, is removed. It is replaced
> with self-contained `if/then` blocks for each existing GPU variant. Each
> block now explicitly defines power domain properties and requirements
> for that specific variant, making the rules easier to read and
> maintain.
> 
> This addresses feedback from the maintainer to explicitly list items
> for each variant [1].
> 
> Link: https://lore.kernel.org/all/4d79c8dd-c5fb-442c-ac65-37e7176b0cdd@linaro.org/ [1]
> 
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---
>  .../devicetree/bindings/gpu/img,powervr-rogue.yaml | 36 ++++++++++------------
>  1 file changed, 17 insertions(+), 19 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
> index 4450e2e73b3ccf74d29f0e31e2e6687d7cbe5d65..24ce46ba0b7015fca799f045ee2ccdd258088068 100644
> --- a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
> +++ b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
> @@ -57,10 +57,8 @@ properties:
>      maxItems: 2
>  
>    power-domain-names:
> -    items:
> -      - const: a
> -      - const: b

I don't understand why this is being removed. It makes no sense in
context of this patch. Next patch also does not explain that.

This should stay.


>      minItems: 1
> +    maxItems: 2
>  
>    dma-coherent: true
>  
> @@ -77,18 +75,6 @@ required:
>  additionalProperties: false
>  
>  allOf:
> -  # Constraints added alongside the new compatible strings that would otherwise
> -  # create an ABI break.
> -  - if:
> -      properties:
> -        compatible:
> -          contains:
> -            const: img,img-rogue
> -    then:
> -      required:
> -        - power-domains
> -        - power-domain-names
> -
>    - if:
>        properties:
>          compatible:
> @@ -97,9 +83,14 @@ allOf:
>      then:
>        properties:
>          power-domains:
> -          maxItems: 1
> +          items:
> +            - description: Power domain A
>          power-domain-names:
> -          maxItems: 1
> +          items:
> +            - const: a

This was correct before.

> +      required:
> +        - power-domains
> +        - power-domain-names

This is the only part you actually want to do... and it makes no sense
in context of this patch only. IOW, this should be moved to the next patch.


Best regards,
Krzysztof