[Sound-open-firmware] [PATCH v3 7/8] topology: create m4 wrapper for VendorTuples section in pipeline definition

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Mon Mar 5 21:40:23 CET 2018


This patch adds a m4 wrpper for Vendor Tuples sections
in pipeline definition

Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
 topology/dsps/bdw.m4              | 59 +++++---------------------------------
 topology/dsps/bxt.m4              | 59 +++++---------------------------------
 topology/dsps/byt.m4              | 59 +++++---------------------------------
 topology/dsps/cht.m4              | 59 +++++---------------------------------
 topology/dsps/cnl.m4              | 60 ++++++---------------------------------
 topology/dsps/hsw.m4              | 59 +++++---------------------------------
 topology/m4/local.m4              | 10 +++++++
 topology/sof/pipe-pcm-media.m4    |  8 +-----
 topology/sof/pipe-src-capture.m4  |  8 +-----
 topology/sof/pipe-src-playback.m4 |  8 +-----
 10 files changed, 56 insertions(+), 333 deletions(-)

diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4
index ad06362..7d57561 100644
--- a/topology/dsps/bdw.m4
+++ b/topology/dsps/bdw.m4
@@ -11,94 +11,49 @@ define(`PLATFORM_PASS_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE)
 define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
 
 # Low Latency PCM Configuration
-SectionVendorTuples."pipe_ll_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"50000"
-	}
-}
+W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"50000"'))
 
 SectionData."pipe_ll_schedule_plat" {
 	tuples "pipe_ll_schedule_plat_tokens"
 }
 
 # Media PCM Configuration
-SectionVendorTuples."pipe_media_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"100000"
-	}
-}
+W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"100000"'))
 
 SectionData."pipe_media_schedule_plat" {
 	tuples "pipe_media_schedule_plat_tokens"
 }
 
 # Tone Signal Generator Configuration
-SectionVendorTuples."pipe_tone_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"200000"
-	}
-}
+W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"200000"'))
 
 SectionData."pipe_tone_schedule_plat" {
 	tuples "pipe_tone_schedule_plat_tokens"
 }
 
 # DAI0 platform playback configuration
-SectionVendorTuples."dai0p_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"0"
-	}
-}
+W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC_CHAN	"0"'))
 
 SectionData."dai0p_plat_conf" {
 	tuples "dai0p_plat_tokens"
 }
 
 # DAI0 platform capture configuration
-SectionVendorTuples."dai0c_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"1"
-	}
-}
+W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC	"1"'))
 
 SectionData."dai0c_plat_conf" {
 	tuples "dai0c_plat_tokens"
 }
 
 # PCM platform configuration
-SectionVendorTuples."pcm_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	PIPELINE_DMAC
-		SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN
-	}
-}
+W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN'))
 
 SectionData."pcm_plat_conf" {
 	tuples "pcm_plat_tokens"
 }
 
 # DAI schedule Configuration - scheduled by IRQ
-SectionVendorTuples."pipe_dai_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"5000"
-	}
-}
+W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(`		', SOF_TKN_SCHED_MIPS	"5000"'))
 
 SectionData."pipe_dai_schedule_plat" {
 	tuples "pipe_dai_schedule_plat_tokens"
diff --git a/topology/dsps/bxt.m4 b/topology/dsps/bxt.m4
index 61bcb7e..3a975d1 100644
--- a/topology/dsps/bxt.m4
+++ b/topology/dsps/bxt.m4
@@ -14,94 +14,49 @@ define(`PLATFORM_PASS_MEM_CAP',
 define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
 
 # Low Latency PCM Configuration
-SectionVendorTuples."pipe_ll_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"50000"
-	}
-}
+W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"50000"'))
 
 SectionData."pipe_ll_schedule_plat" {
 	tuples "pipe_ll_schedule_plat_tokens"
 }
 
 # Media PCM Configuration
-SectionVendorTuples."pipe_media_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"100000"
-	}
-}
+W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"100000"'))
 
 SectionData."pipe_media_schedule_plat" {
 	tuples "pipe_media_schedule_plat_tokens"
 }
 
 # Tone Signal Generator Configuration
-SectionVendorTuples."pipe_tone_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"200000"
-	}
-}
+W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"200000"'))
 
 SectionData."pipe_tone_schedule_plat" {
 	tuples "pipe_tone_schedule_plat_tokens"
 }
 
 # DAI0 platform playback configuration
-SectionVendorTuples."dai0p_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"0"
-	}
-}
+W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC_CHAN	"0"'))
 
 SectionData."dai0p_plat_conf" {
 	tuples "dai0p_plat_tokens"
 }
 
 # DAI0 platform capture configuration
-SectionVendorTuples."dai0c_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"1"
-	}
-}
+W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC	"1"'))
 
 SectionData."dai0c_plat_conf" {
 	tuples "dai0c_plat_tokens"
 }
 
 # PCM platform configuration
-SectionVendorTuples."pcm_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	PIPELINE_DMAC
-		SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN
-	}
-}
+W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN'))
 
 SectionData."pcm_plat_conf" {
 	tuples "pcm_plat_tokens"
 }
 
 # DAI schedule Configuration - scheduled by IRQ
-SectionVendorTuples."pipe_dai_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"5000"
-	}
-}
+W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(`		', SOF_TKN_SCHED_MIPS	"5000"'))
 
 SectionData."pipe_dai_schedule_plat" {
 	tuples "pipe_dai_schedule_plat_tokens"
diff --git a/topology/dsps/byt.m4 b/topology/dsps/byt.m4
index 64cee72..490a6eb 100644
--- a/topology/dsps/byt.m4
+++ b/topology/dsps/byt.m4
@@ -11,94 +11,49 @@ define(`PLATFORM_PASS_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE)
 define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
 
 # Low Latency PCM Configuration
-SectionVendorTuples."pipe_ll_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"50000"
-	}
-}
+W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"50000"'))
 
 SectionData."pipe_ll_schedule_plat" {
 	tuples "pipe_ll_schedule_plat_tokens"
 }
 
 # Media PCM Configuration
-SectionVendorTuples."pipe_media_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"100000"
-	}
-}
+W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"100000"'))
 
 SectionData."pipe_media_schedule_plat" {
 	tuples "pipe_media_schedule_plat_tokens"
 }
 
 # Tone Signal Generator Configuration
-SectionVendorTuples."pipe_tone_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"200000"
-	}
-}
+W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"200000"'))
 
 SectionData."pipe_tone_schedule_plat" {
 	tuples "pipe_tone_schedule_plat_tokens"
 }
 
 # DAI0 platform playback configuration
-SectionVendorTuples."dai0p_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"0"
-	}
-}
+W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(`		', `SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC_CHAN	"0"'))
 
 SectionData."dai0p_plat_conf" {
 	tuples "dai0p_plat_tokens"
 }
 
 # DAI0 platform capture configuration
