[Sound-open-firmware] [PATCH v3 1/8] topology: make list loop more generic with formatting argument
This patch adds changes to make list loop more generic with format argument
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/local.m4 | 13 ++++++++----- topology/sof/pipe-low-latency-capture.m4 | 2 +- topology/sof/pipe-low-latency-playback.m4 | 4 ++-- topology/sof/pipe-pcm-media.m4 | 2 +- topology/sof/pipe-tone.m4 | 3 ++- topology/sof/pipe-volume-capture.m4 | 2 +- topology/sof/pipe-volume-playback.m4 | 2 +- 7 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 31221f3..1ebe19d 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -10,16 +10,16 @@ define(`argn', `ifelse(`$1', 1, ``$2'',
dnl Defines a list of items from a variable number of params. dnl Use as last argument in a macro. +dnl The first argument specifies the number of tabs to be added for formatting define(`LIST_LOOP', `argn(j,$@) - ifelse(i,`1', `', `define(`i', decr(i)) define(`j', incr(j)) $0($@)')') +$1ifelse(i,`2', `', `define(`i', decr(i))define(`j', incr(j))$0($@)')') + +define(`LIST', `pushdef(`i', $#)pushdef(`j', `2')LIST_LOOP($@)popdef(i)popdef(j)')
dnl Sums a list of variable arguments. Use as last argument in macro. define(`SUM_LOOP', `eval(argn(j,$@) ifelse(i,`1', `', `define(`i', decr(i)) define(`j', incr(j)) + $0($@)'))')
-dnl Support a varaible list of kcontrols. -define(`KCONTROLS', `pushdef(`i', $#) pushdef(`j', `1') LIST_LOOP($@)') - dnl Memory capabilities define(`MEMCAPS', `pushdef(`i', $#) pushdef(`j', `1') SUM_LOOP($@)')
@@ -165,7 +165,7 @@ define(`N_PGA', `PGA'PIPELINE_ID`.'$1)
dnl W_PGA(name, format, periods_sink, periods_source, preload, kcontrol0. kcontrol1...etc) define(`W_PGA', -`pushdef(`args',`eval($#-6)')SectionVendorTuples."'N_PGA($1)`_tuples_w" {' +`SectionVendorTuples."'N_PGA($1)`_tuples_w" {' ` tokens "sof_comp_tokens"' ` tuples."word" {' ` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) @@ -270,6 +270,9 @@ define(`W_TONE', ` "'N_TONE($1)`_data_w"' ` "'N_TONE($1)`_data_str"' ` ]' +` mixer [' + $6 +` ]' `}')
dnl DAI name) diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 41fc622..6bb1a3d 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -48,7 +48,7 @@ SectionControlMixer.STR(PCM PCM_ID Capture Volume) { W_PCM_CAPTURE(Low Latency Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 0)
# "Capture Volume" has 2 sink and source periods for host and DAI ping-pong -W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, KCONTROLS("PCM PCM_ID Capture Volume")) +W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, LIST(` ', "PCM PCM_ID Capture Volume"))
# Capture Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index 37f8be2..64761a9 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -91,10 +91,10 @@ SectionControlMixer.STR(Master Playback Volume) { W_PCM_PLAYBACK(Low Latency Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
# "Playback Volume" has 1 sink period and 2 source periods for host ping-pong -W_PGA(0, PIPELINE_FORMAT, 1, 2, 1, KCONTROLS("PCM PCM_ID Playback Volume")) +W_PGA(0, PIPELINE_FORMAT, 1, 2, 1, LIST(` ', "PCM PCM_ID Playback Volume"))
# "Master Playback Volume" has 1 source and 2 sink periods for DAI ping-pong -W_PGA(1, PIPELINE_FORMAT, 2, 1, 1, KCONTROLS("Master Playback Volume")) +W_PGA(1, PIPELINE_FORMAT, 2, 1, 1, LIST(` ', "Master Playback Volume"))
# Mixer 0 has 1 sink and source periods. W_MIXER(0, PIPELINE_FORMAT, 1, 1, 1) diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index 1766aca..c1cff33 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -68,7 +68,7 @@ SectionData."media_src_conf" { W_PCM_PLAYBACK(Media Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
# "Playback Volume" has 2 sink period and 2 source periods for host ping-pong -W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, KCONTROLS("PCM PCM_ID Playback Volume")) +W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "PCM PCM_ID Playback Volume"))
# "SRC 0" has 2 sink and source periods. W_SRC(0, PIPELINE_FORMAT, 2, 2, media_src_conf, 2) diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index a8064ab..f53f77f 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -32,6 +32,7 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) { # control uses bespoke driver get/put/info ID 0 ops."ctl" { info "volsw" + # 256 binds the mixer control to volume get/put handlers get "256" put "256" } @@ -50,7 +51,7 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) { W_TONE(0, PIPELINE_FORMAT, 2, 0, 0)
# "Tone Volume" has 2 sink period and 2 source periods -W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, KCONTROLS("Tone Volume PIPELINE_ID")) +W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, LIST(` ', "Tone Volume PIPELINE_ID"))
# Low Latency Buffers W_BUFFER(0,COMP_BUFFER_SIZE(2, diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4 index 2fd6b98..56494b4 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -47,7 +47,7 @@ SectionControlMixer.STR(Master Capture Volume) { W_PCM_CAPTURE(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 2)
# "Volume" has 2 source and 2 sink periods -W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, KCONTROLS("Master Capture Volume")) +W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Capture Volume"))
# Capture Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 9431177..24ae45c 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -73,7 +73,7 @@ SectionControlMixer.STR(Master Playback Volume Switch) { W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
# "Volume" has 2 source and 2 sink periods -W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, KCONTROLS("Master Playback Volume Switch", "Master Playback Volume")) +W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Playback Volume Switch", "Master Playback Volume"))
# Playback Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2,
This patch adds the changes to add kcontrols to the tone component
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/local.m4 | 2 +- topology/sof/pipe-tone.m4 | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 1ebe19d..b2d4f28 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -240,7 +240,7 @@ define(`W_MIXER', dnl Tone name) define(`N_TONE', `TONE'PIPELINE_ID`.'$1)
-dnl W_TONE(name, format, periods_sink, periods_source, preload) +dnl W_TONE(name, format, periods_sink, periods_source, preload, kcontrols_list) define(`W_TONE', `SectionVendorTuples."'N_TONE($1)`_tuples_w" {' ` tokens "sof_comp_tokens"' diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index f53f77f..50a1050 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -43,12 +43,40 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) { tlv "vtlv_m90s3" }
+SectionControlMixer.STR(Tone Switch PIPELINE_ID) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "2" + shift "0" + } + channel."FR" { + reg "2" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + # 256 binds the mixer control to volume get/put handlers + get "256" + put "256" + } + + # max 1 indicates switch type mixer control + max "1" + invert "false" +} + # # Components and Buffers #
# "Tone 0" has 2 sink period and 0 source periods -W_TONE(0, PIPELINE_FORMAT, 2, 0, 0) +W_TONE(0, PIPELINE_FORMAT, 2, 0, 0, LIST(` ', "Tone Switch PIPELINE_ID"))
# "Tone Volume" has 2 sink period and 2 source periods W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, LIST(` ', "Tone Volume PIPELINE_ID"))
This patch adds changes to create a test hostless tone pipeline.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/test/test-tone-playback-ssp.m4 | 62 +++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 38 +++++++++++++++++++- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-tone-playback-ssp.m4
diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback-ssp.m4 new file mode 100644 index 0000000..2fe6693 --- /dev/null +++ b/topology/test/test-tone-playback-ssp.m4 @@ -0,0 +1,62 @@ +# +# Topology for Tone Generator Playback +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP MCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# + +# +# Define the pipeline +# +# Tone --B0--> volume --B1--> SSP2 +# + +# Tone Playback pipeline 5 using max 2 channels of TEST_PIPE_FORMAT. +# Schedule with 48 frame per 1000us deadline on core 0 with priority 0 +PIPELINE_ADD(sof/pipe-tone.m4, + 5, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0) + +# playback DAI is SSP2 using 2 periods +# Buffers use TEST_SSP_FORMAT format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 5, SSP, TEST_SSP_PORT, + PIPELINE_SOURCE_5, 2, TEST_SSP_FORMAT, + 48, 1000, 2, 0) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, TEST_SSP_MCLK, slave), + DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 9022d1c..eaa6f8b 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -13,6 +13,8 @@ M4_FLAGS="-I ../ -I ../m4 -I ../common" # Simple component test cases # can be used on components with 1 sink and 1 source. SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) +TONE_TEST=test-tone-playback-ssp +
# process m4 simple tests - # simple_test(name, pipe_name, be_name, format, dai_id, dai_format, dai_phy_bits, dai_data_bits dai_bclk) @@ -23,7 +25,7 @@ SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) # 5) dai_id - SSP port number # 6) dai_format - SSP sample format # 7) dai_phy_bits - SSP physical number of BLKCs per slot/channel -# 8) dai_data_bits - SSP number of valid daat bits per slot/channel +# 8) dai_data_bits - SSP number of valid data bits per slot/channel # 9) dai_bclk - SSP BCLK in HZ # 10) dai_mclk - SSP MCLK in HZ # @@ -48,6 +50,37 @@ function simple_test { done }
+# process m4 tone test - +# tone_test(name, pipe_name, be_name, format, dai_id, dai_format, dai_phy_bits, dai_data_bits dai_bclk) +# 1) name - test filename suffix +# 2) pipe_name - test component pipeline filename in sof/ +# 3) be_name - BE DAI link name in machine driver, used for matching +# 4) format - PCM sample format +# 5) dai_id - SSP port number +# 6) dai_format - SSP sample format +# 7) dai_phy_bits - SSP physical number of BLKCs per slot/channel +# 8) dai_data_bits - SSP number of valid data bits per slot/channel +# 9) dai_bclk - SSP BCLK in HZ +# 10) dai_mclk - SSP MCLK in HZ +# +function tone_test { + TFILE="$TONE_TEST$5-$2-$4-$6-48k-$1" + echo "M4 pre-processing test $TONE_TEST -> ${TFILE}" + m4 ${M4_FLAGS} \ + -DTEST_PIPE_NAME="$2" \ + -DTEST_DAI_LINK_NAME="$3" \ + -DTEST_SSP_PORT=$5 \ + -DTEST_SSP_FORMAT=$6 \ + -DTEST_PIPE_FORMAT=$4 \ + -DTEST_SSP_BCLK=$9 \ + -DTEST_SSP_MCLK=${10} \ + -DTEST_SSP_PHY_BITS=$7 \ + -DTEST_SSP_DATA_BITS=$8 \ + $TONE_TEST.m4 > ${TFILE}.conf + echo "Compiling test $TONE_TEST -> ${TFILE}.tplg" + alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg +} + # Pre-process the simple tests simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 19200000 simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 19200000 @@ -74,4 +107,7 @@ simple_test baytrail src "Baytrail Audio" s24le 2 s24le 25 24 2400000 19200000 simple_test nocodec volume "NoCodec" s16le 4 s16le 16 16 1536000 24576000 simple_test codec volume "SSP4-Codec" s16le 4 s16le 16 16 1536000 24576000
+# Tone test: Tone component only supports s32le currently +tone_test codec tone "SSP2-Codec" s32le 2 s16le 20 16 1920000 19200000 +
This patch adds m4 wrapper for mixercontrol section in pipeline definition
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/local.m4 | 45 +++++++++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 36 ++++----------- topology/sof/pipe-low-latency-playback.m4 | 73 +++++++------------------------ topology/sof/pipe-pcm-media.m4 | 37 ++++------------ topology/sof/pipe-tone.m4 | 73 +++++++------------------------ topology/sof/pipe-volume-capture.m4 | 35 ++++----------- topology/sof/pipe-volume-playback.m4 | 70 +++++++---------------------- 7 files changed, 120 insertions(+), 249 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index b2d4f28..535bb66 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -562,4 +562,49 @@ define(`PCM_DUPLEX_ADD', ` }' `}')
+dnl KCONTROL_CHANNEL(name, reg, shift) +define(`KCONTROL_CHANNEL', +`channel.STR($1) {' +` reg STR($2)' +` shift STR($3)' +` }') + +dnl CONTROLMIXER_MAX(comment, value) +define(`CONTROLMIXER_MAX', +`#$1' +` max STR($2)') + +dnl CONTROLMIXER_TLV(comment, value) +define(`CONTROLMIXER_TLV', +`#$1' +` tlv STR($2)') + +dnl CONTROLMIXER_OPS(info, comment, get, put) +define(`CONTROLMIXER_OPS', +`ops."ctl" {' +` info STR($1)' +` #$2' +` get STR($3)' +` put STR($4)' +` }') + +dnl C_CONTROLMIXER(name, index, ops, max, invert, tlv, KCONTROL_CHANNELS) +define(`C_CONTROLMIXER', +`SectionControlMixer.STR($1) {' +`' +` # control belongs to this index group' +` index STR($2)' +`' +` #$7' +` $8' +` # control uses bespoke driver get/put/info ID' +` $3' +`' +` $4' +` invert STR($5)' +` $6' +`}') + divert(0) dnl + + diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 6bb1a3d..057312d 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -10,34 +10,14 @@ include(`local.m4') # # Controls # - -SectionControlMixer.STR(PCM PCM_ID Capture Volume) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "0" - shift "0" - } - channel."FR" { - reg "0" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # TLV 40 steps from -90dB to +20dB for 3dB - max "40" - invert "false" - tlv "vtlv_m90s3" -} +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(PCM PCM_ID Capture Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 40), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 0, 0), KCONTROL_CHANNEL(FR, 0, 1)))
# # Components and Buffers diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index 64761a9..f434ce1 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -25,62 +25,23 @@ include(`local.m4') # # Controls # - -SectionControlMixer.STR(PCM PCM_ID Playback Volume) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "0" - shift "0" - } - channel."FR" { - reg "0" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # TLV 32 steps from -90dB to +6dB for 3dB - max "32" - invert "false" - tlv "vtlv_m90s3" -} - -SectionControlMixer.STR(Master Playback Volume) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "1" - shift "0" - } - channel."FR" { - reg "1" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # TLV 32 steps from -90dB to +6dB for 3dB - max "32" - invert "false" - tlv "vtlv_m90s3" -} +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 32), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(KCONTROL_CHANNEL(FL, 0, 0), KCONTROL_CHANNEL(FR, 0, 1))) + +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 32), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
# # Components and Buffers diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index c1cff33..e8c8158 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -13,35 +13,14 @@ include(`local.m4') # # Controls # - -SectionControlMixer.STR(PCM PCM_ID Playback Volume) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "1" - shift "0" - } - channel."FR" { - reg "1" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # TLV 32 steps from -90dB to +6dB for 3dB - max "32" - invert "false" - tlv "vtlv_m90s3" -} - +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 32), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
# # SRC Configuration diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 50a1050..507aeac 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -14,62 +14,23 @@ include(`local.m4') # Controls #
-SectionControlMixer.STR(Tone Volume PIPELINE_ID) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "1" - shift "0" - } - channel."FR" { - reg "1" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - # 256 binds the mixer control to volume get/put handlers - get "256" - put "256" - } - - # TLV 32 steps from -90dB to +6dB for 3dB - max "32" - invert "false" - tlv "vtlv_m90s3" -} - -SectionControlMixer.STR(Tone Switch PIPELINE_ID) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "2" - shift "0" - } - channel."FR" { - reg "2" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - # 256 binds the mixer control to volume get/put handlers - get "256" - put "256" - } - - # max 1 indicates switch type mixer control - max "1" - invert "false" -} +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(Tone Volume PIPELINE_ID, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 32), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1))) + +# Switch type Mixer Control with max value of 1 +C_CONTROLMIXER(Tone Switch PIPELINE_ID, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(max 1 indicates switch type control, 1), + false, + , + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)))
# # Components and Buffers diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4 index 56494b4..56aed26 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -10,33 +10,14 @@ include(`local.m4') # # Controls # -SectionControlMixer.STR(Master Capture Volume) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "1" - shift "0" - } - channel."FR" { - reg "1" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # TLV 32 steps from -90dB to +6dB for 3dB - max "32" - invert "false" - tlv "vtlv_m90s3" -} +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 32), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
# # Components and Buffers diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 24ae45c..22de572 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -10,60 +10,24 @@ include(`local.m4') # # Controls # -SectionControlMixer.STR(Master Playback Volume) { +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 32), + false, + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1))) + +# Volume Mixer Switch control with max value of 1 +C_CONTROLMIXER(Master Playback Volume Switch, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(max value 1 indicates switch type control, 1), + false, + , + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
- # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "1" - shift "0" - } - channel."FR" { - reg "1" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # TLV 32 steps from -90dB to +6dB for 3dB - max "32" - invert "false" - tlv "vtlv_m90s3" -} - -SectionControlMixer.STR(Master Playback Volume Switch) { - - # control belongs to this index group - index STR(PIPELINE_ID) - - # Channel register and shift for Front Left/Right - channel."FL" { - reg "1" - shift "0" - } - channel."FR" { - reg "1" - shift "1" - } - - # control uses bespoke driver get/put/info ID 0 - ops."ctl" { - info "volsw" - get "256" - put "256" - } - - # Volume mute on/off - max "1" - invert "false" -} # # Components and Buffers #
This patch adds a m4 wrpper for Graph sections in pipeline definition
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/local.m4 | 11 +++++++++++ topology/sof/pipe-dai-capture.m4 | 9 ++------- topology/sof/pipe-dai-playback.m4 | 9 ++------- topology/sof/pipe-low-latency-capture.m4 | 16 ++++++---------- topology/sof/pipe-low-latency-playback.m4 | 24 ++++++++++-------------- topology/sof/pipe-passthrough-capture.m4 | 12 ++++-------- topology/sof/pipe-passthrough-playback.m4 | 12 ++++-------- topology/sof/pipe-pcm-media.m4 | 20 ++++++++------------ topology/sof/pipe-src-capture.m4 | 16 ++++++---------- topology/sof/pipe-src-playback.m4 | 16 ++++++---------- topology/sof/pipe-tone.m4 | 14 +++++--------- topology/sof/pipe-volume-capture.m4 | 16 ++++++---------- topology/sof/pipe-volume-playback.m4 | 16 ++++++---------- 13 files changed, 76 insertions(+), 115 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 535bb66..690f677 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -605,6 +605,17 @@ define(`C_CONTROLMIXER', ` $6' `}')
+dnl P_GRAPH(name, CONNECTIONS) +define(`P_GRAPH', +`SectionGraph.STR($1) {' +` index STR($2)' +`' +` lines [' +` $3' +` ]' +`}') + + divert(0) dnl
diff --git a/topology/sof/pipe-dai-capture.m4 b/topology/sof/pipe-dai-capture.m4 index e69991e..3699138 100644 --- a/topology/sof/pipe-dai-capture.m4 +++ b/topology/sof/pipe-dai-capture.m4 @@ -16,10 +16,5 @@ W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE # # Graph connections to pipelines
-SectionGraph.STR(DAI_NAME) { - index STR(PIPELINE_ID) - - lines [ - dapm(DAI_BUF, N_DAI_IN) - ] -} +P_GRAPH(DAI_NAME, PIPELINE_ID, + LIST(` ', `dapm(DAI_BUF, N_DAI_IN)')) diff --git a/topology/sof/pipe-dai-playback.m4 b/topology/sof/pipe-dai-playback.m4 index 3a7a158..d35d3b1 100644 --- a/topology/sof/pipe-dai-playback.m4 +++ b/topology/sof/pipe-dai-playback.m4 @@ -16,10 +16,5 @@ W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCH # # Graph connections to pipelines
-SectionGraph.STR(DAI_NAME) { - index STR(PIPELINE_ID) - - lines [ - dapm(N_DAI_OUT, DAI_BUF) - ] -} +P_GRAPH(DAI_NAME, PIPELINE_ID, + LIST(` ', `dapm(N_DAI_OUT, DAI_BUF)')) diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 057312d..07b59ad 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -43,16 +43,12 @@ W_BUFFER(1, COMP_BUFFER_SIZE(2, # # host PCM <--B1-- volume <--B0-- source DAI0
-SectionGraph."pipe-ll-capture-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(Low Latency Capture PCM_ID, N_PCMC) - dapm(N_PCMC, N_BUFFER(1)) - dapm(N_BUFFER(1), N_PGA(0)) - dapm(N_PGA(0), N_BUFFER(0)) - ] -} +P_GRAPH(pipe-ll-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(Low Latency Capture PCM_ID, N_PCMC)', + `dapm(N_PCMC, N_BUFFER(1))', + `dapm(N_BUFFER(1), N_PGA(0))', + `dapm(N_PGA(0), N_BUFFER(0))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index f434ce1..7c39f16 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -86,20 +86,16 @@ W_BUFFER(3, COMP_BUFFER_SIZE(2, # pipeline n+3 >---+ .....etc....more pipes can be mixed here #
-SectionGraph."pipe-ll-playback-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(N_PCMP, Low Latency Playback PCM_ID) - dapm(N_BUFFER(0), N_PCMP) - dapm(N_PGA(0), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(0)) - dapm(N_MIXER(0), N_BUFFER(1)) - dapm(N_BUFFER(2), N_MIXER(0)) - dapm(N_PGA(1), N_BUFFER(2)) - dapm(N_BUFFER(3), N_PGA(1)) - ] -} +P_GRAPH(pipe-ll-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMP, Low Latency Playback PCM_ID)', + `dapm(N_BUFFER(0), N_PCMP)', + `dapm(N_PGA(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_PGA(0))', + `dapm(N_MIXER(0), N_BUFFER(1))', + `dapm(N_BUFFER(2), N_MIXER(0))', + `dapm(N_PGA(1), N_BUFFER(2))', + `dapm(N_BUFFER(3), N_PGA(1))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 index b0dfe48..8ef8a81 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -36,14 +36,10 @@ W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE # # host PCM_C <-- B0 <-- sink DAI0
-SectionGraph."pipe-pass-capture-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(Passthrough Capture PCM_ID, N_PCMC) - dapm(N_PCMC, N_BUFFER(0)) - ] -} +P_GRAPH(pipe-pass-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(Passthrough Capture PCM_ID, N_PCMC)', + `dapm(N_PCMC, N_BUFFER(0))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index b86f1b3..a26b5eb 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -36,14 +36,10 @@ W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCH # # host PCM_P --> B0 --> sink DAI0
-SectionGraph."pipe-pass-playback-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(N_PCMP, Passthrough Playback PCM_ID) - dapm(N_BUFFER(0), N_PCMP) - ] -} +P_GRAPH(pipe-pass-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMP, Passthrough Playback PCM_ID)', + `dapm(N_BUFFER(0), N_PCMP)'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index e8c8158..8cb8ed5 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -71,18 +71,14 @@ W_BUFFER(2, COMP_BUFFER_SIZE(3, # PCM --B0--> volume --B1--> SRC --> B2 --> Endpoint Pipeline #
-SectionGraph."pipe-media-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(N_PCMP, Media Playback PCM_ID) - dapm(N_BUFFER(0), N_PCMP) - dapm(N_PGA(0), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(0)) - dapm(N_SRC(0), N_BUFFER(1)) - dapm(N_BUFFER(2), N_SRC(0)) - ] -} +P_GRAPH(pipe-media-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMP, Media Playback PCM_ID)', + `dapm(N_BUFFER(0), N_PCMP)', + `dapm(N_PGA(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_PGA(0))', + `dapm(N_SRC(0), N_BUFFER(1))' + `dapm(N_BUFFER(2), N_SRC(0))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4 index 96d7ee7..44bb030 100644 --- a/topology/sof/pipe-src-capture.m4 +++ b/topology/sof/pipe-src-capture.m4 @@ -60,16 +60,12 @@ W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, # # host PCM_P <-- B0 <-- SRC 0 <-- B1 <-- sink DAI0
-SectionGraph."pipe-pass-src-capture-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(Passthrough Capture PCM_ID, N_PCMC) - dapm(N_PCMC, N_BUFFER(0)) - dapm(N_BUFFER(0), N_SRC(0)) - dapm(N_SRC(0), N_BUFFER(1)) - ] -} +P_GRAPH(pipe-pass-src-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(Passthrough Capture PCM_ID, N_PCMC)', + `dapm(N_PCMC, N_BUFFER(0))', + `dapm(N_BUFFER(0), N_SRC(0))', + `dapm(N_SRC(0), N_BUFFER(1))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-src-playback.m4 b/topology/sof/pipe-src-playback.m4 index a6141c9..d34bc8a 100644 --- a/topology/sof/pipe-src-playback.m4 +++ b/topology/sof/pipe-src-playback.m4 @@ -60,16 +60,12 @@ W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, # # host PCM_P --> B0 --> SRC 0 --> B1 --> sink DAI0
-SectionGraph."pipe-pass-src-playback-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(N_PCMP, Passthrough Playback PCM_ID) - dapm(N_BUFFER(0), N_PCMP) - dapm(N_SRC(0), N_BUFFER(0)) - dapm(N_BUFFER(1), N_SRC(0)) - ] -} +P_GRAPH(pipe-pass-src-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMP, Passthrough Playback PCM_ID)', + `dapm(N_BUFFER(0), N_PCMP)', + `dapm(N_SRC(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_SRC(0))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 507aeac..899c426 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -57,15 +57,11 @@ W_BUFFER(1, COMP_BUFFER_SIZE(2, # Tone --B0--> volume --B1--> Endpoint Pipeline #
-SectionGraph."pipe-tone-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(N_BUFFER(0), N_TONE(0)) - dapm(N_PGA(0), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(0)) - ] -} +P_GRAPH(pipe-tone-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_BUFFER(0), N_TONE(0))', + `dapm(N_PGA(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_PGA(0))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4 index 56aed26..0aa10bc 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -55,16 +55,12 @@ W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, # # host PCM_P <-- B0 <-- Volume 0 <-- B1 <-- sink DAI0
-SectionGraph."pipe-pass-vol-capture-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(Passthrough Capture PCM_ID, N_PCMC) - dapm(N_PCMC, N_BUFFER(0)) - dapm(N_BUFFER(0), N_PGA(0)) - dapm(N_PGA(0), N_BUFFER(1)) - ] -} +P_GRAPH(pipe-pass-vol-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(Passthrough Capture PCM_ID, N_PCMC)', + `dapm(N_PCMC, N_BUFFER(0))', + `dapm(N_BUFFER(0), N_PGA(0))', + `dapm(N_PGA(0), N_BUFFER(1))'))
# # Pipeline Source and Sinks diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 22de572..4ca8ab7 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -64,16 +64,12 @@ W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, # # host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0
-SectionGraph."pipe-pass-vol-playback-PIPELINE_ID" { - index STR(PIPELINE_ID) - - lines [ - dapm(N_PCMP, Passthrough Playback PCM_ID) - dapm(N_BUFFER(0), N_PCMP) - dapm(N_PGA(0), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(0)) - ] -} +P_GRAPH(pipe-pass-vol-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMP, Passthrough Playback PCM_ID)', + `dapm(N_BUFFER(0), N_PCMP)', + `dapm(N_PGA(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_PGA(0))'))
# # Pipeline Source and Sinks
This patch adds a m4 wrpper for PCM Capabilities sections in pipeline definition
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/local.m4 | 16 ++++++++++++++++ topology/sof/pipe-low-latency-capture.m4 | 16 +--------------- topology/sof/pipe-low-latency-playback.m4 | 16 ++-------------- topology/sof/pipe-passthrough-capture.m4 | 15 +-------------- topology/sof/pipe-passthrough-playback.m4 | 15 +-------------- topology/sof/pipe-pcm-media.m4 | 14 +------------- topology/sof/pipe-src-capture.m4 | 15 +-------------- topology/sof/pipe-src-playback.m4 | 15 +-------------- topology/sof/pipe-volume-capture.m4 | 14 +------------- topology/sof/pipe-volume-playback.m4 | 17 ++--------------- 10 files changed, 27 insertions(+), 126 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 690f677..90d690e 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -615,6 +615,22 @@ define(`P_GRAPH', ` ]' `}')
+dnl PCM_CAPABILITIES(name, formats, rate_min, rate_max, channels_min, channels_max, periods_min, periods_max, period_size_min, period_size_max, buffer_size_min, buffer_size_max) +define(`PCM_CAPABILITIES', +`SectionPCMCapabilities.STR($1) {' +`' +` formats "$2"' +` rate_min STR($3)' +` rate_max STR($4)' +` channels_min STR($5)' +` channels_max STR($6)' +` periods_min STR($7)' +` periods_max STR($8)' +` period_size_min STR($9)' +` period_size_max STR($10)' +` buffer_size_min STR($11)' +` buffer_size_max STR($12)' +`}')
divert(0) dnl
diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 07b59ad..7adfd14 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -60,18 +60,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Capture PCM_ID # PCM Configuration #
-SectionPCMCapabilities.STR(Low Latency Capture PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "48000" - rate_max "48000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "4" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} - +PCM_CAPABILITIES(Low Latency Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 4, 192, 16384, 65536, 65536) diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index 7c39f16..11cf07d 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -108,19 +108,7 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Playback PCM_I # PCM Configuration #
+ # PCM capabilities supported by FW -SectionPCMCapabilities.STR(Low Latency Playback PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "48000" - rate_max "48000" - channels_min "2" - channels_max "2" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} +PCM_CAPABILITIES(Low Latency Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 2, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 index 8ef8a81..cfa357a 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -51,17 +51,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID # PCM Configuration #
-SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "48000" - rate_max "48000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} +PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index a26b5eb..3218431 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -51,17 +51,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I # PCM Configuration #
-SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "48000" - rate_max "48000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} +PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536) diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index 8cb8ed5..1171d07 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -97,19 +97,7 @@ W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE
# PCM capabilities supported by FW
-SectionPCMCapabilities.STR(Media Playback PCM_ID) { - formats "S32_LE,S24_LE,S16_LE" - rate_min "8000" - rate_max "192000" - channels_min "2" - channels_max "2" - periods_min "2" - periods_max "32" - period_size_min "192" - period_size_max "262144" - buffer_size_min "8388608" - buffer_size_max "8388608" -} +PCM_CAPABILITIES(Media Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 8000, 192000, 2, 2, 2, 32, 192, 262144, 8388608, 8388608)
# PCM Low Latency Playback and Capture SectionPCM.STR(Media Playback PCM_ID) { diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4 index 44bb030..d8e04a8 100644 --- a/topology/sof/pipe-src-capture.m4 +++ b/topology/sof/pipe-src-capture.m4 @@ -77,17 +77,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID # PCM Configuration #
-SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "8000" - rate_max "96000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} +PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 8000, 96000, 2, 4, 2, 16, 192, 16384, 65536, 65536) diff --git a/topology/sof/pipe-src-playback.m4 b/topology/sof/pipe-src-playback.m4 index d34bc8a..c9b4159 100644 --- a/topology/sof/pipe-src-playback.m4 +++ b/topology/sof/pipe-src-playback.m4 @@ -77,18 +77,5 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I # PCM Configuration #
-SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "8000" - rate_max "96000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} +PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 8000, 96000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4 index 0aa10bc..299a0f8 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -72,17 +72,5 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID # PCM Configuration #
-SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { +PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
- formats "S32_LE,S24_LE,S16_LE" - rate_min "48000" - rate_max "48000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4 index 4ca8ab7..3e3f98e 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -80,20 +80,7 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I
# # PCM Configuration -#
-SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { - - formats "S32_LE,S24_LE,S16_LE" - rate_min "48000" - rate_max "48000" - channels_min "2" - channels_max "4" - periods_min "2" - periods_max "16" - period_size_min "192" - period_size_max "16384" - buffer_size_min "65536" - buffer_size_max "65536" -} +# +PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
This patch adds a m4 wrpper for Vendor Tuples sections in pipeline definition
Signed-off-by: Ranjani Sridharan ranjani.sridharan@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"
This patch adds a m4 wrapper for data section in pipeline definitions
Signed-off-by: Ranjani Sridharan ranjani.sridharan@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/cnl.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 +--- 10 files changed, 52 insertions(+), 135 deletions(-)
diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4 index 7d57561..ea20aac 100644 --- a/topology/dsps/bdw.m4 +++ b/topology/dsps/bdw.m4 @@ -13,48 +13,34 @@ define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) # 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" -} +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration 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" -} +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, LIST(` ', `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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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 3a975d1..1286f57 100644 --- a/topology/dsps/bxt.m4 +++ b/topology/dsps/bxt.m4 @@ -16,48 +16,34 @@ define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) # 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" -} +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration 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" -} +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, LIST(` ', `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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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 490a6eb..ab707f8 100644 --- a/topology/dsps/byt.m4 +++ b/topology/dsps/byt.m4 @@ -13,48 +13,34 @@ define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) # 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" -} +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration 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" -} +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, LIST(` ', `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, LIST(` ', `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, LIST(` ', `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, LIST(` ', `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, LIST(` ', `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 9d9cc79..ed92860 100644 --- a/topology/dsps/cht.m4 +++ b/topology/dsps/cht.m4 @@ -13,48 +13,34 @@ define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) # 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" -} +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration 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" -} +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, LIST(` ', `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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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/cnl.m4 b/topology/dsps/cnl.m4 index 0257ee5..95094f3 100644 --- a/topology/dsps/cnl.m4 +++ b/topology/dsps/cnl.m4 @@ -17,48 +17,34 @@ define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) # 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" -} +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration 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" -} +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, LIST(` ', `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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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 494d8d2..348ffc6 100644 --- a/topology/dsps/hsw.m4 +++ b/topology/dsps/hsw.m4 @@ -13,48 +13,34 @@ define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) # 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" -} +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
# Media PCM Configuration 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" -} +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, LIST(` ', `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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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, LIST(` ', 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 b951d01..df6ea14 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -642,6 +642,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 2c59f7a..0196f98 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, LIST(` ', `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 d09c5ac..824dcdb 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, LIST(` ', `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 e93cd64..3009ff7 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, LIST(` ', `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)
participants (1)
-
Ranjani Sridharan