diff mbox series

[v3,1/3] dt-bindings: media: rockchip-vpu: Add RK3568 VEPU compatible

Message ID 20220511155309.2637-2-frattaroli.nicolas@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] dt-bindings: media: rockchip-vpu: Add RK3568 VEPU compatible | expand

Commit Message

Nicolas Frattaroli May 11, 2022, 3:53 p.m. UTC
The RK3568 and RK3566 have a Hantro VPU node solely dedicated to
encoding. This patch adds a compatible for it, and also allows
the bindings to only come with a vepu interrupt.

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
---
 .../devicetree/bindings/media/rockchip-vpu.yaml | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

Comments

Krzysztof Kozlowski May 11, 2022, 4 p.m. UTC | #1
On 11/05/2022 17:53, Nicolas Frattaroli wrote:
> The RK3568 and RK3566 have a Hantro VPU node solely dedicated to
> encoding. This patch adds a compatible for it, and also allows
> the bindings to only come with a vepu interrupt.
> 
> Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
> ---
>  .../devicetree/bindings/media/rockchip-vpu.yaml | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> index bacb60a34989..965ca80b5cea 100644
> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> @@ -22,6 +22,7 @@ properties:
>            - rockchip,rk3288-vpu
>            - rockchip,rk3328-vpu
>            - rockchip,rk3399-vpu
> +          - rockchip,rk3568-vepu
>            - rockchip,px30-vpu
>        - items:
>            - const: rockchip,rk3188-vpu
> @@ -39,7 +40,9 @@ properties:
>  
>    interrupt-names:
>      oneOf:
> -      - const: vdpu
> +      - enum:
> +          - vdpu
> +          - vepu
>        - items:
>            - const: vepu
>            - const: vdpu
> @@ -76,6 +79,18 @@ required:
>  
>  additionalProperties: false
>  
> +allOf:
> +  # compatibles that end in -vepu should only have the vepu interrupt
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            pattern: "^[a-zA-Z0-9\\-,_.]+\\-vepu$"

Why not listing the compatible how I asked? This is the common way of
handling allOf:if:then per variant.

https://lore.kernel.org/all/ea94f18d-3172-98bb-0892-a98236a08018@linaro.org/

Your patches do not apply on next, so the set might not have been tested
by Rob's bot.

Best regards,
Krzysztof
Nicolas Frattaroli May 11, 2022, 4:37 p.m. UTC | #2
On Mittwoch, 11. Mai 2022 18:00:09 CEST Krzysztof Kozlowski wrote:
> On 11/05/2022 17:53, Nicolas Frattaroli wrote:
> > The RK3568 and RK3566 have a Hantro VPU node solely dedicated to
> > encoding. This patch adds a compatible for it, and also allows
> > the bindings to only come with a vepu interrupt.
> > 
> > Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
> > ---
> >  .../devicetree/bindings/media/rockchip-vpu.yaml | 17 ++++++++++++++++-
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > index bacb60a34989..965ca80b5cea 100644
> > --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > @@ -22,6 +22,7 @@ properties:
> >            - rockchip,rk3288-vpu
> >            - rockchip,rk3328-vpu
> >            - rockchip,rk3399-vpu
> > +          - rockchip,rk3568-vepu
> >            - rockchip,px30-vpu
> >        - items:
> >            - const: rockchip,rk3188-vpu
> > @@ -39,7 +40,9 @@ properties:
> >  
> >    interrupt-names:
> >      oneOf:
> > -      - const: vdpu
> > +      - enum:
> > +          - vdpu
> > +          - vepu
> >        - items:
> >            - const: vepu
> >            - const: vdpu
> > @@ -76,6 +79,18 @@ required:
> >  
> >  additionalProperties: false
> >  
> > +allOf:
> > +  # compatibles that end in -vepu should only have the vepu interrupt
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            pattern: "^[a-zA-Z0-9\\-,_.]+\\-vepu$"
> 
> Why not listing the compatible how I asked? This is the common way of
> handling allOf:if:then per variant.

Because I was afraid that if this wasn't general enough to apply to all
future vepu-only instances of Hantro, then my patch might be bikeshed
into requiring a v4. Clearly, my worries had the opposite effect.

