]> git.alsa-project.org Git - alsa-lib.git/commitdiff
topology: add support to parse private data for pcm
authorKeyon Jie <yang.jie@linux.intel.com>
Thu, 1 Aug 2019 09:15:06 +0000 (17:15 +0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 6 Aug 2019 10:50:59 +0000 (12:50 +0200)
We have private data section in struct snd_soc_tplg_pcm, but alsatplg
doesn't support handling it yet, here add handling in tplg_parse_pcm()
to enable it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/topology/data.c
src/topology/pcm.c

index b3f4421f5d5c7f2fd757bfc0caff879ad7a3d9fb..729ce1f4c0b60d8b2f9484b13143dd5d21ed1255 100644 (file)
@@ -53,6 +53,9 @@ struct snd_soc_tplg_private *get_priv_data(struct tplg_elem *elem)
        case SND_TPLG_TYPE_BE:
                priv = &elem->link->priv;
                break;
+       case SND_TPLG_TYPE_PCM:
+               priv = &elem->pcm->priv;
+               break;
        default:
                SNDERR("error: '%s': no support for private data for type %d\n",
                        elem->id, elem->type);
index 5f586dc133e71411e96ad7e399bc7464cf61b230..c533ee68506177ec7afda80345a41233236256b0 100644 (file)
@@ -732,6 +732,14 @@ int tplg_parse_pcm(snd_tplg_t *tplg,
                                return err;
                        continue;
                }
+
+               /* private data */
+               if (strcmp(id, "data") == 0) {
+                       err = tplg_parse_data_refs(n, elem);
+                       if (err < 0)
+                               return err;
+                       continue;
+               }
        }
 
        return 0;