[Sound-open-firmware] [PATCH v2 5/5] topology: create m4 wrapper for Data section in pipeline definition
Ranjani Sridharan
ranjani.sridharan at linux.intel.com
Mon Mar 5 08:13:11 CET 2018
This patch adds a m4 wrapper for data section in pipeline definitions
Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
topology/dsps/bdw.m4 | 28 +++++++---------------------
topology/dsps/bxt.m4 | 28 +++++++---------------------
topology/dsps/byt.m4 | 28 +++++++---------------------
topology/dsps/cht.m4 | 28 +++++++---------------------
topology/dsps/hsw.m4 | 28 +++++++---------------------
topology/m4/local.m4 | 7 +++++++
topology/sof/pipe-pcm-media.m4 | 4 +---
topology/sof/pipe-src-capture.m4 | 4 +---
topology/sof/pipe-src-playback.m4 | 4 +---
9 files changed, 45 insertions(+), 114 deletions(-)
diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4
index ca8d712..faa42c4 100644
--- a/topology/dsps/bdw.m4
+++ b/topology/dsps/bdw.m4
@@ -5,48 +5,34 @@
# Low Latency PCM Configuration
W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "50000"'))
-SectionData."pipe_ll_schedule_plat" {
- tuples "pipe_ll_schedule_plat_tokens"
-}
+W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration
W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "100000"'))
-SectionData."pipe_media_schedule_plat" {
- tuples "pipe_media_schedule_plat_tokens"
-}
+W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens)
# Tone Signal Generator Configuration
W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "200000"'))
-SectionData."pipe_tone_schedule_plat" {
- tuples "pipe_tone_schedule_plat_tokens"
-}
+W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens)
# DAI0 platform playback configuration
W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "0"'))
-SectionData."dai0p_plat_conf" {
- tuples "dai0p_plat_tokens"
-}
+W_DATA(dai0p_plat_conf, dai0p_plat_tokens)
# DAI0 platform capture configuration
W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"'))
-SectionData."dai0c_plat_conf" {
- tuples "dai0c_plat_tokens"
-}
+W_DATA(dai0c_plat_conf, dai0c_plat_tokens)
# PCM platform configuration
W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN'))
-SectionData."pcm_plat_conf" {
- tuples "pcm_plat_tokens"
-}
+W_DATA(pcm_plat_conf, pcm_plat_tokens)
# DAI schedule Configuration - scheduled by IRQ
W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "5000"'))
-SectionData."pipe_dai_schedule_plat" {
- tuples "pipe_dai_schedule_plat_tokens"
-}
+W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens)
diff --git a/topology/dsps/bxt.m4 b/topology/dsps/bxt.m4
index 5ab353e..aa7f35b 100644
--- a/topology/dsps/bxt.m4
+++ b/topology/dsps/bxt.m4
@@ -5,48 +5,34 @@
# Low Latency PCM Configuration
W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "50000"'))
-SectionData."pipe_ll_schedule_plat" {
- tuples "pipe_ll_schedule_plat_tokens"
-}
+W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration
W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "100000"'))
-SectionData."pipe_media_schedule_plat" {
- tuples "pipe_media_schedule_plat_tokens"
-}
+W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens)
# Tone Signal Generator Configuration
W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "200000"'))
-SectionData."pipe_tone_schedule_plat" {
- tuples "pipe_tone_schedule_plat_tokens"
-}
+W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens)
# DAI0 platform playback configuration
W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "0"'))
-SectionData."dai0p_plat_conf" {
- tuples "dai0p_plat_tokens"
-}
+W_DATA(dai0p_plat_conf, dai0p_plat_tokens)
# DAI0 platform capture configuration
W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"'))
-SectionData."dai0c_plat_conf" {
- tuples "dai0c_plat_tokens"
-}
+W_DATA(dai0c_plat_conf, dai0c_plat_tokens)
# PCM platform configuration
W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN'))
-SectionData."pcm_plat_conf" {
- tuples "pcm_plat_tokens"
-}
+W_DATA(pcm_plat_conf, pcm_plat_tokens)
# DAI schedule Configuration - scheduled by IRQ
W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "5000"'))
-SectionData."pipe_dai_schedule_plat" {
- tuples "pipe_dai_schedule_plat_tokens"
-}
+W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens)
diff --git a/topology/dsps/byt.m4 b/topology/dsps/byt.m4
index 2091573..f87db61 100644
--- a/topology/dsps/byt.m4
+++ b/topology/dsps/byt.m4
@@ -5,48 +5,34 @@
# Low Latency PCM Configuration
W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "50000"'))
-SectionData."pipe_ll_schedule_plat" {
- tuples "pipe_ll_schedule_plat_tokens"
-}
+W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration
W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "100000"'))
-SectionData."pipe_media_schedule_plat" {
- tuples "pipe_media_schedule_plat_tokens"
-}
+W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens)
# Tone Signal Generator Configuration
W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "200000"'))
-SectionData."pipe_tone_schedule_plat" {
- tuples "pipe_tone_schedule_plat_tokens"
-}
+W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens)
# DAI0 platform playback configuration
W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "0"'))
-SectionData."dai0p_plat_conf" {
- tuples "dai0p_plat_tokens"
-}
+W_DATA(dai0p_plat_conf, dai0p_plat_tokens)
# DAI0 platform capture configuration
W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"'))
-SectionData."dai0c_plat_conf" {
- tuples "dai0c_plat_tokens"
-}
+W_DATA(dai0c_plat_conf, dai0c_plat_tokens)
# PCM platform configuration
W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN'))
-SectionData."pcm_plat_conf" {
- tuples "pcm_plat_tokens"
-}
+W_DATA(pcm_plat_conf, pcm_plat_tokens)
# DAI schedule Configuration - scheduled by IRQ
W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "5000"'))
-SectionData."pipe_dai_schedule_plat" {
- tuples "pipe_dai_schedule_plat_tokens"
-}
+W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens)
diff --git a/topology/dsps/cht.m4 b/topology/dsps/cht.m4
index 97bee2b..64a88bb 100644
--- a/topology/dsps/cht.m4
+++ b/topology/dsps/cht.m4
@@ -5,48 +5,34 @@
# Low Latency PCM Configuration
W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "50000"'))
-SectionData."pipe_ll_schedule_plat" {
- tuples "pipe_ll_schedule_plat_tokens"
-}
+W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration
W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "100000"'))
-SectionData."pipe_media_schedule_plat" {
- tuples "pipe_media_schedule_plat_tokens"
-}
+W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens)
# Tone Signal Generator Configuration
W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "200000"'))
-SectionData."pipe_tone_schedule_plat" {
- tuples "pipe_tone_schedule_plat_tokens"
-}
+W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens)
# DAI0 platform playback configuration
W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "0"'))
-SectionData."dai0p_plat_conf" {
- tuples "dai0p_plat_tokens"
-}
+W_DATA(dai0p_plat_conf, dai0p_plat_tokens)
# DAI0 platform capture configuration
W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"'))
-SectionData."dai0c_plat_conf" {
- tuples "dai0c_plat_tokens"
-}
+W_DATA(dai0c_plat_conf, dai0c_plat_tokens)
# PCM platform configuration
W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN'))
-SectionData."pcm_plat_conf" {
- tuples "pcm_plat_tokens"
-}
+W_DATA(pcm_plat_conf, pcm_plat_tokens)
# DAI schedule Configuration - scheduled by IRQ
W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "5000"'))
-SectionData."pipe_dai_schedule_plat" {
- tuples "pipe_dai_schedule_plat_tokens"
-}
+W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens)
diff --git a/topology/dsps/hsw.m4 b/topology/dsps/hsw.m4
index 9233e45..8edceab 100644
--- a/topology/dsps/hsw.m4
+++ b/topology/dsps/hsw.m4
@@ -5,48 +5,34 @@
# Low Latency PCM Configuration
W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "50000"'))
-SectionData."pipe_ll_schedule_plat" {
- tuples "pipe_ll_schedule_plat_tokens"
-}
+W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration
W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "100000"'))
-SectionData."pipe_media_schedule_plat" {
- tuples "pipe_media_schedule_plat_tokens"
-}
+W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens)
# Tone Signal Generator Configuration
W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "200000"'))
-SectionData."pipe_tone_schedule_plat" {
- tuples "pipe_tone_schedule_plat_tokens"
-}
+W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens)
# DAI0 platform playback configuration
W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "0"'))
-SectionData."dai0p_plat_conf" {
- tuples "dai0p_plat_tokens"
-}
+W_DATA(dai0p_plat_conf, dai0p_plat_tokens)
# DAI0 platform capture configuration
W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"'))
-SectionData."dai0c_plat_conf" {
- tuples "dai0c_plat_tokens"
-}
+W_DATA(dai0c_plat_conf, dai0c_plat_tokens)
# PCM platform configuration
W_VENDORTUPLES(pcm_plat_tokens, sof_dai_tokens, TUPLES(`SOF_TKN_DAI_DMAC PIPELINE_DMAC', `SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN'))
-SectionData."pcm_plat_conf" {
- tuples "pcm_plat_tokens"
-}
+W_DATA(pcm_plat_conf, pcm_plat_tokens)
# DAI schedule Configuration - scheduled by IRQ
W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, TUPLES(`SOF_TKN_SCHED_MIPS "5000"'))
-SectionData."pipe_dai_schedule_plat" {
- tuples "pipe_dai_schedule_plat_tokens"
-}
+W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4
index e48a9d5..c53ed15 100644
--- a/topology/m4/local.m4
+++ b/topology/m4/local.m4
@@ -641,6 +641,13 @@ define(`W_VENDORTUPLES',
` }'
`}')
+dnl W_DATA(name, tuples)
+define(`W_DATA',
+`SectionData.STR($1) {'
+` tuples STR($2)'
+`}')
+
+
divert(0) dnl
diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4
index 2bf2bd4..e679ffd 100644
--- a/topology/sof/pipe-pcm-media.m4
+++ b/topology/sof/pipe-pcm-media.m4
@@ -28,9 +28,7 @@ C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID,
W_VENDORTUPLES(media_src_tokens, sof_src_tokens, TUPLES(`SOF_TKN_SRC_RATE_OUT "48000"'))
-SectionData."media_src_conf" {
- tuples "media_src_tokens"
-}
+W_DATA(media_src_conf, media_src_tokens)
#
# Components and Buffers
diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4
index a58242d..ee25f0b 100644
--- a/topology/sof/pipe-src-capture.m4
+++ b/topology/sof/pipe-src-capture.m4
@@ -22,9 +22,7 @@ W_PCM_CAPTURE(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2)
W_VENDORTUPLES(media_src_tokens, sof_src_tokens, TUPLES(`SOF_TKN_SRC_RATE_OUT "48000"'))
-SectionData."media_src_conf" {
- tuples "media_src_tokens"
-}
+W_DATA(media_src_conf, media_src_tokens)
# "SRC" has 4 source and 4 sink periods
W_SRC(0, PIPELINE_FORMAT, 4, 4, media_src_conf, 2)
diff --git a/topology/sof/pipe-src-playback.m4 b/topology/sof/pipe-src-playback.m4
index 0fc7fcc..3a3cfaf 100644
--- a/topology/sof/pipe-src-playback.m4
+++ b/topology/sof/pipe-src-playback.m4
@@ -22,9 +22,7 @@ W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2)
W_VENDORTUPLES(media_src_tokens, sof_src_tokens, TUPLES(`SOF_TKN_SRC_RATE_OUT "48000"'))
-SectionData."media_src_conf" {
- tuples "media_src_tokens"
-}
+W_DATA(media_src_conf, media_src_tokens)
# "SRC" has 4 source and 4 sink periods
W_SRC(0, PIPELINE_FORMAT, 4, 4, media_src_conf, 2)
--
2.14.1
More information about the Sound-open-firmware
mailing list