Re: [PATCH v4 01/11] dt-bindings: can: renesas,rcar-canfd: Simplify the conditional schema

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Thu, 6 Mar 2025 at 13:43, Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> RZ/G3E SoC has 20 interrupts, 2 resets and 6 channels that need more
> branching with conditional schema. Simplify the conditional schema with
> if statements rather than the complex if-else statements to prepare for
> supporting RZ/G3E SoC.
>
> Acked-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

> --- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml

> @@ -117,52 +145,71 @@ allOf:
>      then:
>        properties:
>          interrupts:
> -          items:
> -            - description: CAN global error interrupt
> -            - description: CAN receive FIFO interrupt
> -            - description: CAN0 error interrupt
> -            - description: CAN0 transmit interrupt
> -            - description: CAN0 transmit/receive FIFO receive completion interrupt
> -            - description: CAN1 error interrupt
> -            - description: CAN1 transmit interrupt
> -            - description: CAN1 transmit/receive FIFO receive completion interrupt
> +          minItems: 8
> +          maxItems: 8
>
>          interrupt-names:
> -          items:
> -            - const: g_err
> -            - const: g_recc
> -            - const: ch0_err
> -            - const: ch0_rec
> -            - const: ch0_trx
> -            - const: ch1_err
> -            - const: ch1_rec
> -            - const: ch1_trx
> +          minItems: 8
> +          maxItems: 8
>
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - renesas,rcar-gen3-canfd
> +              - renesas,rcar-gen4-canfd
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 2
> +          maxItems: 2
> +
> +        interrupt-names:
> +          minItems: 2
> +          maxItems: 2
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: renesas,rzg2l-canfd
> +    then:
> +      properties:
>          resets:
> +          minItems: 2
>            maxItems: 2
>
>          reset-names:
> -          items:
> -            - const: rstp_n
> -            - const: rstc_n
> +          minItems: 2
> +          maxItems: 2
>
>        required:
>          - reset-names
> -    else:
> -      properties:
> -        interrupts:
> -          items:
> -            - description: Channel interrupt
> -            - description: Global interrupt
> -
> -        interrupt-names:
> -          items:
> -            - const: ch_int
> -            - const: g_int
>
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - renesas,rcar-gen3-canfd
> +              - renesas,rcar-gen4-canfd
> +    then:
> +      properties:
>          resets:
>            maxItems: 1

I understand you introduced separate if-blocks for interrupts and
resets because RZ/G3E can reuse only a part of the RZ/G2L rules.
However, at least the rules for R-Car Gen3/4 could be kept together,
reducing the number of lines.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux