diff mbox series

[3/5] dt-bindings: media: rockchip-vpu: Add PX30 compatible

Message ID 20210107134101.195426-4-paul.kocialkowski@bootlin.com (mailing list archive)
State New, archived
Headers show
Series Rockchip PX30 RGA and VPU support | expand

Commit Message

Paul Kocialkowski Jan. 7, 2021, 1:40 p.m. UTC
The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
extra clock (SCLK).

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 .../bindings/media/rockchip-vpu.yaml          | 25 +++++++++++++------
 1 file changed, 17 insertions(+), 8 deletions(-)

Comments

Philipp Zabel Jan. 7, 2021, 2:55 p.m. UTC | #1
Hi Paul,

On Thu, 2021-01-07 at 14:40 +0100, Paul Kocialkowski wrote:
> The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
> and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
> extra clock (SCLK).
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
>  .../bindings/media/rockchip-vpu.yaml          | 25 +++++++++++++------
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> index c81dbc3e8960..c446b9ead21b 100644
> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> @@ -15,10 +15,13 @@ description:
>  
>  properties:
>    compatible:
> -    enum:
> -      - rockchip,rk3288-vpu
> -      - rockchip,rk3328-vpu
> -      - rockchip,rk3399-vpu
> +    oneOf:
> +      - const: rockchip,rk3288-vpu
> +      - const: rockchip,rk3328-vpu
> +      - const: rockchip,rk3399-vpu
> +      - items:
> +        - const: rockchip,px30-vpu
> +        - const: rockchip,rk3399-vpu
>  
>    reg:
>      maxItems: 1
> @@ -35,12 +38,18 @@ properties:
>            - const: vdpu
>  
>    clocks:
> -    maxItems: 2
> +    minItems: 2
> +    maxItems: 3
>  
>    clock-names:
> -    items:
> -      - const: aclk
> -      - const: hclk
> +    oneOf:
> +      - items:
> +        - const: aclk
> +        - const: hclk
> +      - items:
> +        - const: aclk
> +        - const: hclk
> +        - const: sclk

You could make this:

    clock-names:
      minItems: 2
      items:
        - const: aclk
        - const: hclk
        - const: sclk

And then:

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: rockchip,px30-vpu
    then:
      properties:
        clock-names:
          minItems: 3

to make sure each variant has the correct clocks set.

regards
Philipp
Rob Herring (Arm) Jan. 7, 2021, 3:47 p.m. UTC | #2
On Thu, 07 Jan 2021 14:40:59 +0100, Paul Kocialkowski wrote:
> The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
> and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
> extra clock (SCLK).
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
>  .../bindings/media/rockchip-vpu.yaml          | 25 +++++++++++++------
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/media/rockchip-vpu.yaml:23:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
./Documentation/devicetree/bindings/media/rockchip-vpu.yaml:47:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
./Documentation/devicetree/bindings/media/rockchip-vpu.yaml:50:9: [warning] wrong indentation: expected 10 but found 8 (indentation)

dtschema/dtc warnings/errors:

See https://patchwork.ozlabs.org/patch/1423300

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Paul Kocialkowski Jan. 11, 2021, 5:20 p.m. UTC | #3
Hi Philipp,

On Thu 07 Jan 21, 15:55, Philipp Zabel wrote:
> Hi Paul,
> 
> On Thu, 2021-01-07 at 14:40 +0100, Paul Kocialkowski wrote:
> > The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
> > and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
> > extra clock (SCLK).
> > 
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> >  .../bindings/media/rockchip-vpu.yaml          | 25 +++++++++++++------
> >  1 file changed, 17 insertions(+), 8 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > index c81dbc3e8960..c446b9ead21b 100644
> > --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > @@ -15,10 +15,13 @@ description:
> >  
> >  properties:
> >    compatible:
> > -    enum:
> > -      - rockchip,rk3288-vpu
> > -      - rockchip,rk3328-vpu
> > -      - rockchip,rk3399-vpu
> > +    oneOf:
> > +      - const: rockchip,rk3288-vpu
> > +      - const: rockchip,rk3328-vpu
> > +      - const: rockchip,rk3399-vpu
> > +      - items:
> > +        - const: rockchip,px30-vpu
> > +        - const: rockchip,rk3399-vpu
> >  
> >    reg:
> >      maxItems: 1
> > @@ -35,12 +38,18 @@ properties:
> >            - const: vdpu
> >  
> >    clocks:
> > -    maxItems: 2
> > +    minItems: 2
> > +    maxItems: 3
> >  
> >    clock-names:
> > -    items:
> > -      - const: aclk
> > -      - const: hclk
> > +    oneOf:
> > +      - items:
> > +        - const: aclk
> > +        - const: hclk
> > +      - items:
> > +        - const: aclk
> > +        - const: hclk
> > +        - const: sclk
> 
> You could make this:
> 
>     clock-names:
>       minItems: 2
>       items:
>         - const: aclk
>         - const: hclk
>         - const: sclk
> 
> And then:
> 
> allOf:
>   - if:
>       properties:
>         compatible:
>           contains:
>             const: rockchip,px30-vpu
>     then:
>       properties:
>         clock-names:
>           minItems: 3
> 
> to make sure each variant has the correct clocks set.

Thanks for the suggestion! That's a finer grain that my proposal.

Rob, is there a preference for how this case should be handled?
Here, we want to specify an extra clock for the PX30 case.

Cheers,

Paul
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
index c81dbc3e8960..c446b9ead21b 100644
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -15,10 +15,13 @@  description:
 
 properties:
   compatible:
-    enum:
-      - rockchip,rk3288-vpu
-      - rockchip,rk3328-vpu
-      - rockchip,rk3399-vpu
+    oneOf:
+      - const: rockchip,rk3288-vpu
+      - const: rockchip,rk3328-vpu
+      - const: rockchip,rk3399-vpu
+      - items:
+        - const: rockchip,px30-vpu
+        - const: rockchip,rk3399-vpu
 
   reg:
     maxItems: 1
@@ -35,12 +38,18 @@  properties:
           - const: vdpu
 
   clocks:
-    maxItems: 2
+    minItems: 2
+    maxItems: 3
 
   clock-names:
-    items:
-      - const: aclk
-      - const: hclk
+    oneOf:
+      - items:
+        - const: aclk
+        - const: hclk
+      - items:
+        - const: aclk
+        - const: hclk
+        - const: sclk
 
   power-domains:
     maxItems: 1