-SectionVendorTuples."dai0c_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"1"
-	}
-}
+W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(`		', `SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC	"1"'))
 
 SectionData."dai0c_plat_conf" {
 	tuples "dai0c_plat_tokens"
 }
 
 # PCM platform configuration
-SectionVendorTuples."pcm_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	PIPELINE_DMAC
-		SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN
-	}
-}
+W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, LIST(`		', `SOF_TKN_DAI_DMAC	PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN'))
 
 SectionData."pcm_plat_conf" {
 	tuples "pcm_plat_tokens"
 }
 
 # DAI schedule Configuration - scheduled by IRQ
-SectionVendorTuples."pipe_dai_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"5000"
-	}
-}
+W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"5000"'))
 
 SectionData."pipe_dai_schedule_plat" {
 	tuples "pipe_dai_schedule_plat_tokens"
diff --git a/topology/dsps/cht.m4 b/topology/dsps/cht.m4
index 1f461d9..9d9cc79 100644
--- a/topology/dsps/cht.m4
+++ b/topology/dsps/cht.m4
@@ -11,94 +11,49 @@ define(`PLATFORM_PASS_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE)
 define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
 
 # Low Latency PCM Configuration
-SectionVendorTuples."pipe_ll_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"50000"
-	}
-}
+W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"50000"'))
 
 SectionData."pipe_ll_schedule_plat" {
 	tuples "pipe_ll_schedule_plat_tokens"
 }
 
 # Media PCM Configuration
-SectionVendorTuples."pipe_media_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"100000"
-	}
-}
+W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"100000"'))
 
 SectionData."pipe_media_schedule_plat" {
 	tuples "pipe_media_schedule_plat_tokens"
 }
 
 # Tone Signal Generator Configuration
-SectionVendorTuples."pipe_tone_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"200000"
-	}
-}
+W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"200000"'))
 
 SectionData."pipe_tone_schedule_plat" {
 	tuples "pipe_tone_schedule_plat_tokens"
 }
 
 # DAI0 platform playback configuration
-SectionVendorTuples."dai0p_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"0"
-	}
-}
+W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC_CHAN	"0"'))
 
 SectionData."dai0p_plat_conf" {
 	tuples "dai0p_plat_tokens"
 }
 
 # DAI0 platform capture configuration
-SectionVendorTuples."dai0c_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"1"
-	}
-}
+W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC	"1"'))
 
 SectionData."dai0c_plat_conf" {
 	tuples "dai0c_plat_tokens"
 }
 
 # PCM platform configuration
-SectionVendorTuples."pcm_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	PIPELINE_DMAC
-		SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN
-	}
-}
+W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN'))
 
 SectionData."pcm_plat_conf" {
 	tuples "pcm_plat_tokens"
 }
 
 # DAI schedule Configuration - scheduled by IRQ
-SectionVendorTuples."pipe_dai_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"5000"
-	}
-}
+W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(`		', SOF_TKN_SCHED_MIPS	"5000"'))
 
 SectionData."pipe_dai_schedule_plat" {
 	tuples "pipe_dai_schedule_plat_tokens"
diff --git a/topology/dsps/cnl.m4 b/topology/dsps/cnl.m4
index 547c689..0257ee5 100644
--- a/topology/dsps/cnl.m4
+++ b/topology/dsps/cnl.m4
@@ -14,94 +14,50 @@ define(`PLATFORM_PASS_MEM_CAP',
 define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
 
 # Low Latency PCM Configuration
-SectionVendorTuples."pipe_ll_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"50000"
-	}
-}
+# Low Latency PCM Configuration
+W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"50000"'))
 
 SectionData."pipe_ll_schedule_plat" {
 	tuples "pipe_ll_schedule_plat_tokens"
 }
 
 # Media PCM Configuration
-SectionVendorTuples."pipe_media_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"100000"
-	}
-}
+W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"100000"'))
 
 SectionData."pipe_media_schedule_plat" {
 	tuples "pipe_media_schedule_plat_tokens"
 }
 
 # Tone Signal Generator Configuration
-SectionVendorTuples."pipe_tone_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"200000"
-	}
-}
+W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"200000"'))
 
 SectionData."pipe_tone_schedule_plat" {
 	tuples "pipe_tone_schedule_plat_tokens"
 }
 
 # DAI0 platform playback configuration
-SectionVendorTuples."dai0p_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"0"
-	}
-}
+W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC_CHAN	"0"'))
 
 SectionData."dai0p_plat_conf" {
 	tuples "dai0p_plat_tokens"
 }
 
 # DAI0 platform capture configuration
-SectionVendorTuples."dai0c_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"1"
-	}
-}
+W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC	"1"'))
 
 SectionData."dai0c_plat_conf" {
 	tuples "dai0c_plat_tokens"
 }
 
 # PCM platform configuration
-SectionVendorTuples."pcm_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	PIPELINE_DMAC
-		SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN
-	}
-}
+W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN'))
 
 SectionData."pcm_plat_conf" {
 	tuples "pcm_plat_tokens"
 }
 
 # DAI schedule Configuration - scheduled by IRQ
-SectionVendorTuples."pipe_dai_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"5000"
-	}
-}
+W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(`		', SOF_TKN_SCHED_MIPS	"5000"'))
 
 SectionData."pipe_dai_schedule_plat" {
 	tuples "pipe_dai_schedule_plat_tokens"
diff --git a/topology/dsps/hsw.m4 b/topology/dsps/hsw.m4
index 074542a..494d8d2 100644
--- a/topology/dsps/hsw.m4
+++ b/topology/dsps/hsw.m4
@@ -11,94 +11,49 @@ define(`PLATFORM_PASS_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE)
 define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
 
 # Low Latency PCM Configuration
-SectionVendorTuples."pipe_ll_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"50000"
-	}
-}
+W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"50000"'))
 
 SectionData."pipe_ll_schedule_plat" {
 	tuples "pipe_ll_schedule_plat_tokens"
 }
 
 # Media PCM Configuration
-SectionVendorTuples."pipe_media_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"100000"
-	}
-}
+W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"100000"'))
 
 SectionData."pipe_media_schedule_plat" {
 	tuples "pipe_media_schedule_plat_tokens"
 }
 
 # Tone Signal Generator Configuration
-SectionVendorTuples."pipe_tone_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"200000"
-	}
-}
+W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(`		', `SOF_TKN_SCHED_MIPS	"200000"'))
 
 SectionData."pipe_tone_schedule_plat" {
 	tuples "pipe_tone_schedule_plat_tokens"
 }
 
 # DAI0 platform playback configuration
