diff mbox series

[2/4] ASoC: SOF: imx: Add mach entry to select cs42888 topology

Message ID 20250122163544.1392869-3-daniel.baluta@nxp.com (mailing list archive)
State In Next
Headers show
Series Add SOF support for new board revisions | expand

Commit Message

Daniel Baluta Jan. 22, 2025, 4:35 p.m. UTC
After commit 2b9cdef13648 ("ASoC: SOF: imx: Add devicetree support
to select topologies") we select topology to be used by the board
compatible string in the dts.

Now that we have a way to know when the baseboard is installed, use
the board compatible and select proper topology files when the cs42888
Audio IO card is used.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 sound/soc/sof/imx/imx8.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Frank Li Jan. 22, 2025, 7:55 p.m. UTC | #1
On Wed, Jan 22, 2025 at 06:35:42PM +0200, Daniel Baluta wrote:
> After commit 2b9cdef13648 ("ASoC: SOF: imx: Add devicetree support
> to select topologies") we select topology to be used by the board
> compatible string in the dts.

I am confused. why not use "sof-imx8-cs42888.tplg" in imx8's dts instead
use board's compatible string "fsl,imx8qxp-mek-bb".

More and more boards will be added in future. This file will become bigger
and bigger!

Frank

>
> Now that we have a way to know when the baseboard is installed, use
> the board compatible and select proper topology files when the cs42888
> Audio IO card is used.
>
> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
> Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  sound/soc/sof/imx/imx8.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
> index 0b85b29d1067..d6117a3d4266 100644
> --- a/sound/soc/sof/imx/imx8.c
> +++ b/sound/soc/sof/imx/imx8.c
> @@ -611,6 +611,17 @@ static struct snd_sof_of_mach sof_imx8_machs[] = {
>  		.sof_tplg_filename = "sof-imx8-wm8960.tplg",
>  		.drv_name = "asoc-audio-graph-card2",
>  	},
> +	{
> +		.compatible = "fsl,imx8qxp-mek-bb",
> +		.sof_tplg_filename = "sof-imx8-cs42888.tplg",
> +		.drv_name = "asoc-audio-graph-card2",
> +	},
> +	{
> +		.compatible = "fsl,imx8qm-mek-bb",
> +		.sof_tplg_filename = "sof-imx8-cs42888.tplg",
> +		.drv_name = "asoc-audio-graph-card2",
> +	},
> +
>  	{}
>  };
>
> --
> 2.43.0
>
Daniel Baluta Jan. 23, 2025, 9:38 a.m. UTC | #2
On Wed, Jan 22, 2025 at 9:55 PM Frank Li <Frank.li@nxp.com> wrote:
>
> On Wed, Jan 22, 2025 at 06:35:42PM +0200, Daniel Baluta wrote:
> > After commit 2b9cdef13648 ("ASoC: SOF: imx: Add devicetree support
> > to select topologies") we select topology to be used by the board
> > compatible string in the dts.
>
> I am confused. why not use "sof-imx8-cs42888.tplg" in imx8's dts instead
> use board's compatible string "fsl,imx8qxp-mek-bb".
>
> More and more boards will be added in future. This file will become bigger
> and bigger!

Hi Frank,

So you mean create a dts property named e.g sof-tplg-name and read the
topology name from dts?

dsp {
       firmware-name="sof-imx8.ri";
       tplg-name = "sof-imx8-cs428888.tplg";
};


This was our first approach but then we aligned with the community on
using compatible to match
for properties like default fw path, default tplg path, fw name, tplg name.

Now dts should somehow describe the hardware not the software (e.g
tplg binary) used on that platform.
The growing number of boards will not be a problem, each one will have
a compatible in the dts.

But the concern here is how we describe a hardware setup where we have
a CPU board + a baseboard
like it is the case for cs42888 codec?

Our approach was that in our dts or overlay dts that describes SOF
with cs428888 codec to put the exact
compatible "fsl,imx8qxp-mek-bb" and match it with static vector in SOF
driver that you see in this patch.

SOF core relies on the compatible string in order to identify the
correct tplg_filename for example.

thanks,
Daniel.
Frank Li Jan. 23, 2025, 3:38 p.m. UTC | #3
On Thu, Jan 23, 2025 at 11:38:33AM +0200, Daniel Baluta wrote:
> On Wed, Jan 22, 2025 at 9:55 PM Frank Li <Frank.li@nxp.com> wrote:
> >
> > On Wed, Jan 22, 2025 at 06:35:42PM +0200, Daniel Baluta wrote:
> > > After commit 2b9cdef13648 ("ASoC: SOF: imx: Add devicetree support
> > > to select topologies") we select topology to be used by the board
> > > compatible string in the dts.
> >
> > I am confused. why not use "sof-imx8-cs42888.tplg" in imx8's dts instead
> > use board's compatible string "fsl,imx8qxp-mek-bb".
> >
> > More and more boards will be added in future. This file will become bigger
> > and bigger!
>
> Hi Frank,
>
> So you mean create a dts property named e.g sof-tplg-name and read the
> topology name from dts?
>
> dsp {
>        firmware-name="sof-imx8.ri";
>        tplg-name = "sof-imx8-cs428888.tplg";
> };

  dsp {
	compatible = "imx8-dsp-xxxx";
	...
  }

in dsp driver, map "imx8-dsp-xxxx" to "sof-imx8-cs428888.tplg" and
"sof-imx8.ri".

>
>
> This was our first approach but then we aligned with the community on
> using compatible to match
> for properties like default fw path, default tplg path, fw name, tplg name.

What's origial email thread. I think "compatible" refer to dsp node, not
to boards level compatible string.

>
> Now dts should somehow describe the hardware not the software (e.g
> tplg binary) used on that platform.
> The growing number of boards will not be a problem, each one will have
> a compatible in the dts.

Yes, but your C files will fill up meansless map code when more board
added.


>
> But the concern here is how we describe a hardware setup where we have
> a CPU board + a baseboard
> like it is the case for cs42888 codec?
>
> Our approach was that in our dts or overlay dts that describes SOF
> with cs428888 codec to put the exact
> compatible "fsl,imx8qxp-mek-bb" and match it with static vector in SOF
> driver that you see in this patch.
>
> SOF core relies on the compatible string in order to identify the
> correct tplg_filename for example.

Any application ctrl tools can link these nodes?

Frank

>
> thanks,
> Daniel.
diff mbox series

Patch

diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index 0b85b29d1067..d6117a3d4266 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -611,6 +611,17 @@  static struct snd_sof_of_mach sof_imx8_machs[] = {
 		.sof_tplg_filename = "sof-imx8-wm8960.tplg",
 		.drv_name = "asoc-audio-graph-card2",
 	},
+	{
+		.compatible = "fsl,imx8qxp-mek-bb",
+		.sof_tplg_filename = "sof-imx8-cs42888.tplg",
+		.drv_name = "asoc-audio-graph-card2",
+	},
+	{
+		.compatible = "fsl,imx8qm-mek-bb",
+		.sof_tplg_filename = "sof-imx8-cs42888.tplg",
+		.drv_name = "asoc-audio-graph-card2",
+	},
+
 	{}
 };