[v3,02/11] dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains variation

Message ID 20230223133440.80941-3-angelogioacchino.delregno@collabora.com
State New
Headers
Series Panfrost: Improve and add MediaTek SoCs support |

Commit Message

AngeloGioacchino Del Regno Feb. 23, 2023, 1:34 p.m. UTC
  In preparation for adding new bindings for new MediaTek SoCs, split out
the power-domain-names and power-domainsvariation from the `else` in
the current mediatek,mt8183-mali conditional.

The sram-supply part is left in place to be disallowed for anything
that is not compatible with "mediatek,mt8183-mali" as this regulator
is MediaTek-specific and it is, and will ever be, used only for this
specific string due to the addition of the mediatek-regulator-coupler
driver.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../devicetree/bindings/gpu/arm,mali-bifrost.yaml | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
  

Comments

Chen-Yu Tsai Feb. 24, 2023, 10:08 a.m. UTC | #1
On Thu, Feb 23, 2023 at 9:34 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> In preparation for adding new bindings for new MediaTek SoCs, split out
> the power-domain-names and power-domainsvariation from the `else` in
> the current mediatek,mt8183-mali conditional.
>
> The sram-supply part is left in place to be disallowed for anything
> that is not compatible with "mediatek,mt8183-mali" as this regulator
> is MediaTek-specific and it is, and will ever be, used only for this
> specific string due to the addition of the mediatek-regulator-coupler
> driver.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
  
Chen-Yu Tsai Feb. 24, 2023, 10:09 a.m. UTC | #2
On Fri, Feb 24, 2023 at 6:08 PM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> On Thu, Feb 23, 2023 at 9:34 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
> >
> > In preparation for adding new bindings for new MediaTek SoCs, split out
> > the power-domain-names and power-domainsvariation from the `else` in

                                            ^ missing space

Once fixed,

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>

> > the current mediatek,mt8183-mali conditional.
> >
> > The sram-supply part is left in place to be disallowed for anything
> > that is not compatible with "mediatek,mt8183-mali" as this regulator
> > is MediaTek-specific and it is, and will ever be, used only for this
> > specific string due to the addition of the mediatek-regulator-coupler
> > driver.
> >
> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>
> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
  
Krzysztof Kozlowski Feb. 24, 2023, 10:57 a.m. UTC | #3
On 23/02/2023 14:34, AngeloGioacchino Del Regno wrote:
> In preparation for adding new bindings for new MediaTek SoCs, split out
> the power-domain-names and power-domainsvariation from the `else` in
> the current mediatek,mt8183-mali conditional.
> 
> The sram-supply part is left in place to be disallowed for anything
> that is not compatible with "mediatek,mt8183-mali" as this regulator
> is MediaTek-specific and it is, and will ever be, used only for this
> specific string due to the addition of the mediatek-regulator-coupler
> driver.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../devicetree/bindings/gpu/arm,mali-bifrost.yaml | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> index 02699d389be1..ac174c17e25f 100644
> --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> @@ -145,6 +145,18 @@ allOf:
>          - power-domains
>          - resets
>          - reset-names
> +  - if:
> +      not:

I think this makes the binding difficult to maintain. You have:
1. if - amlogic - then - some properties
2. if - renesas - then - some properties
3. if - not mediatek - then - something else
4. if - mediatek - then - some properties

Instead just disallow power domains in each of other variants.

Best regards,
Krzysztof
  
AngeloGioacchino Del Regno Feb. 24, 2023, 1:09 p.m. UTC | #4
Il 24/02/23 11:09, Chen-Yu Tsai ha scritto:
> On Fri, Feb 24, 2023 at 6:08 PM Chen-Yu Tsai <wenst@chromium.org> wrote:
>>
>> On Thu, Feb 23, 2023 at 9:34 PM AngeloGioacchino Del Regno
>> <angelogioacchino.delregno@collabora.com> wrote:
>>>
>>> In preparation for adding new bindings for new MediaTek SoCs, split out
>>> the power-domain-names and power-domainsvariation from the `else` in
> 
>                                              ^ missing space
> 
> Once fixed,

I think you even mentioned that already, ugh. Will fix.

> 
> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
> 
>>> the current mediatek,mt8183-mali conditional.
>>>
>>> The sram-supply part is left in place to be disallowed for anything
>>> that is not compatible with "mediatek,mt8183-mali" as this regulator
>>> is MediaTek-specific and it is, and will ever be, used only for this
>>> specific string due to the addition of the mediatek-regulator-coupler
>>> driver.
>>>
>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>
>> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
  

Patch

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index 02699d389be1..ac174c17e25f 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -145,6 +145,18 @@  allOf:
         - power-domains
         - resets
         - reset-names
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - mediatek,mt8183-mali
+    then:
+      properties:
+        power-domains:
+          maxItems: 1
+        power-domain-names: false
   - if:
       properties:
         compatible:
@@ -166,9 +178,6 @@  allOf:
         - power-domain-names
     else:
       properties:
-        power-domains:
-          maxItems: 1
-        power-domain-names: false
         sram-supply: false
   - if:
       properties: