[v4,1/3] media: dt-bindings: media: mediatek: vcodec: adapt to the 'clock-names' of different platforms

Message ID 20221202034450.3808-1-yunfei.dong@mediatek.com
State New
Headers
Series [v4,1/3] media: dt-bindings: media: mediatek: vcodec: adapt to the 'clock-names' of different platforms |

Commit Message

Yunfei Dong (董云飞) Dec. 2, 2022, 3:44 a.m. UTC
  mt8195 and mt8192 have different clock numbers, separate 'clock-names'
according to compatible name.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
compared with v3:
- rewrite clock-names according to different platforms.

Reference series:
[1]: v5 of this series is presend by Allen-KH Cheng.
     message-id: 20221128143832.25584-4-allen-kh.cheng@mediatek.com
---
 .../media/mediatek,vcodec-subdev-decoder.yaml | 41 ++++++++++++++++---
 1 file changed, 35 insertions(+), 6 deletions(-)
  

Comments

Rob Herring Dec. 5, 2022, 5:54 p.m. UTC | #1
On Fri, Dec 02, 2022 at 11:44:48AM +0800, Yunfei Dong wrote:
> mt8195 and mt8192 have different clock numbers, separate 'clock-names'
> according to compatible name.
> 
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> ---
> compared with v3:
> - rewrite clock-names according to different platforms.
> 
> Reference series:
> [1]: v5 of this series is presend by Allen-KH Cheng.
>      message-id: 20221128143832.25584-4-allen-kh.cheng@mediatek.com
> ---
>  .../media/mediatek,vcodec-subdev-decoder.yaml | 41 ++++++++++++++++---
>  1 file changed, 35 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> index 7c5b4a91c59b..a08b2c814f40 100644
> --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
> @@ -110,15 +110,12 @@ patternProperties:
>            Refer to bindings/iommu/mediatek,iommu.yaml.
>  
>        clocks:
> +        minItems: 1

Why 1? Looks like it should be 4 or 5 clocks.

>          maxItems: 5
>  
>        clock-names:
> -        items:
> -          - const: sel
> -          - const: soc-vdec
> -          - const: soc-lat
> -          - const: vdec
> -          - const: top
> +        minItems: 1
> +        maxItems: 5
>  
>        assigned-clocks:
>          maxItems: 1
> @@ -159,6 +156,38 @@ then:
>    required:
>      - interrupts
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt8192-vcodec-dec
> +    then:
> +      properties:
> +        clock-names:
> +          items:
> +            - const: sel
> +            - const: soc-vdec
> +            - const: soc-lat
> +            - const: vdec
> +            - const: top
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - mediatek,mt8195-vcodec-dec
> +    then:
> +      properties:
> +        clock-names:
> +          items:
> +            - const: sel
> +            - const: vdec
> +            - const: lat
> +            - const: top
> +
>  additionalProperties: false
>  
>  examples:
> -- 
> 2.18.0
> 
>
  
Yunfei Dong (董云飞) Dec. 6, 2022, 6:43 a.m. UTC | #2
Hi Rob,

Thanks for your suggestion.

On Mon, 2022-12-05 at 11:54 -0600, Rob Herring wrote:
> On Fri, Dec 02, 2022 at 11:44:48AM +0800, Yunfei Dong wrote:
> > mt8195 and mt8192 have different clock numbers, separate 'clock-
> > names'
> > according to compatible name.
> > 
> > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> > ---
> > compared with v3:
> > - rewrite clock-names according to different platforms.
> > 
> > Reference series:
> > [1]: v5 of this series is presend by Allen-KH Cheng.
> >      message-id: 20221128143832.25584-4-allen-kh.cheng@mediatek.com
> > ---
> >  .../media/mediatek,vcodec-subdev-decoder.yaml | 41
> > ++++++++++++++++---
> >  1 file changed, 35 insertions(+), 6 deletions(-)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-
> > decoder.yaml
> > b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-
> > decoder.yaml
> > index 7c5b4a91c59b..a08b2c814f40 100644
> > --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > subdev-decoder.yaml
> > +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-
> > subdev-decoder.yaml
> > @@ -110,15 +110,12 @@ patternProperties:
> >            Refer to bindings/iommu/mediatek,iommu.yaml.
> >  
> >        clocks:
> > +        minItems: 1
> 
> Why 1? Looks like it should be 4 or 5 clocks.
> 
Yes, I should write this vale to 4, will change it again if 1 is used
in the future.

Best regards,
Yunfei Dong
> >          maxItems: 5
> >  
> >        clock-names:
> > -        items:
> > -          - const: sel
> > -          - const: soc-vdec
> > -          - const: soc-lat
> > -          - const: vdec
> > -          - const: top
> > +        minItems: 1
> > +        maxItems: 5
> >  
> >        assigned-clocks:
> >          maxItems: 1
> > @@ -159,6 +156,38 @@ then:
> >    required:
> >      - interrupts
> >  
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - mediatek,mt8192-vcodec-dec
> > +    then:
> > +      properties:
> > +        clock-names:
> > +          items:
> > +            - const: sel
> > +            - const: soc-vdec
> > +            - const: soc-lat
> > +            - const: vdec
> > +            - const: top
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - mediatek,mt8195-vcodec-dec
> > +    then:
> > +      properties:
> > +        clock-names:
> > +          items:
> > +            - const: sel
> > +            - const: vdec
> > +            - const: lat
> > +            - const: top
> > +
> >  additionalProperties: false
> >  
> >  examples:
> > -- 
> > 2.18.0
> > 
> >
  

Patch

diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
index 7c5b4a91c59b..a08b2c814f40 100644
--- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml
@@ -110,15 +110,12 @@  patternProperties:
           Refer to bindings/iommu/mediatek,iommu.yaml.
 
       clocks:
+        minItems: 1
         maxItems: 5
 
       clock-names:
-        items:
-          - const: sel
-          - const: soc-vdec
-          - const: soc-lat
-          - const: vdec
-          - const: top
+        minItems: 1
+        maxItems: 5
 
       assigned-clocks:
         maxItems: 1
@@ -159,6 +156,38 @@  then:
   required:
     - interrupts
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8192-vcodec-dec
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: sel
+            - const: soc-vdec
+            - const: soc-lat
+            - const: vdec
+            - const: top
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8195-vcodec-dec
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: sel
+            - const: vdec
+            - const: lat
+            - const: top
+
 additionalProperties: false
 
 examples: