]> git.alsa-project.org Git - alsa-lib.git/commitdiff
topology: Fix pcm ID & name parsing
authorMengdong Lin <mengdong.lin@linux.intel.com>
Fri, 29 Apr 2016 03:03:30 +0000 (11:03 +0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 May 2016 08:30:40 +0000 (10:30 +0200)
The name and ID of SectionPCM should be set to pcm_name and pcm_id,
for a front-end DAI link in the kernel, not for the front-end DAI
of the link.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/asoc.h
src/topology/pcm.c

index 920c9e07bcafbbcef3e9a7598abaf57a42775365..abe49c5949f46a273a32ca3f88d57fea2a4b064c 100644 (file)
@@ -414,7 +414,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 */
index 1df4f54db998456a9f7a59447e6ae689a634cf0c..16618216eb30a304809600f2a311d1b0c4d69ffd 100644 (file)
@@ -337,7 +337,7 @@ int tplg_parse_pcm(snd_tplg_t *tplg,
 
        pcm = elem->pcm;
        pcm->size = elem->size;
-       elem_copy_text(pcm->dai_name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
+       elem_copy_text(pcm->pcm_name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
 
        tplg_dbg(" PCM: %s\n", elem->id);
 
@@ -366,8 +366,8 @@ int tplg_parse_pcm(snd_tplg_t *tplg,
                        if (snd_config_get_string(n, &val) < 0)
                                return -EINVAL;
 
-                       pcm->dai_id = atoi(val);
-                       tplg_dbg("\t%s: %d\n", id, pcm->dai_id);
+                       pcm->pcm_id = atoi(val);
+                       tplg_dbg("\t%s: %d\n", id, pcm->pcm_id);
                        continue;
                }