Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF

From: Krzysztof Kozlowski
Date: Mon Oct 19 2020 - 13:06:20 EST


On Mon, 19 Oct 2020 at 18:56, Fabio Estevam <festevam@xxxxxxxxx> wrote:
>
> Hi Krzysztof,
>
> On Mon, Oct 12, 2020 at 2:00 PM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>
> > > + spdif1: spdif@30090000 {
> > > + compatible = "fsl,imx8mm-spdif", "fsl,imx35-spdif";
> >
> > This does not pass the dtschema validation, so only "fsl,imx35-spdif".
>
> Shouldn't the dt schema validation be changed then to accept this format?

Depends. If a given compatible is in the schema, then the answer is:
rather not. The DTS conform to schema, not the otherwise. When
dtschema is sent this is the ABI to which the kernel should conform.
User-space or other SW (e.g. U-Boot) could depend on it. Of course
there are exceptions...

If the compatible is not in the schema, then of course it could be
added if there is a need. In this case, device is simply compatible
with "fsl,imx35-spdif" so there is no real need to change the schema.
Just use the existing compatible. Look at one funny example in iMX:
drivers/pwm/pwm-imx27.c. Someone created multiple compatibles but does
not use them at all, because the hardware looks exactly the same.
Therefore driver implements only one compatible because entire HW is
compatible with fsl,imx27-pwm. In such clear case, why adding many
compatibles? It's just a churn.

Best regards,
Krzysztof