Skip to content

Commit

Permalink
ASoC: SOF: imx: Add devicetree support to select topologies
Browse files Browse the repository at this point in the history
We describe tplg_file_name and drv_name using snd_sof_of_mach
array and select correct machine description based on dts compatible
string.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://msgid.link/r/20240212125258.420265-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
dbaluta authored and broonie committed Feb 12, 2024
1 parent f7fc624 commit 2b9cdef
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sound/soc/sof/imx/imx8.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,22 @@ static struct snd_sof_dsp_ops sof_imx8x_ops = {
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
};

static struct snd_sof_of_mach sof_imx8_machs[] = {
{
.compatible = "fsl,imx8qxp-mek",
.sof_tplg_filename = "sof-imx8-wm8960.tplg",
.drv_name = "asoc-audio-graph-card2",
},
{
.compatible = "fsl,imx8qm-mek",
.sof_tplg_filename = "sof-imx8-wm8960.tplg",
.drv_name = "asoc-audio-graph-card2",
},
{}
};

static struct sof_dev_desc sof_of_imx8qxp_desc = {
.of_machines = sof_imx8_machs,
.ipc_supported_mask = BIT(SOF_IPC_TYPE_3),
.ipc_default = SOF_IPC_TYPE_3,
.default_fw_path = {
Expand All @@ -624,6 +639,7 @@ static struct sof_dev_desc sof_of_imx8qxp_desc = {
};

static struct sof_dev_desc sof_of_imx8qm_desc = {
.of_machines = sof_imx8_machs,
.ipc_supported_mask = BIT(SOF_IPC_TYPE_3),
.ipc_default = SOF_IPC_TYPE_3,
.default_fw_path = {
Expand Down
10 changes: 10 additions & 0 deletions sound/soc/sof/imx/imx8m.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,17 @@ static struct snd_sof_dsp_ops sof_imx8m_ops = {
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
};

static struct snd_sof_of_mach sof_imx8mp_machs[] = {
{
.compatible = "fsl,imx8mp-evk",
.sof_tplg_filename = "sof-imx8mp-wm8960.tplg",
.drv_name = "asoc-audio-graph-card2",
},
{}
};

static struct sof_dev_desc sof_of_imx8mp_desc = {
.of_machines = sof_imx8mp_machs,
.ipc_supported_mask = BIT(SOF_IPC_TYPE_3),
.ipc_default = SOF_IPC_TYPE_3,
.default_fw_path = {
Expand Down
10 changes: 10 additions & 0 deletions sound/soc/sof/imx/imx8ulp.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,17 @@ static struct snd_sof_dsp_ops sof_imx8ulp_ops = {
.set_power_state = imx8ulp_dsp_set_power_state,
};

static struct snd_sof_of_mach sof_imx8ulp_machs[] = {
{
.compatible = "fsl,imx8ulp-evk",
.sof_tplg_filename = "sof-imx8ulp-btsco.tplg",
.drv_name = "asoc-audio-graph-card2",
},
{}
};

static struct sof_dev_desc sof_of_imx8ulp_desc = {
.of_machines = sof_imx8ulp_machs,
.ipc_supported_mask = BIT(SOF_IPC_TYPE_3),
.ipc_default = SOF_IPC_TYPE_3,
.default_fw_path = {
Expand Down

0 comments on commit 2b9cdef

Please sign in to comment.