[alsa-devel] [PATCH 3/4] ASoC: topology: Set the link ID when creating a FE DAI link

mengdong.lin at linux.intel.com mengdong.lin at linux.intel.com
Tue Apr 19 07:12:43 CEST 2016


From: Mengdong Lin <mengdong.lin at linux.intel.com>

Topology will set the link's generic id when creating a FE link.
Device drivers can check the id for link specific initialization.

Signed-off-by: Mengdong Lin <mengdong.lin at linux.intel.com>

diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h
index e8def0b..fcdf5d7 100644
--- a/include/uapi/sound/asoc.h
+++ b/include/uapi/sound/asoc.h
@@ -480,7 +480,7 @@ struct snd_soc_tplg_pcm {
 	__le32 size;		/* in bytes of this structure */
 	char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
 	char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
-	__le32 pcm_id;		/* unique ID - used to match */
+	__le32 pcm_id;		/* unique ID - used to match with DAI link */
 	__le32 dai_id;		/* unique ID - used to match */
 	__le32 playback;	/* supports playback mode */
 	__le32 capture;		/* supports capture mode */
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 1cf94d7..bdbfcef 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1598,6 +1598,7 @@ static int soc_tplg_link_create(struct soc_tplg *tplg,
 
 	link->name = pcm->pcm_name;
 	link->stream_name = pcm->pcm_name;
+	link->id = pcm->pcm_id;
 
 	/* pass control to component driver for optional further init */
 	ret = soc_tplg_dai_link_load(tplg, link);
-- 
2.5.0



More information about the Alsa-devel mailing list