mbox series

[RFC,0/2] ASoC: dt-bindings: renesas, rsnd.yaml: adjust to R-Car Gen4

Message ID 87r0v2uvm7.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series ASoC: dt-bindings: renesas, rsnd.yaml: adjust to R-Car Gen4 | expand

Message

Kuninori Morimoto Feb. 7, 2023, 1:12 a.m. UTC
Hi

This is [RFC] patches.

This patch-set adjust to R-Car Gen4 on renesas,rsnd.yaml.
It works and no error reported.
But by this patch, non-Gen4 leaks from "ssi-[0-9]" checking.
I'm not sure why it happens.

	-----------------------
	rcar_sound,ssi:
	  ...
	  patternProperties:
	    "^ssi-[0-9]$":
	      ...
	      required:
(*)	        - interrupts
 ^	      allOf:
 |	        - if:
 |	            not:
 |	              properties:
 |	                compatible:
(X)	                  contains:
 |(4)	                    const: renesas,rcar_sound-gen4
 |	          then:
 |	            required:
 |(A)	              - dmas
 v(B)	              - dma-names
	-----------------------
	sound@ec500000 {
(3)		compatible = "renesas,rcar_sound-gen3";
		...
		rcar_sound,ssi {
			ssi0: ssi-0 {
(*)				interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
(A)				dmas = <&audma0 0x01>, <&audma1 0x02>;
(B)				dma-names = "rx", "tx";
			};
			...
		};
		...
	};
	sound@ec500000 {
(4)		compatible = "renesas,rcar_sound-gen4";
		...
		rcar_sound,ssi {
			ssi0: ssi-0 {
(*)				interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
			};
			...
		};
		...
	};
	-----------------------

I want to do here is that "interrupts" (*) is always requested,
and dmas (A) / dma-names (B) are required on non-Gen4 case only.

But, it say no error if I removed (A)(B) lines from "Gen3".
This is not my expect behavior, but I'm not sure why it happens.
It seems (X) part is not working.

I'm happy if someone checks it and pointing what was wrong.

Kuninori Morimoto (2):
  ASoC: dt-bindings: renesas,rsnd.yaml: tidyup reg/reg-name
  ASoC: dt-bindings: renesas,rsnd.yaml: adjust to R-Car Gen4

 .../bindings/sound/renesas,rsnd.yaml          | 89 ++++++++++++++-----
 1 file changed, 68 insertions(+), 21 deletions(-)

Comments

Geert Uytterhoeven Feb. 7, 2023, 8 a.m. UTC | #1
Hi Morimoto-san,

On Tue, Feb 7, 2023 at 2:12 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> This is [RFC] patches.
>
> This patch-set adjust to R-Car Gen4 on renesas,rsnd.yaml.
> It works and no error reported.
> But by this patch, non-Gen4 leaks from "ssi-[0-9]" checking.
> I'm not sure why it happens.

If the logic becomes too complex, you can also split the binding
description in 4 files, one per R-Car generation.
That would lead to lots of duplication, though.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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
Kuninori Morimoto Feb. 8, 2023, 1:03 a.m. UTC | #2
Hi Geert

> > This patch-set adjust to R-Car Gen4 on renesas,rsnd.yaml.
> > It works and no error reported.
> > But by this patch, non-Gen4 leaks from "ssi-[0-9]" checking.
> > I'm not sure why it happens.
> 
> If the logic becomes too complex,

The logic itself is very simple IMO. The problem is that
all case hits to if-then for some reasons under certain conditions.
Under "patternProperties" or "xxx,yyy" style are the point ?
I'm not sure.

> you can also split the binding
> description in 4 files, one per R-Car generation.
> That would lead to lots of duplication, though.

It is nightmare for me...

Actually, to be very strict, dmas/dma-names are not mandatory,
because it supports PIO transfer mode.

I'm still trying to solve this issue by using many kind of schemas ways,
but all cases doesn't work for me...

Let's remove dmas/dma-names from required for now.
It is not a wrong schema.

Thank you for your help !!

Best regards
---
Kuninori Morimoto