[Sound-open-firmware] [PATCH 1/2] topology: add token for buffer type.

Keyon Jie yang.jie at linux.intel.com
Tue Jan 30 08:29:29 CET 2018


Add buffer token SOF_TKN_BUF_TYPE, for different buffer type.
Add a new W_BUFFER_DMA function which will allocate buffer with
DMA type.

Signed-off-by: Keyon Jie <yang.jie at linux.intel.com>
---
 topology/m4/local.m4   | 22 ++++++++++++++++++++++
 topology/sof/tokens.m4 |  1 +
 2 files changed, 23 insertions(+)

diff --git a/topology/m4/local.m4 b/topology/m4/local.m4
index ad72a11..974ae6c 100644
--- a/topology/m4/local.m4
+++ b/topology/m4/local.m4
@@ -52,6 +52,28 @@ define(`W_BUFFER',
 `	tokens "sof_buffer_tokens"'
 `	tuples."word" {'
 `		SOF_TKN_BUF_SIZE'	STR($2)
+`		SOF_TKN_BUF_TYPE'	STR(0)
+`	}'
+`}'
+`SectionData."'N_BUFFER($1)`_data" {'
+`	tuples "'N_BUFFER($1)`_tuples"'
+`}'
+`SectionWidget."'N_BUFFER($1)`" {'
+`	index "'PIPELINE_ID`"'
+`	type "buffer"'
+`	no_pm "true"'
+`	data ['
+`		"'N_BUFFER($1)`_data"'
+`	]'
+`}')
+
+dnl W_BUFFER_DMA(name, size)
+define(`W_BUFFER_DMA',
+`SectionVendorTuples."'N_BUFFER($1)`_tuples" {'
+`	tokens "sof_buffer_tokens"'
+`	tuples."word" {'
+`		SOF_TKN_BUF_SIZE'	STR($2)
+`		SOF_TKN_BUF_TYPE'	STR(1)
 `	}'
 `}'
 `SectionData."'N_BUFFER($1)`_data" {'
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4
index 704effc..4e7d04f 100644
--- a/topology/sof/tokens.m4
+++ b/topology/sof/tokens.m4
@@ -11,6 +11,7 @@
 
 SectionVendorTokens."sof_buffer_tokens" {
 	SOF_TKN_BUF_SIZE			"100"
+	SOF_TKN_BUF_TYPE			"101"
 }
 
 SectionVendorTokens."sof_dai_tokens" {
-- 
2.11.0



More information about the Sound-open-firmware mailing list