[Sound-open-firmware] [PATCH] topology: Add sample bits to DAI_CONFIG
Add a token for number of bits in a sample for DAI configs
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/m4/local.m4 | 29 +++++++++++++++++++++++++++-- topology/reef-apl-nocodec.m4 | 4 ++-- topology/reef-bdw-rt286.m4 | 4 ++-- topology/reef-bdw-rt5640.m4 | 4 ++-- topology/reef-bxt-nocodec.m4 | 4 ++-- topology/reef-byt-nocodec.m4 | 4 ++-- topology/reef-byt-rt5640.m4 | 4 ++-- topology/reef-byt-rt5651.m4 | 4 ++-- topology/reef-cht-nocodec.m4 | 4 ++-- topology/reef-hsw-rt5640.m4 | 4 ++-- topology/sof/tokens.m4 | 1 + 11 files changed, 46 insertions(+), 20 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index a14f310..a559670 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -394,17 +394,38 @@ define(`DAI_TDM', ` rx_slots 'STR($4) )
-dnl DAI_CONFIG(type, idx, name, sname, format, mclk, bclk, fsync, tdm) +dnl Pipeline name) +define(`N_DAI_CONFIG', `DAICONFIG.'$1) + +dnl DAI_CONFIG(type, idx, name, sname, format, valid bits, mclk, bclk, fsync, tdm) define(`DAI_CONFIG', `SectionHWConfig."'$1$2`" {' `' ` id "'$2`"' ` format "'$5`"' `' -` '$6 ` '$7 ` '$8 ` '$9 +` '$10 +`}' +`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' +` tokens "sof_dai_tokens"' +` tuples."string" {' +` SOF_TKN_DAI_TYPE' STR($1) +` }' +`}' +`SectionData."'N_DAI_CONFIG($1$2)`_data_str" {' +` tuples "'N_DAI_CONFIG($1$2)`_tuples_str"' +`}' +`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_SAMPLE_BITS' STR($6) +` }' +`}' +`SectionData."'N_DAI_CONFIG($1$2)`_data" {' +` tuples "'N_DAI_CONFIG($1$2)`_tuples"' `}' `' `SectionBE."'$3`" {' @@ -414,6 +435,10 @@ define(`DAI_CONFIG', ` hw_configs [' ` "'$1$2`"' ` ]' +` data [' +` "'N_DAI_CONFIG($1$2)`_data"' +` "'N_DAI_CONFIG($1$2)`_data_str"' +` ]' `}')
dnl COMP_SAMPLE_SIZE(FMT) diff --git a/topology/reef-apl-nocodec.m4 b/topology/reef-apl-nocodec.m4 index 93febe0..93b57fe 100644 --- a/topology/reef-apl-nocodec.m4 +++ b/topology/reef-apl-nocodec.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-bdw-rt286.m4 b/topology/reef-bdw-rt286.m4 index 4135353..e4b600a 100644 --- a/topology/reef-bdw-rt286.m4 +++ b/topology/reef-bdw-rt286.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, Codec, I2S, I2S, +DAI_CONFIG(SSP, 0, Codec, I2S, I2S, 24, DAI_CLOCK(mclk, 24000000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-bdw-rt5640.m4 b/topology/reef-bdw-rt5640.m4 index 540ac4c..5d96236 100644 --- a/topology/reef-bdw-rt5640.m4 +++ b/topology/reef-bdw-rt5640.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, Codec, I2S, I2S, +DAI_CONFIG(SSP, 0, Codec, I2S, I2S, 24, DAI_CLOCK(mclk, 24000000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 564e78c..a8fd320 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index ab0cd8e..96e2e4b 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 2cee093..c135fed 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, Baytrail Audio, Audio, I2S, +DAI_CONFIG(SSP, 2, Baytrail Audio, Audio, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index 4679343..877492a 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, Baytrail Audio, Audio, I2S, +DAI_CONFIG(SSP, 2, Baytrail Audio, Audio, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index f754551..381ff12 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index cbbbfbe..3a76223 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -82,8 +82,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, Codec, I2S, I2S, +DAI_CONFIG(SSP, 0, Codec, I2S, I2S, 24, DAI_CLOCK(mclk, 24000000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 24, 3, 3)) + DAI_TDM(2, 25, 3, 3)) diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index 3902c36..530220a 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -19,6 +19,7 @@ SectionVendorTokens."sof_dai_tokens" { SOF_TKN_DAI_DMAC_CONFIG "153" SOF_TKN_DAI_TYPE "154" SOF_TKN_DAI_INDEX "155" + SOF_TKN_DAI_SAMPLE_BITS "156" }
SectionVendorTokens."sof_sched_tokens" {
Make sure we allow different DAI formats in pipelines.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/m4/build.m4 | 6 ++++-- topology/m4/local.m4 | 29 +++++++++++++++++++++++++---- topology/sof/pipe-dai-capture.m4 | 2 +- topology/sof/pipe-dai-playback.m4 | 2 +- topology/sof/pipe-passthrough-playback.m4 | 8 ++++---- 5 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/topology/m4/build.m4 b/topology/m4/build.m4 index 66f6562..843dcbb 100644 --- a/topology/m4/build.m4 +++ b/topology/m4/build.m4 @@ -26,7 +26,7 @@ define(`PIPELINE_PCM_ADD', )
dnl PIPELINE_PCM_DAI_ADD(pipeline, id, pcm, max channels, format, frames, -dnl deadline, priority, core, dai type, dai_index, stream_name, periods) +dnl deadline, priority, core, dai type, dai_index, stream_name, dai format, periods) define(`PIPELINE_PCM_DAI_ADD', `undefine(`PCM_ID')' `undefine(`PIPELINE_ID')' @@ -41,6 +41,7 @@ define(`PIPELINE_PCM_DAI_ADD', `undefine(`DAI_TYPE')' `undefine(`DAI_INDEX')' `undefine(`DAI_SNAME')' +`undefine(`DAI_FORMAT')' `undefine(`DAI_PERIODS')' `define(`PIPELINE_ID', $2)' `define(`PCM_ID', $3)' @@ -55,7 +56,8 @@ define(`PIPELINE_PCM_DAI_ADD', `define(`DAI_TYPE', STR($12))' `define(`DAI_INDEX', STR($13))' `define(`DAI_SNAME', $14)' -`define(`DAI_PERIODS', $15)' +`define(`DAI_FORMAT', $15)' +`define(`DAI_PERIODS', $16)' `define(`DAI_NAME', $12$13)' `include($1)' ) diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index a559670..7bcebee 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -253,7 +253,7 @@ define(`N_DAI', DAI_NAME) define(`N_DAI_OUT', DAI_NAME`.OUT') define(`N_DAI_IN', DAI_NAME`.IN')
-dnl W_DAI_OUT(stream, type, index, data, periods_sink, periods_source, preload) +dnl W_DAI_OUT(stream, type, index, format, periods_sink, periods_source, preload, data) define(`W_DAI_OUT', `SectionVendorTuples."'N_DAI_OUT($1)`_tuples_w_comp" {' ` tokens "sof_comp_tokens"' @@ -284,6 +284,15 @@ define(`W_DAI_OUT', `SectionData."'N_DAI_OUT($1)`_data_str" {' ` tuples "'N_DAI_OUT($1)`_tuples_str"' `}' +`SectionVendorTuples."'N_DAI_OUT($1)`_tuples_comp_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($4) +` }' +`}' +`SectionData."'N_DAI_OUT($1)`_data_comp_str" {' +` tuples "'N_DAI_OUT($1)`_tuples_comp_str"' +`}' `SectionWidget."'N_DAI_OUT`" {' ` index "'PIPELINE_ID`"' ` type "dai_in"' @@ -293,11 +302,12 @@ define(`W_DAI_OUT', ` "'N_DAI_OUT($1)`_data_w"' ` "'N_DAI_OUT($1)`_data_w_comp"' ` "'N_DAI_OUT($1)`_data_str"' -` "'$4`"' +` "'N_DAI_OUT($1)`_data_comp_str"' +` "'$8`"' ` ]' `}')
-dnl W_DAI_IN(stream, type, index, data, periods_sink, periods_source, preload) +dnl W_DAI_IN(stream, type, index, format, periods_sink, periods_source, preload, data) define(`W_DAI_IN', `SectionVendorTuples."'N_DAI_IN($1)`_tuples_w_comp" {' ` tokens "sof_comp_tokens"' @@ -328,6 +338,15 @@ define(`W_DAI_IN', `SectionData."'N_DAI_IN($1)`_data_str" {' ` tuples "'N_DAI_IN($1)`_tuples_str"' `}' +`SectionVendorTuples."'N_DAI_IN($1)`_tuples_comp_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($4) +` }' +`}' +`SectionData."'N_DAI_IN($1)`_data_comp_str" {' +` tuples "'N_DAI_IN($1)`_tuples_comp_str"' +`}' `SectionWidget."'N_DAI_IN`" {' ` index "'PIPELINE_ID`"' ` type "dai_out"' @@ -337,7 +356,8 @@ define(`W_DAI_IN', ` "'N_DAI_IN($1)`_data_w"' ` "'N_DAI_IN($1)`_data_w_comp"' ` "'N_DAI_IN($1)`_data_str"' -` "'$4`"' +` "'N_DAI_OUT($1)`_data_comp_str"' +` "'$8`"' ` ]' `}')
@@ -447,6 +467,7 @@ define(`COMP_SAMPLE_SIZE', $1, `s16le', `2', $1, `s24_4le', `4', $1, `s32le', `4', + $1, `float', `4', `4')')
diff --git a/topology/sof/pipe-dai-capture.m4 b/topology/sof/pipe-dai-capture.m4 index 887cd0c..cc44c0e 100644 --- a/topology/sof/pipe-dai-capture.m4 +++ b/topology/sof/pipe-dai-capture.m4 @@ -6,7 +6,7 @@ include(`local.m4') # # DAI definitions # -W_DAI_IN(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0c_plat_conf) +W_DAI_IN(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 2, 0, 0, dai0c_plat_conf)
# # DAI pipeline - always use 0 for DAIs diff --git a/topology/sof/pipe-dai-playback.m4 b/topology/sof/pipe-dai-playback.m4 index f3d08c0..f0967c2 100644 --- a/topology/sof/pipe-dai-playback.m4 +++ b/topology/sof/pipe-dai-playback.m4 @@ -6,7 +6,7 @@ include(`local.m4') # # DAI definitions # -W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0p_plat_conf) +W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf)
# # DAI pipeline - always use 0 for DAIs diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index 98b479f..a6ecb32 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -16,14 +16,14 @@ include(`local.m4') # with 2 sink and 0 source periods W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
-# Capture Buffers +# Playback Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
# # DAI definitions # -W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0p_plat_conf) +W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf)
# # DAI pipeline - always use 0 for DAIs @@ -33,7 +33,7 @@ W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCH # # Pipeline Graph # -# host PCM <--B1-- volume <--B0-- source DAI0 +# host PCM_P --> B0 --> sink DAI0
SectionGraph."pipe-pass-playback-PIPELINE_ID" { index STR(PIPELINE_ID) @@ -65,7 +65,7 @@ SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { buffer_size_max "65536" }
-# PCM Low Latency Capture +# PCM Low Latency Passthrough Playback SectionPCM.STR(PCM PCM_ID) {
index STR(PIPELINE_ID)
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/pipe-passthrough-vol-playback.m4 | 93 +++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 topology/sof/pipe-passthrough-vol-playback.m4
diff --git a/topology/sof/pipe-passthrough-vol-playback.m4 b/topology/sof/pipe-passthrough-vol-playback.m4 new file mode 100644 index 0000000..ae2b569 --- /dev/null +++ b/topology/sof/pipe-passthrough-vol-playback.m4 @@ -0,0 +1,93 @@ +# Low Latency Passthrough with volume Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0 + +# Include topology builder +include(`local.m4') + + +# +# Components and Buffers +# + +# Host "Passthrough Playback" PCM uses pipeline DMAC and channel +# with 2 sink and 0 source periods +W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2) + +# "Volume" has 2 source and 2 sink periods +W_PGA(Volume, PIPELINE_FORMAT, 2, 2, 2) + +# Playback Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) +W_BUFFER(1, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) + +# +# DAI definitions +# +W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, DAI_PERIODS, + DAI_PERIODS, dai0p_plat_conf) + +# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, + SCHEDULE_CORE, pipe_dai_schedule_plat) + +# +# Pipeline Graph +# +# host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0 + +SectionGraph."pipe-pass-vol-playback-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(N_PCM, Passthrough Playback PCM_ID) + dapm(N_BUFFER(0), N_PCM) + dapm(N_PGA(Volume), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(Volume)) + dapm(N_DAI_OUT, N_BUFFER(1)) + ] +} + + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { + + formats "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 Passthrough Playback +SectionPCM.STR(PCM PCM_ID) { + + index STR(PIPELINE_ID) + + # used for binding to the PCM + id STR(PCM_ID) + + dai.STR(Passthrough Playback PCM_ID) { + id STR(PCM_ID) + } + + pcm."playback" { + + capabilities STR(Passthrough Playback PCM_ID) + } +}
participants (1)
-
Liam Girdwood