Skip to content

Commit f59b16e

Browse files
dbalutabroonie
authored andcommitted
ASoC: SOF: topology: Add dummy support for i.MX8 DAIs
Add dummy support for SAI/ESAI digital audio interface IPs found on i.MX8 boards. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190815192018.30570-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6173269 commit f59b16e

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎include/sound/sof/dai.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ enum sof_ipc_dai_type {
5050
SOF_DAI_INTEL_DMIC, /**< Intel DMIC */
5151
SOF_DAI_INTEL_HDA, /**< Intel HD/A */
5252
SOF_DAI_INTEL_SOUNDWIRE, /**< Intel SoundWire */
53+
SOF_DAI_IMX_SAI, /**< i.MX SAI */
54+
SOF_DAI_IMX_ESAI, /**< i.MX ESAI */
5355
};
5456

5557
/* general purpose DAI configuration */

‎include/uapi/sound/sof/tokens.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,12 @@
106106
/* for backward compatibility */
107107
#define SOF_TKN_EFFECT_TYPE SOF_TKN_PROCESS_TYPE
108108

109+
/* SAI */
110+
#define SOF_TKN_IMX_SAI_FIRST_TOKEN 1000
111+
/* TODO: Add SAI tokens */
112+
113+
/* ESAI */
114+
#define SOF_TKN_IMX_ESAI_FIRST_TOKEN 1100
115+
/* TODO: Add ESAI tokens */
116+
109117
#endif

‎sound/soc/sof/topology.c‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ static const struct sof_dai_types sof_dais[] = {
346346
{"SSP", SOF_DAI_INTEL_SSP},
347347
{"HDA", SOF_DAI_INTEL_HDA},
348348
{"DMIC", SOF_DAI_INTEL_DMIC},
349+
{"SAI", SOF_DAI_IMX_SAI},
350+
{"ESAI", SOF_DAI_IMX_ESAI},
349351
};
350352

351353
static enum sof_ipc_dai_type find_dai(const char *name)
@@ -2513,6 +2515,26 @@ static int sof_link_ssp_load(struct snd_soc_component *scomp, int index,
25132515
return ret;
25142516
}
25152517

2518+
static int sof_link_sai_load(struct snd_soc_component *scomp, int index,
2519+
struct snd_soc_dai_link *link,
2520+
struct snd_soc_tplg_link_config *cfg,
2521+
struct snd_soc_tplg_hw_config *hw_config,
2522+
struct sof_ipc_dai_config *config)
2523+
{
2524+
/*TODO: Add implementation */
2525+
return 0;
2526+
}
2527+
2528+
static int sof_link_esai_load(struct snd_soc_component *scomp, int index,
2529+
struct snd_soc_dai_link *link,
2530+
struct snd_soc_tplg_link_config *cfg,
2531+
struct snd_soc_tplg_hw_config *hw_config,
2532+
struct sof_ipc_dai_config *config)
2533+
{
2534+
/*TODO: Add implementation */
2535+
return 0;
2536+
}
2537+
25162538
static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
25172539
struct snd_soc_dai_link *link,
25182540
struct snd_soc_tplg_link_config *cfg,
@@ -2837,6 +2859,14 @@ static int sof_link_load(struct snd_soc_component *scomp, int index,
28372859
ret = sof_link_hda_load(scomp, index, link, cfg, hw_config,
28382860
&config);
28392861
break;
2862+
case SOF_DAI_IMX_SAI:
2863+
ret = sof_link_sai_load(scomp, index, link, cfg, hw_config,
2864+
&config);
2865+
break;
2866+
case SOF_DAI_IMX_ESAI:
2867+
ret = sof_link_esai_load(scomp, index, link, cfg, hw_config,
2868+
&config);
2869+
break;
28402870
default:
28412871
dev_err(sdev->dev, "error: invalid DAI type %d\n", config.type);
28422872
ret = -EINVAL;

0 commit comments

Comments
 (0)