[v4,03/12] dt-bindings: gpu: mali-bifrost: Fix power-domain-names validation

Message ID 20230228102704.708150-3-angelogioacchino.delregno@collabora.com
State New
Headers
Series [v4,01/12] dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains variation |

Commit Message

AngeloGioacchino Del Regno Feb. 28, 2023, 10:26 a.m. UTC
  Commit ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
incorrectly introduced power domain names for MT8183, causing
validation issues.

Add power-domain-names to the base schema, allowing a maximum of
five elements; since platforms having a single power domain don't
need any actual domain name, disallow that for each sub-schema.

Fixes: a7a596cd3115 ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../devicetree/bindings/gpu/arm,mali-bifrost.yaml          | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Chen-Yu Tsai March 7, 2023, 10:27 a.m. UTC | #1
On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Commit ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> incorrectly introduced power domain names for MT8183, causing
> validation issues.
>
> Add power-domain-names to the base schema, allowing a maximum of
> five elements; since platforms having a single power domain don't
> need any actual domain name, disallow that for each sub-schema.
>
> Fixes: a7a596cd3115 ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Tested-by: Chen-Yu Tsai <wenst@chromium.org>
  with `make dt_binding_check` and `make dtbs_check`
  
Rob Herring March 8, 2023, 7:02 p.m. UTC | #2
On Tue, Feb 28, 2023 at 11:26:55AM +0100, AngeloGioacchino Del Regno wrote:
> Commit ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> incorrectly introduced power domain names for MT8183, causing
> validation issues.
> 
> Add power-domain-names to the base schema, allowing a maximum of
> five elements; since platforms having a single power domain don't
> need any actual domain name, disallow that for each sub-schema.
> 
> Fixes: a7a596cd3115 ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../devicetree/bindings/gpu/arm,mali-bifrost.yaml          | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> index 5b7f1c9d2b30..bf0f7f1f71e0 100644
> --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> @@ -65,6 +65,10 @@ properties:
>      minItems: 1
>      maxItems: 5
>  
> +  power-domain-names:
> +    minItems: 1

If you are disallowing for a single domain, then this could be 2...

Reviewed-by: Rob Herring <robh@kernel.org>

> +    maxItems: 5
> +
>    resets:
>      minItems: 1
>      maxItems: 3
> @@ -112,6 +116,7 @@ allOf:
>        properties:
>          power-domains:
>            maxItems: 1
> +        power-domain-names: false
>        required:
>          - resets
>    - if:
> @@ -136,6 +141,7 @@ allOf:
>              - const: bus_ace
>          power-domains:
>            maxItems: 1
> +        power-domain-names: false
>          resets:
>            minItems: 3
>          reset-names:
> @@ -186,6 +192,7 @@ allOf:
>              - const: bus
>          power-domains:
>            maxItems: 1
> +        power-domain-names: false
>        required:
>          - clock-names
>  
> -- 
> 2.39.2
>
  

Patch

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index 5b7f1c9d2b30..bf0f7f1f71e0 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -65,6 +65,10 @@  properties:
     minItems: 1
     maxItems: 5
 
+  power-domain-names:
+    minItems: 1
+    maxItems: 5
+
   resets:
     minItems: 1
     maxItems: 3
@@ -112,6 +116,7 @@  allOf:
       properties:
         power-domains:
           maxItems: 1
+        power-domain-names: false
       required:
         - resets
   - if:
@@ -136,6 +141,7 @@  allOf:
             - const: bus_ace
         power-domains:
           maxItems: 1
+        power-domain-names: false
         resets:
           minItems: 3
         reset-names:
@@ -186,6 +192,7 @@  allOf:
             - const: bus
         power-domains:
           maxItems: 1
+        power-domain-names: false
       required:
         - clock-names