dt-bindings: can: renesas,rcar-canfd: Simplify the conditional schema

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@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20250417054320.14100-2-biju.das.jz@bp.renesas.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Biju Das 2025-04-17 06:43:02 +01:00 committed by Marc Kleine-Budde
parent 9ab0ac0e53
commit 466c8ef7b6

View File

@ -45,7 +45,35 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts: true interrupts:
oneOf:
- items:
- description: Channel interrupt
- description: Global interrupt
- 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
interrupt-names:
oneOf:
- items:
- const: ch_int
- const: g_int
- 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
clocks: clocks:
maxItems: 3 maxItems: 3
@ -117,52 +145,55 @@ allOf:
then: then:
properties: properties:
interrupts: interrupts:
items: minItems: 8
- description: CAN global error interrupt maxItems: 8
- 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
interrupt-names: interrupt-names:
items: minItems: 8
- const: g_err maxItems: 8
- const: g_recc
- const: ch0_err
- const: ch0_rec
- const: ch0_trx
- const: ch1_err
- const: ch1_rec
- const: ch1_trx
resets: resets:
minItems: 2
maxItems: 2 maxItems: 2
reset-names: reset-names:
items: minItems: 2
- const: rstp_n maxItems: 2
- const: rstc_n
required: required:
- reset-names - reset-names
else:
- if:
properties:
compatible:
contains:
enum:
- renesas,rcar-gen3-canfd
- renesas,rcar-gen4-canfd
then:
properties: properties:
interrupts: interrupts:
items: minItems: 2
- description: Channel interrupt maxItems: 2
- description: Global interrupt
interrupt-names: interrupt-names:
items: minItems: 2
- const: ch_int maxItems: 2
- const: g_int
resets: resets:
maxItems: 1 maxItems: 1
- if:
properties:
compatible:
contains:
enum:
- renesas,rcar-gen3-canfd
- renesas,rzg2l-canfd
then:
patternProperties:
"^channel[2-7]$": false
- if: - if:
properties: properties:
compatible: compatible:
@ -171,16 +202,6 @@ allOf:
then: then:
patternProperties: patternProperties:
"^channel[4-7]$": false "^channel[4-7]$": false
else:
if:
not:
properties:
compatible:
contains:
const: renesas,rcar-gen4-canfd
then:
patternProperties:
"^channel[2-7]$": false
unevaluatedProperties: false unevaluatedProperties: false