[Sound-open-firmware] [PATCH 1/5] topology: create m4 wrapper for mixer control section
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 | 55 +++++++++++++++++++++-- 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, 127 insertions(+), 252 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index a340ec3..4521314 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -7,9 +7,13 @@ define(`STR', `"'$1`"') define(`argn', `ifelse(`$1', 1, ``$2'', `argn(decr(`$1'), shift(shift($@)))')')
-define(`KCONTROLS', `pushdef(`i', $#) pushdef(`j', `1') KCONTROL_LOOP($@)') -define(`KCONTROL_LOOP', `argn(j,$@) - ifelse(i,`1', `', `define(`i', decr(i)) define(`j', incr(j)) $0($@)')') +define(`KCONTROLS', `pushdef(`i', $#)pushdef(`j', `1')KCONTROL_LOOP($@)popdef(i)popdef(j)') +define(`KCONTROL_LOOP',`argn(j,$@) + ifelse(i,`1', `',`define(`i', decr(i))define(`j', incr(j))$0($@)')') + +define(`MIXERCONTROLS', `pushdef(`i', $#)pushdef(`j', `1')MIXERCONTROL_LOOP($@)popdef(i)popdef(j)') +define(`MIXERCONTROL_LOOP',`argn(j,$@) + ifelse(i,`1', `',`define(`i', decr(i))define(`j', incr(j))$0($@)')')
dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"') @@ -549,4 +553,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 2602ebd..a82dee1 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, + MIXERCONTROLS(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 ebb14ec..3b8d6aa 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, + MIXERCONTROLS(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, + MIXERCONTROLS(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 526ae35..65dc62d 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, + MIXERCONTROLS(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 8f92680..b735146 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, + MIXERCONTROLS(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, + MIXERCONTROLS(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 58e5393..1cde24e 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, + MIXERCONTROLS(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 8aa02fb..a6b5a1d 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, + MIXERCONTROLS(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, + MIXERCONTROLS(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 | 16 ++++++++++++++++ topology/sof/pipe-dai-capture.m4 | 9 ++------- topology/sof/pipe-dai-playback.m4 | 9 ++------- topology/sof/pipe-low-latency-capture.m4 | 15 +++++---------- topology/sof/pipe-low-latency-playback.m4 | 23 +++++++++-------------- topology/sof/pipe-passthrough-capture.m4 | 11 +++-------- topology/sof/pipe-passthrough-playback.m4 | 11 +++-------- topology/sof/pipe-pcm-media.m4 | 19 +++++++------------ topology/sof/pipe-src-capture.m4 | 15 +++++---------- topology/sof/pipe-src-playback.m4 | 15 +++++---------- topology/sof/pipe-tone.m4 | 13 ++++--------- topology/sof/pipe-volume-capture.m4 | 15 +++++---------- topology/sof/pipe-volume-playback.m4 | 15 +++++---------- 13 files changed, 71 insertions(+), 115 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 4521314..b7bc78f 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -15,6 +15,11 @@ define(`MIXERCONTROLS', `pushdef(`i', $#)pushdef(`j', `1')MIXERCONTROL_LOOP($@)p define(`MIXERCONTROL_LOOP',`argn(j,$@) ifelse(i,`1', `',`define(`i', decr(i))define(`j', incr(j))$0($@)')')
+define(`PIPELINEGRAPH', `pushdef(`i', $#)pushdef(`j', `1')PIPELINEGRAPH_LOOP($@)popdef(i)popdef(j)') +define(`PIPELINEGRAPH_LOOP',`argn(j,$@) + ifelse(i,`1', `',`define(`i', decr(i))define(`j', incr(j))$0($@)')') + + dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"')
@@ -596,6 +601,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..7b5cd56 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, + PIPELINEGRAPH(`dapm(DAI_BUF, N_DAI_IN)')) diff --git a/topology/sof/pipe-dai-playback.m4 b/topology/sof/pipe-dai-playback.m4 index 3a7a158..fa87957 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, + PIPELINEGRAPH(`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 a82dee1..9728032 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -41,16 +41,11 @@ 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, + PIPELINEGRAPH(`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 3b8d6aa..a278a2a 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -82,20 +82,15 @@ 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, + PIPELINEGRAPH(`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 2c2a495..aae92b9 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -35,14 +35,9 @@ 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, + PIPELINEGRAPH(`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 1722256..71be139 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -35,14 +35,9 @@ 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, + PIPELINEGRAPH(`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 65dc62d..b3a306c 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -68,18 +68,13 @@ 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, + PIPELINEGRAPH(`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 dc55dd2..1af9826 100644 --- a/topology/sof/pipe-src-capture.m4 +++ b/topology/sof/pipe-src-capture.m4 @@ -58,16 +58,11 @@ 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, + PIPELINEGRAPH(`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 d037543..608ce0f 100644 --- a/topology/sof/pipe-src-playback.m4 +++ b/topology/sof/pipe-src-playback.m4 @@ -58,16 +58,11 @@ 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, + PIPELINEGRAPH(`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 b735146..6e33eec 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -55,15 +55,10 @@ 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, + PIPELINEGRAPH(`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 1cde24e..21335f1 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -53,16 +53,11 @@ 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, + PIPELINEGRAPH(`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 a6b5a1d..7ea823a 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -62,16 +62,11 @@ 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, + PIPELINEGRAPH(`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 b7bc78f..b338c7f 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -611,6 +611,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 STR($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 9728032..8b338bc 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -57,18 +57,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 a278a2a..ce3c506 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -103,19 +103,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 aae92b9..cf5defb 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -49,17 +49,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 71be139..7a14d46 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -49,17 +49,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 b3a306c..dd89361 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -93,19 +93,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 1af9826..e1ae5a9 100644 --- a/topology/sof/pipe-src-capture.m4 +++ b/topology/sof/pipe-src-capture.m4 @@ -74,17 +74,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 608ce0f..276a510 100644 --- a/topology/sof/pipe-src-playback.m4 +++ b/topology/sof/pipe-src-playback.m4 @@ -74,18 +74,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 21335f1..2484b7e 100644 --- a/topology/sof/pipe-volume-capture.m4 +++ b/topology/sof/pipe-volume-capture.m4 @@ -69,17 +69,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 7ea823a..f41b4a1 100644 --- a/topology/sof/pipe-volume-playback.m4 +++ b/topology/sof/pipe-volume-playback.m4 @@ -77,20 +77,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/hsw.m4 | 59 +++++---------------------------------- topology/m4/local.m4 | 13 +++++++++ topology/sof/pipe-pcm-media.m4 | 8 +----- topology/sof/pipe-src-capture.m4 | 8 +----- topology/sof/pipe-src-playback.m4 | 8 +----- 9 files changed, 51 insertions(+), 281 deletions(-)
diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4 index 428e8bb..ca8d712 100644 --- a/topology/dsps/bdw.m4 +++ b/topology/dsps/bdw.m4 @@ -3,94 +3,49 @@ #
# 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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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 688e9fa..5ab353e 100644 --- a/topology/dsps/bxt.m4 +++ b/topology/dsps/bxt.m4 @@ -3,94 +3,49 @@ #
# 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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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 b4defaa..2091573 100644 --- a/topology/dsps/byt.m4 +++ b/topology/dsps/byt.m4 @@ -3,94 +3,49 @@ #
# 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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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 fdee83d..97bee2b 100644 --- a/topology/dsps/cht.m4 +++ b/topology/dsps/cht.m4 @@ -3,94 +3,49 @@ #
# 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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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 edb417f..9233e45 100644 --- a/topology/dsps/hsw.m4 +++ b/topology/dsps/hsw.m4 @@ -3,94 +3,49 @@ #
# 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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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, TUPLES(`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 b338c7f..c081052 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -19,6 +19,9 @@ define(`PIPELINEGRAPH', `pushdef(`i', $#)pushdef(`j', `1')PIPELINEGRAPH_LOOP($@) define(`PIPELINEGRAPH_LOOP',`argn(j,$@) ifelse(i,`1', `',`define(`i', decr(i))define(`j', incr(j))$0($@)')')
+define(`TUPLES', `pushdef(`i', $#)pushdef(`j', `1')TUPLES_LOOP($@)popdef(i)popdef(j)') +define(`TUPLES_LOOP',`argn(j,$@) + ifelse(i,`1', `',`define(`i', decr(i))define(`j', incr(j))$0($@)')')
dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"') @@ -628,6 +631,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 dd89361..2bf2bd4 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, TUPLES(`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 e1ae5a9..a58242d 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, TUPLES(`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 276a510..0fc7fcc 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, TUPLES(`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/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 c081052..ef64807 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)
participants (1)
-
Ranjani Sridharan