Also because I thought it was cool to use a pattern for this to enforce
consistent naming in the bindings.

> 
> https://lore.kernel.org/all/ea94f18d-3172-98bb-0892-a98236a08018@linaro.org/
> 
> Your patches do not apply on next, so the set might not have been tested
> by Rob's bot.

Good to know. Once I send out v4 in a few days and maybe after some more
opinions so I can stop bombarding the mailing list with tiny revisions
of the same patch set, I will base it on linux-next.

I'm happy to report though that this passes dt_binding_check with W=1
without adding any new warnings. I do actually run those checks (and
checkpatch) before submitting.

> 
> Best regards,
> Krzysztof
> 

Regards,
Nicolas Frattaroli
Krzysztof Kozlowski May 11, 2022, 4:55 p.m. UTC | #3
On 11/05/2022 18:37, Nicolas Frattaroli wrote:
> On Mittwoch, 11. Mai 2022 18:00:09 CEST Krzysztof Kozlowski wrote:
>> On 11/05/2022 17:53, Nicolas Frattaroli wrote:
>>> The RK3568 and RK3566 have a Hantro VPU node solely dedicated to
>>> encoding. This patch adds a compatible for it, and also allows
>>> the bindings to only come with a vepu interrupt.
>>>
>>> Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
>>> ---
>>>  .../devicetree/bindings/media/rockchip-vpu.yaml | 17 ++++++++++++++++-
>>>  1 file changed, 16 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> index bacb60a34989..965ca80b5cea 100644
>>> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> @@ -22,6 +22,7 @@ properties:
>>>            - rockchip,rk3288-vpu
>>>            - rockchip,rk3328-vpu
>>>            - rockchip,rk3399-vpu
>>> +          - rockchip,rk3568-vepu
>>>            - rockchip,px30-vpu
>>>        - items:
>>>            - const: rockchip,rk3188-vpu
>>> @@ -39,7 +40,9 @@ properties:
>>>  
>>>    interrupt-names:
>>>      oneOf:
>>> -      - const: vdpu
>>> +      - enum:
>>> +          - vdpu
>>> +          - vepu
>>>        - items:
>>>            - const: vepu
>>>            - const: vdpu
>>> @@ -76,6 +79,18 @@ required:
>>>  
>>>  additionalProperties: false
>>>  
>>> +allOf:
>>> +  # compatibles that end in -vepu should only have the vepu interrupt
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            pattern: "^[a-zA-Z0-9\\-,_.]+\\-vepu$"
>>
>> Why not listing the compatible how I asked? This is the common way of
>> handling allOf:if:then per variant.
> 
> Because I was afraid that if this wasn't general enough to apply to all
> future vepu-only instances of Hantro, then my patch might be bikeshed
> into requiring a v4. Clearly, my worries had the opposite effect.
> 
> Also because I thought it was cool to use a pattern for this to enforce
> consistent naming in the bindings.

Until it does not match for some reason. :) Just list the compatible
under enum and it is expected the list to grow over time (if needed).



Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
index bacb60a34989..965ca80b5cea 100644
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -22,6 +22,7 @@  properties:
           - rockchip,rk3288-vpu
           - rockchip,rk3328-vpu
           - rockchip,rk3399-vpu
+          - rockchip,rk3568-vepu
           - rockchip,px30-vpu
       - items:
           - const: rockchip,rk3188-vpu
@@ -39,7 +40,9 @@  properties:
 
   interrupt-names:
     oneOf:
-      - const: vdpu
+      - enum:
+          - vdpu
+          - vepu
       - items:
           - const: vepu
           - const: vdpu
@@ -76,6 +79,18 @@  required:
 
 additionalProperties: false
 
+allOf:
+  # compatibles that end in -vepu should only have the vepu interrupt
+  - if:
+      properties:
+        compatible:
+          contains:
+            pattern: "^[a-zA-Z0-9\\-,_.]+\\-vepu$"
+    then:
+      properties:
+        interrupt-names:
+          const: vepu
+
 examples:
   - |
         #include <dt-bindings/clock/rk3288-cru.h>