All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] topology: Merge private data before embedded controls of a widget
@ 2016-11-24  1:33 mengdong.lin
  2016-11-24 12:09 ` Liam Girdwood
  2016-11-24 13:25 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: mengdong.lin @ 2016-11-24  1:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, liam.r.girdwood, Mengdong Lin, mengdong.lin

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

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>

diff --git a/src/topology/dapm.c b/src/topology/dapm.c
index 9fa0aac..e830751 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;
 		}
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] topology: Merge private data before embedded controls of a widget
  2016-11-24  1:33 [PATCH 1/2] topology: Merge private data before embedded controls of a widget mengdong.lin
@ 2016-11-24 12:09 ` Liam Girdwood
  2016-11-24 13:25 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2016-11-24 12:09 UTC (permalink / raw)
  To: mengdong.lin; +Cc: tiwai, mengdong.lin, alsa-devel

On Thu, 2016-11-24 at 09:33 +0800, mengdong.lin@linux.intel.com wrote:
> From: Mengdong Lin <mengdong.lin@linux.intel.com>
> 
> 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>

Both 

Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] topology: Merge private data before embedded controls of a widget
  2016-11-24  1:33 [PATCH 1/2] topology: Merge private data before embedded controls of a widget mengdong.lin
  2016-11-24 12:09 ` Liam Girdwood
@ 2016-11-24 13:25 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2016-11-24 13:25 UTC (permalink / raw)
  To: mengdong.lin; +Cc: liam.r.girdwood, mengdong.lin, alsa-devel

On Thu, 24 Nov 2016 02:33:52 +0100,
mengdong.lin@linux.intel.com wrote:
> 
> From: Mengdong Lin <mengdong.lin@linux.intel.com>
> 
> 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>

Applied both patches with Liam's ack now.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-24 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24  1:33 [PATCH 1/2] topology: Merge private data before embedded controls of a widget mengdong.lin
2016-11-24 12:09 ` Liam Girdwood
2016-11-24 13:25 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.