From dc10876c20a598290eb0d2b47ee5087db7ffaae4 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Mon, 23 Jul 2018 22:47:48 -0700 Subject: [PATCH] topology: changes to SectionPCM macros This patch addresses the following: 1. Move PCM_PLAYBACK_ADD to pcm.m4 The macro was in the wrong m4 file (buffer.m4) 2. Remove pipeline_id argument and "index" from SectionPCM "index" is not a member of struct snd_soc_tplg_pcm. So this information is not used in the kernel at all. Secondly, the PCM ID could be associated with more than one pipeline especially in the case of DUPLEX PCM's. So better to remove it to avoid ambiguities. 3. Remove dai_id This dai_id is the ID given to the CPU DAI when the FE DAI link is created. In the case of SOF, we should use an linearly increasing unique ID for CPU DAI ID's. If this argument is omitted, the kernel automatially assignes an ID based on the component->num_dai which is linearly incremented every time a new DAI link is added. 4. Finally update users to align with the new definitions. Signed-off-by: Ranjani Sridharan --- topology/m4/buffer.m4 | 19 --------- topology/m4/pcm.m4 | 74 +++++++++++++++++++--------------- topology/sof-apl-nocodec.m4 | 19 +++++---- topology/sof-apl-pcm512x.m4 | 2 +- topology/sof-apl-tdf8532.m4 | 12 +++--- topology/sof-bdw-rt286.m4 | 2 +- topology/sof-bdw-rt5640.m4 | 2 +- topology/sof-byt-da7213.m4 | 2 +- topology/sof-byt-nocodec.m4 | 2 +- topology/sof-byt-rt5640.m4 | 2 +- topology/sof-byt-rt5645.m4 | 2 +- topology/sof-byt-rt5651.m4 | 2 +- topology/sof-cht-max98090.m4 | 2 +- topology/sof-cht-nocodec.m4 | 2 +- topology/sof-cnl-rt274.m4 | 2 +- topology/sof-hsw-rt5640.m4 | 2 +- topology/sof-icl-nocodec.m4 | 2 +- topology/test/test-all.m4 | 2 +- topology/test/test-capture.m4 | 2 +- topology/test/test-playback.m4 | 2 +- 20 files changed, 73 insertions(+), 83 deletions(-) diff --git a/topology/m4/buffer.m4 b/topology/m4/buffer.m4 index 4bfd212..55dd065 100644 --- a/topology/m4/buffer.m4 +++ b/topology/m4/buffer.m4 @@ -29,23 +29,4 @@ define(`W_BUFFER', dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')') -dnl PCM_PLAYBACK_ADD(name, pipeline, pcm_id, dai_id, playback) -define(`PCM_PLAYBACK_ADD', -`SectionPCM.STR($1) {' -`' -` index STR($2)' -`' -` # used for binding to the PCM' -` id STR($3)' -`' -` dai.STR($1 $3) {' -` id STR($4)' -` }' -`' -` pcm."playback" {' -`' -` capabilities STR($5)' -` }' -`}') - divert(0)dnl diff --git a/topology/m4/pcm.m4 b/topology/m4/pcm.m4 index 51775fb..28bcb8f 100644 --- a/topology/m4/pcm.m4 +++ b/topology/m4/pcm.m4 @@ -71,46 +71,56 @@ define(`PCM_CAPABILITIES', ` buffer_size_max STR($12)' `}') -dnl PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture) -define(`PCM_CAPTURE_ADD', +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +define(`PCM_PLAYBACK_ADD', `SectionPCM.STR($1) {' `' -` index STR($2)' -`' ` # used for binding to the PCM' -` id STR($3)' +` id STR($2)' `' -` dai.STR($1 $3) {' -` id STR($4)' -` }' -`' -` pcm."capture" {' -`' -` capabilities STR($5)' -` }' -`}') - -dnl PCM_DUPLEX_ADD(name, pipeline, pcm_id, dai_id, playback, capture) -define(`PCM_DUPLEX_ADD', -`SectionPCM.STR($1) {' -`' -` index STR($2)' -`' -` # used for binding to the PCM' -` id STR($3)' -`' -` dai.STR($1 $3) {' -` id STR($4)' -` }' -`' -` pcm."capture" {' -`' -` capabilities STR($6)' +` dai.STR($1 $2) {' ` }' `' ` pcm."playback" {' `' -` capabilities STR($5)' +` capabilities STR($3)' +` }' +`}') + +dnl PCM_CAPTURE_ADD(name, pcm_id, capture) +define(`PCM_CAPTURE_ADD', +`SectionPCM.STR($1) {' +`' +` # used for binding to the PCM' +` id STR($2)' +`' +` dai.STR($1 $2) {' +` }' +`' +` pcm."capture" {' +`' +` capabilities STR($3)' +` }' +`}') + +dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) +define(`PCM_DUPLEX_ADD', +`SectionPCM.STR($1) {' +`' +` # used for binding to the PCM' +` id STR($2)' +`' +` dai.STR($1 $2) {' +` }' +`' +` pcm."capture" {' +`' +` capabilities STR($4)' +` }' +`' +` pcm."playback" {' +`' +` capabilities STR($3)' ` }' `}') diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4 index 0818026..da61ece 100644 --- a/topology/sof-apl-nocodec.m4 +++ b/topology/sof-apl-nocodec.m4 @@ -218,16 +218,15 @@ DAI_ADD(sof/pipe-dai-capture.m4, PIPELINE_SINK_13, 2, s32le, 48, 1000, 0, 0) -# PCM Low Latency, id 0 -dnl PCM_DUPLEX_ADD(name, pipeline, pcm_id, dai_id, playback, capture) -PCM_DUPLEX_ADD(Port0, 0, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_DUPLEX_ADD(Port1, 1, 1, 1, PIPELINE_PCM_3, PIPELINE_PCM_4) -PCM_DUPLEX_ADD(Port2, 2, 2, 2, PIPELINE_PCM_5, PIPELINE_PCM_6) -PCM_DUPLEX_ADD(Port3, 3, 3, 3, PIPELINE_PCM_7, PIPELINE_PCM_8) -PCM_DUPLEX_ADD(Port4, 4, 4, 4, PIPELINE_PCM_9, PIPELINE_PCM_10) -PCM_DUPLEX_ADD(Port5, 5, 5, 5, PIPELINE_PCM_11, PIPELINE_PCM_12) -dnl PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture) -PCM_CAPTURE_ADD(DMIC01, 6, 6, 6, PIPELINE_PCM_13) +dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) +PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Port1, 1, PIPELINE_PCM_3, PIPELINE_PCM_4) +PCM_DUPLEX_ADD(Port2, 2, PIPELINE_PCM_5, PIPELINE_PCM_6) +PCM_DUPLEX_ADD(Port3, 3, PIPELINE_PCM_7, PIPELINE_PCM_8) +PCM_DUPLEX_ADD(Port4, 4, PIPELINE_PCM_9, PIPELINE_PCM_10) +PCM_DUPLEX_ADD(Port5, 5, PIPELINE_PCM_11, PIPELINE_PCM_12) +dnl PCM_CAPTURE_ADD(name, pipeline, capture) +PCM_CAPTURE_ADD(DMIC01, 6, PIPELINE_PCM_13) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-apl-pcm512x.m4 b/topology/sof-apl-pcm512x.m4 index d0b4461..cf85337 100644 --- a/topology/sof-apl-pcm512x.m4 +++ b/topology/sof-apl-pcm512x.m4 @@ -41,7 +41,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, 48, 1000, 0, 0) # PCM Low Latency, id 0 -PCM_PLAYBACK_ADD(Port5, 0, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_PLAYBACK_ADD(Port5, 0, PIPELINE_PCM_1) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-apl-tdf8532.m4 b/topology/sof-apl-tdf8532.m4 index 8421c07..c82c1f0 100644 --- a/topology/sof-apl-tdf8532.m4 +++ b/topology/sof-apl-tdf8532.m4 @@ -168,12 +168,12 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency, id 0 -PCM_DUPLEX_ADD(Port0, 2, 2, 2, PIPELINE_PCM_4, PIPELINE_PCM_5) -PCM_CAPTURE_ADD(Port1, 3, 3, 3, PIPELINE_PCM_6) -PCM_DUPLEX_ADD(Port2, 1, 1, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) -PCM_DUPLEX_ADD(Port3, 4, 4, 4, PIPELINE_PCM_7, PIPELINE_PCM_8) -PCM_PLAYBACK_ADD(Port4, 0, 0, 0, PIPELINE_PCM_1) -PCM_DUPLEX_ADD(Port5, 5, 5, 5, PIPELINE_PCM_9, PIPELINE_PCM_10) +PCM_DUPLEX_ADD(Port0, 2, PIPELINE_PCM_4, PIPELINE_PCM_5) +PCM_CAPTURE_ADD(Port1, 3, PIPELINE_PCM_6) +PCM_DUPLEX_ADD(Port2, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) +PCM_DUPLEX_ADD(Port3, 4, PIPELINE_PCM_7, PIPELINE_PCM_8) +PCM_PLAYBACK_ADD(Port4, 0, PIPELINE_PCM_1) +PCM_DUPLEX_ADD(Port5, 5, PIPELINE_PCM_9, PIPELINE_PCM_10) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4 index f8294d2..a750344 100644 --- a/topology/sof-bdw-rt286.m4 +++ b/topology/sof-bdw-rt286.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-bdw-rt5640.m4 b/topology/sof-bdw-rt5640.m4 index 3c72d30..454e050 100644 --- a/topology/sof-bdw-rt5640.m4 +++ b/topology/sof-bdw-rt5640.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-byt-da7213.m4 b/topology/sof-byt-da7213.m4 index af5129c..6008ff0 100644 --- a/topology/sof-byt-da7213.m4 +++ b/topology/sof-byt-da7213.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-byt-nocodec.m4 b/topology/sof-byt-nocodec.m4 index 3c52603..6df25ca 100644 --- a/topology/sof-byt-nocodec.m4 +++ b/topology/sof-byt-nocodec.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-byt-rt5640.m4 b/topology/sof-byt-rt5640.m4 index 4107491..2177fe3 100644 --- a/topology/sof-byt-rt5640.m4 +++ b/topology/sof-byt-rt5640.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-byt-rt5645.m4 b/topology/sof-byt-rt5645.m4 index 028cb45..23f1a75 100644 --- a/topology/sof-byt-rt5645.m4 +++ b/topology/sof-byt-rt5645.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-byt-rt5651.m4 b/topology/sof-byt-rt5651.m4 index d2cdfad..724c34e 100644 --- a/topology/sof-byt-rt5651.m4 +++ b/topology/sof-byt-rt5651.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-cht-max98090.m4 b/topology/sof-cht-max98090.m4 index 38244d7..627181f 100644 --- a/topology/sof-cht-max98090.m4 +++ b/topology/sof-cht-max98090.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-cht-nocodec.m4 b/topology/sof-cht-nocodec.m4 index 23c6ef7..dae6dca 100644 --- a/topology/sof-cht-nocodec.m4 +++ b/topology/sof-cht-nocodec.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4 index a2e6d52..141e03b 100644 --- a/topology/sof-cnl-rt274.m4 +++ b/topology/sof-cnl-rt274.m4 @@ -58,7 +58,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Passthrough, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-hsw-rt5640.m4 b/topology/sof-hsw-rt5640.m4 index 9bf8976..272cb15 100644 --- a/topology/sof-hsw-rt5640.m4 +++ b/topology/sof-hsw-rt5640.m4 @@ -86,7 +86,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Low Latency, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/sof-icl-nocodec.m4 b/topology/sof-icl-nocodec.m4 index 9cabf7e..1dffe18 100644 --- a/topology/sof-icl-nocodec.m4 +++ b/topology/sof-icl-nocodec.m4 @@ -58,7 +58,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Low Latency -PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Passthrough, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/test/test-all.m4 b/topology/test/test-all.m4 index 4f4241f..518c909 100644 --- a/topology/test/test-all.m4 +++ b/topology/test/test-all.m4 @@ -76,7 +76,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Passthrough -PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_DUPLEX_ADD(Passthrough, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/test/test-capture.m4 b/topology/test/test-capture.m4 index b21a47f..4e10d3d 100644 --- a/topology/test/test-capture.m4 +++ b/topology/test/test-capture.m4 @@ -60,7 +60,7 @@ DAI_ADD(sof/pipe-dai-capture.m4, 48, 1000, 0, 0) # PCM Passthrough -PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2) +PCM_CAPTURE_ADD(Passthrough, 0, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present diff --git a/topology/test/test-playback.m4 b/topology/test/test-playback.m4 index 1c6f712..9833ea9 100644 --- a/topology/test/test-playback.m4 +++ b/topology/test/test-playback.m4 @@ -59,7 +59,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, 48, 1000, 0, 0) # PCM Passthrough -PCM_PLAYBACK_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1) +PCM_PLAYBACK_ADD(Passthrough, 0, PIPELINE_PCM_1) # # BE configurations - overrides config in ACPI if present