diff options
author | Mengdong Lin <mengdong.lin@linux.intel.com> | 2016-11-24 09:33:52 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-11-24 14:20:03 +0100 |
commit | f9633ed8520dd9a4cce81337173087d03521da6d (patch) | |
tree | 77b84a1b75bc0885d723df4e1967b0f4a2631228 | |
parent | fa7a52e636e79d5882d1d8beb9335b62256d9475 (diff) | |
download | alsa-lib-f9633ed8520dd9a4cce81337173087d03521da6d.tar.gz |
topology: Merge private data before embedded controls of a widget
For a widget ABI object, its private data sits before the embedded
controls, so we should merge the private data blocks at first, and
then the embedded controls.
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/topology/dapm.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/topology/dapm.c b/src/topology/dapm.c index 9fa0aac0..e8307513 100644 --- a/src/topology/dapm.c +++ b/src/topology/dapm.c @@ -160,7 +160,21 @@ static int tplg_build_widget(snd_tplg_t *tplg, base = &elem->ref_list; - /* for each ref in this control elem */ + /* A widget's private data sits before the embedded controls. + * So merge the private data blocks at first + */ + list_for_each(pos, base) { + ref = list_entry(pos, struct tplg_ref, list); + + if (ref->type != SND_TPLG_TYPE_DATA) + continue; + + err = tplg_copy_data(tplg, elem, ref); + if (err < 0) + return err; + } + + /* Merge the embedded controls */ list_for_each(pos, base) { ref = list_entry(pos, struct tplg_ref, list); @@ -190,12 +204,6 @@ static int tplg_build_widget(snd_tplg_t *tplg, err = copy_dapm_control(elem, ref->elem); break; - case SND_TPLG_TYPE_DATA: - err = tplg_copy_data(tplg, elem, ref); - if (err < 0) - return err; - break; - default: break; } |