-SectionVendorTuples."dai0p_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"0"
-	}
-}
+W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC_CHAN	"0"'))
 
 SectionData."dai0p_plat_conf" {
 	tuples "dai0p_plat_tokens"
 }
 
 # DAI0 platform capture configuration
-SectionVendorTuples."dai0c_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	"1"
-		SOF_TKN_DAI_DMAC_CHAN	"1"
-	}
-}
+W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	"1"', `SOF_TKN_DAI_DMAC	"1"'))
 
 SectionData."dai0c_plat_conf" {
 	tuples "dai0c_plat_tokens"
 }
 
 # PCM platform configuration
-SectionVendorTuples."pcm_plat_tokens" {
-	tokens "sof_dai_tokens"
-
-	tuples."word" {
-		SOF_TKN_DAI_DMAC	PIPELINE_DMAC
-		SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN
-	}
-}
+W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, LIST(`		', SOF_TKN_DAI_DMAC	PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN	PIPELINE_DMAC_CHAN'))
 
 SectionData."pcm_plat_conf" {
 	tuples "pcm_plat_tokens"
 }
 
 # DAI schedule Configuration - scheduled by IRQ
-SectionVendorTuples."pipe_dai_schedule_plat_tokens" {
-	tokens "sof_sched_tokens"
-
-	tuples."word" {
-		SOF_TKN_SCHED_MIPS	"5000"
-	}
-}
+W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(`		', SOF_TKN_SCHED_MIPS	"5000"'))
 
 SectionData."pipe_dai_schedule_plat" {
 	tuples "pipe_dai_schedule_plat_tokens"
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4
index 90d690e..b951d01 100644
--- a/topology/m4/local.m4
+++ b/topology/m4/local.m4
@@ -632,6 +632,16 @@ define(`PCM_CAPABILITIES',
 `	buffer_size_max	STR($12)'
 `}')
 
+dnl W_VENDORTUPLES(name, tokens, RATE_OUT)
+define(`W_VENDORTUPLES',
+`SectionVendorTuples.STR($1) {'
+`	tokens STR($2)'
+`'
+`	tuples."word" {'
+`		$3'
+`	}'
+`}')
+
 divert(0) dnl
 
 
diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4
index 1171d07..2c59f7a 100644
--- a/topology/sof/pipe-pcm-media.m4
+++ b/topology/sof/pipe-pcm-media.m4
@@ -26,13 +26,7 @@ C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID,
 # SRC Configuration
 #
 
-SectionVendorTuples."media_src_tokens" {
-	tokens "sof_src_tokens"
-
-	tuples."word" {
-		SOF_TKN_SRC_RATE_OUT	"48000"
-	}
-}
+W_VENDORTUPLES(media_src_tokens, sof_src_tokens, LIST(`		', `SOF_TKN_SRC_RATE_OUT	"48000"'))
 
 SectionData."media_src_conf" {
 	tuples "media_src_tokens"
diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4
index d8e04a8..d09c5ac 100644
--- a/topology/sof/pipe-src-capture.m4
+++ b/topology/sof/pipe-src-capture.m4
@@ -20,13 +20,7 @@ W_PCM_CAPTURE(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2)
 # SRC Configuration
 #
 
-SectionVendorTuples."media_src_tokens" {
-	tokens "sof_src_tokens"
-
-	tuples."word" {
-		SOF_TKN_SRC_RATE_OUT	"48000"
-	}
-}
+W_VENDORTUPLES(media_src_tokens, sof_src_tokens, LIST(`		', `SOF_TKN_SRC_RATE_OUT	"48000"'))
 
 SectionData."media_src_conf" {
 	tuples "media_src_tokens"
diff --git a/topology/sof/pipe-src-playback.m4 b/topology/sof/pipe-src-playback.m4
index c9b4159..e93cd64 100644
--- a/topology/sof/pipe-src-playback.m4
+++ b/topology/sof/pipe-src-playback.m4
@@ -20,13 +20,7 @@ W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2)
 # SRC Configuration
 #
 
-SectionVendorTuples."media_src_tokens" {
-	tokens "sof_src_tokens"
-
-	tuples."word" {
-		SOF_TKN_SRC_RATE_OUT	"48000"
-	}
-}
+W_VENDORTUPLES(media_src_tokens, sof_src_tokens, LIST(`		', `SOF_TKN_SRC_RATE_OUT	"48000"'))
 
 SectionData."media_src_conf" {
 	tuples "media_src_tokens"
-- 
2.14.1



More information about the Sound-open-firmware mailing list