ASoC: soc-topology: fix modern dai link style
The topology code can create a FE DAI link but did not allocate the
memory for a platform component - whose name can be overridden at a
later time.
Fixes: 23b946ce28
("ASoC: soc-topology: use modern dai_link style")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2f7e015c1f
commit
3e6de89409
@ -1882,8 +1882,8 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
|
|||||||
struct snd_soc_dai_link_component *dlc;
|
struct snd_soc_dai_link_component *dlc;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* link + cpu + codec */
|
/* link + cpu + codec + platform */
|
||||||
link = kzalloc(sizeof(*link) + (2 * sizeof(*dlc)), GFP_KERNEL);
|
link = kzalloc(sizeof(*link) + (3 * sizeof(*dlc)), GFP_KERNEL);
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -1891,9 +1891,11 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
|
|||||||
|
|
||||||
link->cpus = &dlc[0];
|
link->cpus = &dlc[0];
|
||||||
link->codecs = &dlc[1];
|
link->codecs = &dlc[1];
|
||||||
|
link->platforms = &dlc[2];
|
||||||
|
|
||||||
link->num_cpus = 1;
|
link->num_cpus = 1;
|
||||||
link->num_codecs = 1;
|
link->num_codecs = 1;
|
||||||
|
link->num_platforms = 1;
|
||||||
|
|
||||||
if (strlen(pcm->pcm_name)) {
|
if (strlen(pcm->pcm_name)) {
|
||||||
link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
|
link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
|
||||||
@ -1907,6 +1909,8 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
|
|||||||
link->codecs->name = "snd-soc-dummy";
|
link->codecs->name = "snd-soc-dummy";
|
||||||
link->codecs->dai_name = "snd-soc-dummy-dai";
|
link->codecs->dai_name = "snd-soc-dummy-dai";
|
||||||
|
|
||||||
|
link->platforms->name = "snd-soc-dummy";
|
||||||
|
|
||||||
/* enable DPCM */
|
/* enable DPCM */
|
||||||
link->dynamic = 1;
|
link->dynamic = 1;
|
||||||
link->dpcm_playback = le32_to_cpu(pcm->playback);
|
link->dpcm_playback = le32_to_cpu(pcm->playback);
|
||||||
|
Loading…
Reference in New Issue
Block a user