[Sound-open-firmware] [PATCH v5 0/7] Multiple DAI type support in topology
This patchset adds the changes required for multiple DAI types in topology. The main changes are as follows:
1. The tplg build script was hardwired for SSP DAI type. Make changes to accomodate other types. 2. Changes to DAI_CONFIG to accomodate more than just SSP type DAI. 3. The test m4 files similarly were hardwired for SSP. This patchset makes them DAI type agnostic 4. Add DMIC DAI type config definition 5. Add DMIC specific tokens. This is the preliminary version. More tokens will be added as needed. 6. Add DMIC test topology
v3 changes: - Added an extra token for fifo word length
v4 changes: - Added PDM controller tokens and the number of active PDM controllers are configurable in topology
v5 changes: - rebased on top of latest master
Tested with:
APL based Up squared board:
SOF Kernel: https://github.com/ranj063/sound branch: topic/dmic SOF: https://github.com/ranj063/sof branch: ranjani/topic/dmic SOFT: master
Ranjani Sridharan (7): topology: scripts: changes to accommodate different DAI types topology: separate ssp params from dai common params topology: add DMIC tokens topology: make m4 filenames dai type agnostic topology: scripts: add dmic test topology topology: add DMIC config definition to DAI config topology: add DMIC dai support in test capture m4
topology/m4/dai.m4 | 100 ++++++++-- topology/sof-apl-nocodec.m4 | 11 +- topology/sof-apl-tdf8532.m4 | 79 ++++---- topology/sof-bdw-rt286.m4 | 11 +- topology/sof-bdw-rt5640.m4 | 11 +- topology/sof-byt-da7213.m4 | 11 +- topology/sof-byt-nocodec.m4 | 11 +- topology/sof-byt-rt5640.m4 | 11 +- topology/sof-byt-rt5645.m4 | 11 +- topology/sof-byt-rt5651.m4 | 12 +- topology/sof-cht-max98090.m4 | 11 +- topology/sof-cht-nocodec.m4 | 11 +- topology/sof-cnl-rt274.m4 | 11 +- topology/sof-hsw-rt5640.m4 | 11 +- topology/sof/tokens.m4 | 21 ++ topology/test/{test-ssp.m4 => test-all.m4} | 39 ++-- .../{test-capture-ssp.m4 => test-capture.m4} | 41 ++-- ...{test-playback-ssp.m4 => test-playback.m4} | 31 +-- ...-playback-ssp.m4 => test-tone-playback.m4} | 25 +-- topology/test/tplg-build.sh | 181 +++++++++++------- 20 files changed, 413 insertions(+), 237 deletions(-) rename topology/test/{test-ssp.m4 => test-all.m4} (65%) rename topology/test/{test-capture-ssp.m4 => test-capture.m4} (54%) rename topology/test/{test-playback-ssp.m4 => test-playback.m4} (65%) rename topology/test/{test-tone-playback-ssp.m4 => test-tone-playback.m4} (64%)
This patch makes the following changes to make way for handling different DAI types in tplg build script:
1. Define the test DAI type while processing m4 files 2. DAI format and DAI port might be relevant for other types of DAI's. So use generic TEST_DAI_PORT and TEST_DAI_FORMAT instead of TEST_SSP_PORT TEST_SSP_FORMAT
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/test/test-capture-ssp.m4 | 18 +-- topology/test/test-playback-ssp.m4 | 18 +-- topology/test/test-ssp.m4 | 26 ++-- topology/test/test-tone-playback-ssp.m4 | 12 +- topology/test/tplg-build.sh | 154 +++++++++++++----------- 5 files changed, 121 insertions(+), 107 deletions(-)
diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4 index 67f0da9..b6f0935 100644 --- a/topology/test/test-capture-ssp.m4 +++ b/topology/test/test-capture-ssp.m4 @@ -21,8 +21,8 @@ include(`dsps/byt.m4') # # 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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_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 @@ -34,7 +34,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <---> SSP TEST_SSP_PORT +# PCM0 <---> SSP TEST_DAI_PORT #
# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. @@ -44,18 +44,18 @@ include(`dsps/byt.m4') PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, 2, 0, 2, TEST_PIPE_FORMAT, 48, 1000, 0, 0, 0, 1, - SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2)
# # DAI configuration # -# SSP port TEST_SSP_PORT is our only pipeline DAI +# SSP port TEST_DAI_PORT is our only pipeline DAI # -# capture DAI is SSP TEST_SSP_PORT using 2 periods +# capture DAI is SSP TEST_DAI_PORT using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, - PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 2, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SINK_2, 2, TEST_DAI_FORMAT, 48, 1000, 0, 0)
# PCM Passthrough @@ -66,7 +66,7 @@ PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2) # # Clocks masters wrt codec # -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4 index 22943b0..a12db57 100644 --- a/topology/test/test-playback-ssp.m4 +++ b/topology/test/test-playback-ssp.m4 @@ -21,8 +21,8 @@ include(`dsps/byt.m4') # # 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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_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 @@ -34,7 +34,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <---> SSP TEST_SSP_PORT +# PCM0 <---> SSP TEST_DAI_PORT #
# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. @@ -44,18 +44,18 @@ include(`dsps/byt.m4') PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, 1, 0, 2, TEST_PIPE_FORMAT, 48, 1000, 0, 0, 0, 1, - SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2) # # DAI configuration # -# SSP port TEST_SSP_PORT is our only pipeline DAI +# SSP port TEST_DAI_PORT is our only pipeline DAI #
-# playback DAI is SSP TEST_SSP_PORT using 2 periods +# playback DAI is SSP TEST_DAI_PORT using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, - PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT, 48, 1000, 0, 0)
# PCM Passthrough @@ -66,7 +66,7 @@ PCM_PLAYBACK_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1) # # Clocks masters wrt codec # -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_slave), diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index 0b305e1..05c6fee 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -21,8 +21,8 @@ include(`dsps/byt.m4') # # 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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_FORMAT - SSP data format e.g s16le # TEST_PIPE_FORMAT - Pipeline format e.g. s16le # TEST_SSP_MCLK - SSP BCLK in Hz # TEST_SSP_BCLK - SSP BCLK in Hz @@ -34,7 +34,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_DAI_PORT #
# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. @@ -44,7 +44,7 @@ include(`dsps/byt.m4') PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, 1, 0, 2, TEST_PIPE_FORMAT, 48, 1000, 0, 0, 0, 1, - SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2)
# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. @@ -54,26 +54,26 @@ PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, 2, 0, 2, TEST_PIPE_FORMAT, 48, 1000, 0, 0, 0, 1, - SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2)
# # DAI configuration # -# SSP port TEST_SSP_PORT is our only pipeline DAI +# SSP port TEST_DAI_PORT is our only pipeline DAI #
-# playback DAI is SSP TEST_SSP_PORT using 2 periods +# playback DAI is SSP TEST_DAI_PORT using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, - PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT, 48, 1000, 0, 0)
-# capture DAI is SSP TEST_SSP_PORT using 2 periods +# capture DAI is SSP TEST_DAI_PORT using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, - PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 2, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SINK_2, 2, TEST_DAI_FORMAT, 48, 1000, 0, 0)
# PCM Passthrough @@ -84,7 +84,7 @@ PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # Clocks masters wrt codec # -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback-ssp.m4 index b08447a..a530354 100644 --- a/topology/test/test-tone-playback-ssp.m4 +++ b/topology/test/test-tone-playback-ssp.m4 @@ -21,8 +21,8 @@ include(`dsps/byt.m4') # # 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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_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 @@ -43,10 +43,10 @@ PIPELINE_ADD(sof/pipe-tone.m4, 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 +# Buffers use TEST_DAI_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, TEST_DAI_LINK_NAME, - PIPELINE_SOURCE_5, 2, TEST_SSP_FORMAT, + 5, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_5, 2, TEST_DAI_FORMAT, 48, 1000, 2, 0)
# @@ -54,7 +54,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # # Clocks masters wrt codec # -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index af23b66..4c33819 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -14,6 +14,7 @@ export M4PATH="../:../m4:../common" # 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 +DMIC_TEST=test-capture-ssp TEST_STRINGS="" M4_STRINGS="" # process m4 simple tests - @@ -22,6 +23,7 @@ M4_STRINGS="" # 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_type - dai type e.g. SSP/DMIC # 5) dai_id - SSP port number # 6) dai_format - SSP sample format # 7) dai_phy_bits - SSP physical number of BLKCs per slot/channel @@ -32,59 +34,71 @@ M4_STRINGS="" #
function simple_test { - TESTS=("${!12}") + if [ $5 == "SSP" ] + then + TESTS=("${!13}") + fi for i in ${TESTS[@]} do - TFILE="$i$5-${11}-$2-$4-$6-48k-$((${10} / 1000))k-$1" + TFILE="$i$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" if [ "$USE_XARGS" == "yes" ] then - #create input string for batch m4 processing - M4_STRINGS+="-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,-DTEST_SSP_MODE=${11}\ - $i.m4,${TFILE}," - #create input string for batch processing of conf files - TEST_STRINGS+=${TFILE}"," + #if DAI type is SSP, define the SSP specific params + if [ $5 == "SSP" ] + then + #create input string for batch m4 processing + M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\ + -DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\ + -DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\ + -DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\ + -DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\ + -DTEST_DAI_TYPE=$5\ + $i.m4,${TFILE}," + #create input string for batch processing of conf files + TEST_STRINGS+=${TFILE}"," + fi else - echo "M4 pre-processing test $i -> ${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 \ - -DTEST_SSP_MODE=${11} \ - $i.m4 > ${TFILE}.conf - echo "Compiling test $i -> ${TFILE}.tplg" - alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg + #if DAI type is SSP, define the SSP specific params + if [ $5 == "SSP" ] + then + echo "M4 pre-processing test $i -> ${TFILE}" + m4 ${M4_FLAGS} \ + -DTEST_PIPE_NAME="$2" \ + -DTEST_DAI_LINK_NAME="$3" \ + -DTEST_DAI_PORT=$6 \ + -DTEST_DAI_FORMAT=$7 \ + -DTEST_PIPE_FORMAT=$4 \ + -DTEST_SSP_BCLK=${10} \ + -DTEST_SSP_MCLK=${11} \ + -DTEST_SSP_PHY_BITS=$8 \ + -DTEST_SSP_DATA_BITS=$9 \ + -DTEST_SSP_MODE=${12} \ + -DTEST_DAI_TYPE=$5 \ + $i.m4 > ${TFILE}.conf + echo "Compiling test $i -> ${TFILE}.tplg" + alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg + fi fi - done }
echo "Preparing topology build input..."
# Pre-process the simple tests -simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] -simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s16le 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] -simple_test nocodec src "NoCodec" s24le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] - -simple_test codec passthrough "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] -simple_test codec passthrough "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] -simple_test codec volume "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] -simple_test codec volume "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] -simple_test codec volume "SSP2-Codec" s24le 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] -simple_test codec volume "SSP2-Codec" s16le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] -simple_test codec src "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test nocodec passthrough "NoCodec" s16le SSP 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] +simple_test nocodec passthrough "NoCodec" s24le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s16le SSP 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s24le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s16le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test nocodec src "NoCodec" s24le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] + +simple_test codec passthrough "SSP2-Codec" s16le SSP 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] +simple_test codec passthrough "SSP2-Codec" s24le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test codec volume "SSP2-Codec" s16le SSP 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] +simple_test codec volume "SSP2-Codec" s24le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test codec volume "SSP2-Codec" s24le SSP 2 s16le 20 16 1920000 19200000 I2S SIMPLE_TESTS[@] +simple_test codec volume "SSP2-Codec" s16le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@] +simple_test codec src "SSP2-Codec" s24le SSP 2 s24le 25 24 2400000 19200000 I2S SIMPLE_TESTS[@]
# for APL APL_PROTOCOL_TESTS=(I2S LEFT_J DSP_A DSP_B) @@ -100,22 +114,22 @@ do do for format in ${APL_FORMAT_TESTS[@]} do - simple_test nocodec $mode "NoCodec" $format $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] - simple_test nocodec $mode "NoCodec" $format $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] - simple_test nocodec $mode "NoCodec" $format $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test nocodec $mode "NoCodec" $format SSP $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] + simple_test nocodec $mode "NoCodec" $format SSP $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test nocodec $mode "NoCodec" $format SSP $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@]
- simple_test codec $mode "SSP${ssp}-Codec" $format $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] - simple_test codec $mode "SSP${ssp}-Codec" $format $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] - simple_test codec $mode "SSP${ssp}-Codec" $format $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test codec $mode "SSP${ssp}-Codec" $format SSP $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] + simple_test codec $mode "SSP${ssp}-Codec" $format SSP $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test codec $mode "SSP${ssp}-Codec" $format SSP $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@] done done - simple_test nocodec passthrough "NoCodec" s16le $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] - simple_test nocodec passthrough "NoCodec" s24le $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] - simple_test nocodec passthrough "NoCodec" s32le $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test nocodec passthrough "NoCodec" s16le SSP $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] + simple_test nocodec passthrough "NoCodec" s24le SSP $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test nocodec passthrough "NoCodec" s32le SSP $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@]
- simple_test codec passthrough "SSP${ssp}-Codec" s16le $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] - simple_test codec passthrough "SSP${ssp}-Codec" s24le $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] - simple_test codec passthrough "SSP${ssp}-Codec" s32le $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test codec passthrough "SSP${ssp}-Codec" s16le SSP $ssp s16le 16 16 1536000 24576000 $protocol SIMPLE_TESTS[@] + simple_test codec passthrough "SSP${ssp}-Codec" s24le SSP $ssp s24le 32 24 3072000 24576000 $protocol SIMPLE_TESTS[@] + simple_test codec passthrough "SSP${ssp}-Codec" s32le SSP $ssp s32le 32 32 3072000 24576000 $protocol SIMPLE_TESTS[@] done done
@@ -127,39 +141,39 @@ do do for format in ${APL_FORMAT_TESTS[@]} do - simple_test nocodec $mode "NoCodec" $format $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] - simple_test nocodec $mode "NoCodec" $format $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@] + simple_test nocodec $mode "NoCodec" $format SSP $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] + simple_test nocodec $mode "NoCodec" $format SSP $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@]
- simple_test codec $mode "SSP${ssp}-Codec" $format $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] - simple_test codec $mode "SSP${ssp}-Codec" $format $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@] + simple_test codec $mode "SSP${ssp}-Codec" $format SSP $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] + simple_test codec $mode "SSP${ssp}-Codec" $format SSP $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@] done done - simple_test nocodec passthrough "NoCodec" s16le $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] - simple_test nocodec passthrough "NoCodec" s24le $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@] + simple_test nocodec passthrough "NoCodec" s16le SSP $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] + simple_test nocodec passthrough "NoCodec" s24le SSP $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@]
- simple_test codec passthrough "SSP${ssp}-Codec" s16le $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] - simple_test codec passthrough "SSP${ssp}-Codec" s24le $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@] + simple_test codec passthrough "SSP${ssp}-Codec" s16le SSP $ssp s16le 20 16 1920000 19200000 $protocol SIMPLE_TESTS[@] + simple_test codec passthrough "SSP${ssp}-Codec" s24le SSP $ssp s24le 25 24 2400000 19200000 $protocol SIMPLE_TESTS[@] done done
# for CNL -simple_test nocodec passthrough "NoCodec" s16le 2 s16le 25 16 2400000 24000000 I2S SIMPLE_TESTS[@] -simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s16le 2 s16le 25 16 2400000 24000000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] -simple_test nocodec volume "NoCodec" s24le 2 s16le 25 16 2400000 24000000 I2S SIMPLE_TESTS[@] -simple_test nocodec src "NoCodec" s24le 4 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec passthrough "NoCodec" s16le SSP 2 s16le 25 16 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec passthrough "NoCodec" s24le SSP 2 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s16le SSP 2 s16le 25 16 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s16le SSP 2 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s24le SSP 2 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec volume "NoCodec" s24le SSP 2 s16le 25 16 2400000 24000000 I2S SIMPLE_TESTS[@] +simple_test nocodec src "NoCodec" s24le SSP 4 s24le 25 24 2400000 24000000 I2S SIMPLE_TESTS[@]
# Tone test: Tone component only supports s32le currently -simple_test codec tone "SSP2-Codec" s32le 2 s16le 20 16 1920000 19200000 I2S TONE_TEST[@] +simple_test codec tone "SSP2-Codec" s32le SSP 2 s16le 20 16 1920000 19200000 I2S TONE_TEST[@]
if [ "$USE_XARGS" == "yes" ] then echo "Batch processing m4 files..." M4_STRINGS=${M4_STRINGS%?} #m4 processing - echo $M4_STRINGS | tr " " "," | tr '\n' '\0' | xargs -P0 -d ',' -n12 bash -c 'm4 "${@:1:${#}-1}" > ${12}.conf' m4 + echo $M4_STRINGS | tr " " "," | tr '\n' '\0' | xargs -P0 -d ',' -n13 bash -c 'm4 "${@:1:${#}-1}" > ${13}.conf' m4
#execute alsatplg to create topology binary TEST_STRINGS=${TEST_STRINGS%?}
This patch makes changes to DAI config in topology to separate out SSP specific params from common params in preparation for other DAI types coming soon.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/dai.m4 | 43 ++++++++------ topology/sof-apl-nocodec.m4 | 11 ++-- topology/sof-apl-tdf8532.m4 | 79 ++++++++++++++----------- topology/sof-bdw-rt286.m4 | 11 ++-- topology/sof-bdw-rt5640.m4 | 11 ++-- topology/sof-byt-da7213.m4 | 11 ++-- topology/sof-byt-nocodec.m4 | 11 ++-- topology/sof-byt-rt5640.m4 | 11 ++-- topology/sof-byt-rt5645.m4 | 11 ++-- topology/sof-byt-rt5651.m4 | 12 ++-- topology/sof-cht-max98090.m4 | 11 ++-- topology/sof-cht-nocodec.m4 | 11 ++-- topology/sof-cnl-rt274.m4 | 11 ++-- topology/sof-hsw-rt5640.m4 | 11 ++-- topology/test/test-capture-ssp.m4 | 13 ++-- topology/test/test-playback-ssp.m4 | 13 ++-- topology/test/test-ssp.m4 | 13 ++-- topology/test/test-tone-playback-ssp.m4 | 13 ++-- 18 files changed, 173 insertions(+), 134 deletions(-)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index ba6cba4..8a79ebc 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -131,27 +131,45 @@ define(`DAI_CLOCK',
dnl DAI_TDM(slots, width, tx_mask, rx_mask) define(`DAI_TDM', -` tdm_slots 'STR($1) +`tdm_slots 'STR($1) ` tdm_slot_width 'STR($2) ` tx_slots 'STR($3) ` rx_slots 'STR($4) ) +dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp sample bits) +define(`SSP_CONFIG', +` format "'$1`"' +` '$2 +` '$3 +` '$4 +` '$5 +`}' +$6 +) + +dnl SSP_SAMPLE_BITS(type, idx, valid bits) +define(`SSP_SAMPLE_BITS', +`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_SAMPLE_BITS' STR($3) +` }' +`}' +`SectionData."'N_DAI_CONFIG($1$2)`_data" {' +` tuples "'N_DAI_CONFIG($1$2)`_tuples"' +`}' +)
dnl DAI Config) define(`N_DAI_CONFIG', `DAICONFIG.'$1)
-dnl DAI_CONFIG(type, idx, link_id, name, format, valid bits, mclk, bclk, fsync, tdm) +dnl DAI_CONFIG(type, idx, link_id, name, ssp_config) define(`DAI_CONFIG', `SectionHWConfig."'$1$2`" {' `' ` id "'$2`"' -` format "'$5`"' `' -` '$7 -` '$8 -` '$9 -` '$10 -`}' +` ifelse($1, `SSP', $5, `}')' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' ` tokens "sof_dai_tokens"' ` tuples."string" {' @@ -161,15 +179,6 @@ define(`DAI_CONFIG', `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."'$4`" {' ` id "'$3`"' diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4 index 68380e4..ac3ee75 100644 --- a/topology/sof-apl-nocodec.m4 +++ b/topology/sof-apl-nocodec.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, NoCodec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 2, 0, NoCodec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-apl-tdf8532.m4 b/topology/sof-apl-tdf8532.m4 index c737a65..5554e58 100644 --- a/topology/sof-apl-tdf8532.m4 +++ b/topology/sof-apl-tdf8532.m4 @@ -187,41 +187,49 @@ PCM_DUPLEX_ADD(Port5, 5, 5, 5, PIPELINE_PCM_9, PIPELINE_PCM_10) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 4, 4, SSP4-Codec, DSP_B, 32, - DAI_CLOCK(mclk, 24576000, codec_mclk_in), - DAI_CLOCK(bclk, 12288000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(8, 32, 15, 15)) - -DAI_CONFIG(SSP, 2, 2, SSP2-Codec, I2S, 16, - DAI_CLOCK(mclk, 24576000, codec_mclk_in), - DAI_CLOCK(bclk, 1536000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 16, 3, 3)) - -DAI_CONFIG(SSP, 0, 0, SSP0-Codec, I2S, 16, - DAI_CLOCK(mclk, 24576000, codec_mclk_in), - DAI_CLOCK(bclk, 1536000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 16, 3, 3)) - -DAI_CONFIG(SSP, 1, 1, SSP1-Codec, I2S, 16, - DAI_CLOCK(mclk, 24576000, codec_mclk_in), - DAI_CLOCK(bclk, 1536000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 16, 3, 3)) - -DAI_CONFIG(SSP, 3, 3, SSP3-Codec, I2S, 16, - DAI_CLOCK(mclk, 24576000, codec_mclk_in), - DAI_CLOCK(bclk, 1536000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 16, 3, 3)) - -DAI_CONFIG(SSP, 5, 5, SSP5-Codec, I2S, 16, - DAI_CLOCK(mclk, 24576000, codec_mclk_in), - DAI_CLOCK(bclk, 1536000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 16, 3, 3)) + +DAI_CONFIG(SSP, 4, 4, SSP4-Codec, + SSP_CONFIG(DSP_B, DAI_CLOCK(mclk, 24576000, codec_mclk_in), + DAI_CLOCK(bclk, 12288000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(8, 32, 15, 15), + SSP_SAMPLE_BITS(SSP, 4, 32))) + +DAI_CONFIG(SSP, 2, 2, SSP2-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in), + DAI_CLOCK(bclk, 1536000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 16, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 16))) + +DAI_CONFIG(SSP, 0, 0, SSP0-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in), + DAI_CLOCK(bclk, 1536000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 16, 3, 3), + SSP_SAMPLE_BITS(SSP, 0, 16))) + +DAI_CONFIG(SSP, 1, 1, SSP1-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in), + DAI_CLOCK(bclk, 1536000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 16, 3, 3), + SSP_SAMPLE_BITS(SSP, 1, 16))) + +DAI_CONFIG(SSP, 3, 3, SSP3-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in), + DAI_CLOCK(bclk, 1536000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 16, 3, 3), + SSP_SAMPLE_BITS(SSP, 3, 16))) + +DAI_CONFIG(SSP, 5, 5, SSP5-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in), + DAI_CLOCK(bclk, 1536000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 16, 3, 3), + SSP_SAMPLE_BITS(SSP, 5, 16))) +
VIRTUAL_DAPM_ROUTE_IN(BtHfp_ssp0_in, SSP, 0, IN, 0) VIRTUAL_DAPM_ROUTE_OUT(BtHfp_ssp0_out, SSP, 0, OUT, 1) @@ -245,4 +253,3 @@ VIRTUAL_WIDGET(ssp3 Rx, 18) VIRTUAL_WIDGET(ssp4 Tx, 19) VIRTUAL_WIDGET(ssp5 Tx, 20) VIRTUAL_WIDGET(ssp5 Rx, 21) - diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4 index 098d4c8..6d09e2e 100644 --- a/topology/sof-bdw-rt286.m4 +++ b/topology/sof-bdw-rt286.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, 0, Codec, I2S, 24, - DAI_CLOCK(mclk, 24000000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 0, 0, Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24000000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 0, 24))) diff --git a/topology/sof-bdw-rt5640.m4 b/topology/sof-bdw-rt5640.m4 index bbbbbe4..2f9badb 100644 --- a/topology/sof-bdw-rt5640.m4 +++ b/topology/sof-bdw-rt5640.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, 0, Codec, I2S, 24, - DAI_CLOCK(mclk, 24000000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 0, 0, Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24000000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 0, 24))) diff --git a/topology/sof-byt-da7213.m4 b/topology/sof-byt-da7213.m4 index e3c7952..090b034 100644 --- a/topology/sof-byt-da7213.m4 +++ b/topology/sof-byt-da7213.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 2, 0, SSP2-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-byt-nocodec.m4 b/topology/sof-byt-nocodec.m4 index 5c65fb0..9bed36e 100644 --- a/topology/sof-byt-nocodec.m4 +++ b/topology/sof-byt-nocodec.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, NoCodec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 2, 0, NoCodec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-byt-rt5640.m4 b/topology/sof-byt-rt5640.m4 index 7fae6f0..f852616 100644 --- a/topology/sof-byt-rt5640.m4 +++ b/topology/sof-byt-rt5640.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 2, 0, SSP2-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-byt-rt5645.m4 b/topology/sof-byt-rt5645.m4 index 7b81cbd..7d8eee5 100644 --- a/topology/sof-byt-rt5645.m4 +++ b/topology/sof-byt-rt5645.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 2, 0, SSP2-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-byt-rt5651.m4 b/topology/sof-byt-rt5651.m4 index 91324ae..894602a 100644 --- a/topology/sof-byt-rt5651.m4 +++ b/topology/sof-byt-rt5651.m4 @@ -93,9 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) - +DAI_CONFIG(SSP, 2, 0, SSP2-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-cht-max98090.m4 b/topology/sof-cht-max98090.m4 index 5fb7802..2d5192a 100644 --- a/topology/sof-cht-max98090.m4 +++ b/topology/sof-cht-max98090.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 16, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 1920000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 20, 3, 3)) +DAI_CONFIG(SSP, 2, 0, SSP2-Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 1920000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 20, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 16))) diff --git a/topology/sof-cht-nocodec.m4 b/topology/sof-cht-nocodec.m4 index bd4d969..68abf37 100644 --- a/topology/sof-cht-nocodec.m4 +++ b/topology/sof-cht-nocodec.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, 0, NoCodec, I2S, 24, - DAI_CLOCK(mclk, 19200000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 2, 0, NoCodec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 2, 24))) diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4 index 01cd203..25a4913 100644 --- a/topology/sof-cnl-rt274.m4 +++ b/topology/sof-cnl-rt274.m4 @@ -64,11 +64,12 @@ PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, 0, SSP0-Codec, DSP_B, 24, - DAI_CLOCK(mclk, 24000000, codec_mclk_in), - DAI_CLOCK(bclk, 4800000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(4, 25, 3, 3)) +DAI_CONFIG(SSP, 0, 0, SSP0-Codec, + SSP_CONFIG(DSP_B, DAI_CLOCK(mclk, 24000000, codec_mclk_in), + DAI_CLOCK(bclk, 4800000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(4, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 0, 24)))
VIRTUAL_DAPM_ROUTE_OUT(codec0_out, SSP, 0, OUT, 0) VIRTUAL_DAPM_ROUTE_OUT(codec1_out, SSP, 0, OUT, 1) diff --git a/topology/sof-hsw-rt5640.m4 b/topology/sof-hsw-rt5640.m4 index 28d5c6a..22d79d5 100644 --- a/topology/sof-hsw-rt5640.m4 +++ b/topology/sof-hsw-rt5640.m4 @@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 0, 0, Codec, I2S, 24, - DAI_CLOCK(mclk, 24000000, codec_mclk_in), - DAI_CLOCK(bclk, 2400000, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, 25, 3, 3)) +DAI_CONFIG(SSP, 0, 0, Codec, + SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24000000, codec_mclk_in), + DAI_CLOCK(bclk, 2400000, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, 25, 3, 3), + SSP_SAMPLE_BITS(SSP, 0, 24))) diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4 index b6f0935..65a3bcd 100644 --- a/topology/test/test-capture-ssp.m4 +++ b/topology/test/test-capture-ssp.m4 @@ -68,8 +68,11 @@ PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2) # # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), - DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS))) diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4 index a12db57..b0f3fec 100644 --- a/topology/test/test-playback-ssp.m4 +++ b/topology/test/test-playback-ssp.m4 @@ -68,8 +68,11 @@ PCM_PLAYBACK_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1) # # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_slave), - DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_slave), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS))) diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index 05c6fee..383a397 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -86,8 +86,11 @@ PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), - DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS))) diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback-ssp.m4 index a530354..1c38c09 100644 --- a/topology/test/test-tone-playback-ssp.m4 +++ b/topology/test/test-tone-playback-ssp.m4 @@ -56,8 +56,11 @@ DAI_ADD(sof/pipe-dai-playback.m4, # # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 0, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), - DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS)))
This patch introduces the DMIC specific config parameter tokens in topology.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/sof/tokens.m4 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index e9aa302..d1230d8 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -60,3 +60,24 @@ SectionVendorTokens."sof_ssp_tokens" { SOF_TKN_INTEL_SSP_BCLK_KEEP_ACTIVE "501" SOF_TKN_INTEL_SSP_FS_KEEP_ACTIVE "502" } + +SectionVendorTokens."sof_dmic_tokens" { + SOF_TKN_INTEL_DMIC_DRIVER_VERSION "600" + SOF_TKN_INTEL_DMIC_CLK_MIN "601" + SOF_TKN_INTEL_DMIC_CLK_MAX "602" + SOF_TKN_INTEL_DMIC_DUTY_MIN "603" + SOF_TKN_INTEL_DMIC_DUTY_MAX "604" + SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE "605" + SOF_TKN_INTEL_DMIC_SAMPLE_RATE "608" + SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH "609" +} + +SectionVendorTokens."sof_dmic_pdm_tokens" { + SOF_TKN_INTEL_DMIC_PDM_CTRL_ID "700" + SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable "701" + SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable "702" + SOF_TKN_INTEL_DMIC_PDM_POLARITY_A "703" + SOF_TKN_INTEL_DMIC_PDM_POLARITY_B "704" + SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE "705" + SOF_TKN_INTEL_DMIC_PDM_SKEW "706" +}
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/test/{test-ssp.m4 => test-all.m4} | 0 .../test/{test-capture-ssp.m4 => test-capture.m4} | 0 .../test/{test-playback-ssp.m4 => test-playback.m4} | 0 ...t-tone-playback-ssp.m4 => test-tone-playback.m4} | 0 topology/test/tplg-build.sh | 13 +++++++++---- 5 files changed, 9 insertions(+), 4 deletions(-) rename topology/test/{test-ssp.m4 => test-all.m4} (100%) rename topology/test/{test-capture-ssp.m4 => test-capture.m4} (100%) rename topology/test/{test-playback-ssp.m4 => test-playback.m4} (100%) rename topology/test/{test-tone-playback-ssp.m4 => test-tone-playback.m4} (100%)
diff --git a/topology/test/test-ssp.m4 b/topology/test/test-all.m4 similarity index 100% rename from topology/test/test-ssp.m4 rename to topology/test/test-all.m4 diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture.m4 similarity index 100% rename from topology/test/test-capture-ssp.m4 rename to topology/test/test-capture.m4 diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback.m4 similarity index 100% rename from topology/test/test-playback-ssp.m4 rename to topology/test/test-playback.m4 diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback.m4 similarity index 100% rename from topology/test/test-tone-playback-ssp.m4 rename to topology/test/test-tone-playback.m4 diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 4c33819..a48a3e2 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,9 +12,9 @@ export M4PATH="../:../m4:../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 -DMIC_TEST=test-capture-ssp +SIMPLE_TESTS=(test-all test-capture test-playback) +TONE_TEST=test-tone-playback +DMIC_TEST=test-capture TEST_STRINGS="" M4_STRINGS="" # process m4 simple tests - @@ -40,12 +40,17 @@ function simple_test { fi for i in ${TESTS[@]} do - TFILE="$i$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" if [ "$USE_XARGS" == "yes" ] then #if DAI type is SSP, define the SSP specific params if [ $5 == "SSP" ] then + if [ $i == "test-all" ] + then + TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" + else + TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" + fi #create input string for batch m4 processing M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\ -DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\
This patch adds the dmic test case to the tplg generating script.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/test/tplg-build.sh | 106 +++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 38 deletions(-)
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index a48a3e2..fadf7f5 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -37,51 +37,77 @@ function simple_test { if [ $5 == "SSP" ] then TESTS=("${!13}") + elif [ $5 == "DMIC" ] + then + TESTS=("${!15}") fi for i in ${TESTS[@]} do - if [ "$USE_XARGS" == "yes" ] + if [ $5 == "DMIC" ] then - #if DAI type is SSP, define the SSP specific params - if [ $5 == "SSP" ] + TFILE="$i-dmic$6-$2-$4-$7-48k-$1" + echo "M4 pre-processing test $i -> ${TFILE}" + m4 ${M4_FLAGS} \ + -DTEST_PIPE_NAME="$2" \ + -DTEST_DAI_LINK_NAME="$3" \ + -DTEST_DAI_PORT=$6 \ + -DTEST_DAI_FORMAT=$7 \ + -DTEST_PIPE_FORMAT=$4 \ + -DTEST_DAI_TYPE=$5 \ + -DTEST_DMIC_DRIVER_VERSION=$8 \ + -DTEST_DMIC_CLK_MIN=$9 \ + -DTEST_DMIC_CLK_MAX=${10} \ + -DTEST_DMIC_DUTY_MIN=${11} \ + -DTEST_DMIC_DUTY_MAX=${12} \ + -DTEST_PDM_ACTIVE=${13} \ + -DTEST_DMIC_SAMPLE_RATE=${14} \ + $i.m4 > ${TFILE}.conf + echo "Compiling test $i -> ${TFILE}.tplg" + alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg + else + if [ "$USE_XARGS" == "yes" ] then - if [ $i == "test-all" ] + #if DAI type is SSP, define the SSP specific params + if [ $5 == "SSP" ] then - TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" - else - TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" + if [ $i == "test-all" ] + then + TFILE="test-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" + else + TFILE="$i-ssp$6-${12}-$2-$4-$7-48k-$((${11} / 1000))k-$1" + fi + #create input string for batch m4 processing + M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\ + -DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\ + -DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\ + -DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\ + -DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\ + -DTEST_DAI_TYPE=$5\ + $i.m4,${TFILE}," + #create input string for batch processing of conf files + TEST_STRINGS+=${TFILE}"," + fi + else + #if DAI type is SSP, define the SSP specific params + if [ $5 == "SSP" ] + then + echo "M4 pre-processing test $i -> ${TFILE}" + m4 ${M4_FLAGS} \ + -DTEST_PIPE_NAME="$2" \ + -DTEST_DAI_LINK_NAME="$3" \ + -DTEST_DAI_PORT=$6 \ + -DTEST_DAI_FORMAT=$7 \ + -DTEST_PIPE_FORMAT=$4 \ + -DTEST_SSP_BCLK=${10} \ + -DTEST_SSP_MCLK=${11} \ + -DTEST_SSP_PHY_BITS=$8 \ + -DTEST_SSP_DATA_BITS=$9 \ + -DTEST_SSP_MODE=${12} \ + -DTEST_DAI_TYPE=$5 \ + $i.m4 > ${TFILE}.conf + echo "Compiling test $i -> ${TFILE}.tplg" + alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg fi - #create input string for batch m4 processing - M4_STRINGS+="-DTEST_PIPE_NAME=$2,-DTEST_DAI_LINK_NAME=$3\ - -DTEST_DAI_PORT=$6,-DTEST_DAI_FORMAT=$7\ - -DTEST_PIPE_FORMAT=$4,-DTEST_SSP_BCLK=${10}\ - -DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\ - -DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\ - -DTEST_DAI_TYPE=$5\ - $i.m4,${TFILE}," - #create input string for batch processing of conf files - TEST_STRINGS+=${TFILE}"," - fi - else - #if DAI type is SSP, define the SSP specific params - if [ $5 == "SSP" ] - then - echo "M4 pre-processing test $i -> ${TFILE}" - m4 ${M4_FLAGS} \ - -DTEST_PIPE_NAME="$2" \ - -DTEST_DAI_LINK_NAME="$3" \ - -DTEST_DAI_PORT=$6 \ - -DTEST_DAI_FORMAT=$7 \ - -DTEST_PIPE_FORMAT=$4 \ - -DTEST_SSP_BCLK=${10} \ - -DTEST_SSP_MCLK=${11} \ - -DTEST_SSP_PHY_BITS=$8 \ - -DTEST_SSP_DATA_BITS=$9 \ - -DTEST_SSP_MODE=${12} \ - -DTEST_DAI_TYPE=$5 \ - $i.m4 > ${TFILE}.conf - echo "Compiling test $i -> ${TFILE}.tplg" - alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg fi fi done @@ -173,6 +199,10 @@ simple_test nocodec src "NoCodec" s24le SSP 4 s24le 25 24 2400000 24000000 I2S S # Tone test: Tone component only supports s32le currently simple_test codec tone "SSP2-Codec" s32le SSP 2 s16le 20 16 1920000 19200000 I2S TONE_TEST[@]
+#DMIC Test +simple_test nocodec passthrough "DMIC0" s32le DMIC 0 s32le 1 500000 4800000\ + 40 60 1 48000 DMIC_TEST[@] + if [ "$USE_XARGS" == "yes" ] then echo "Batch processing m4 files..."
This patch adds the DMIC config definition and the DMIC config entry in DAI config.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/dai.m4 | 59 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index 8a79ebc..a349a3c 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -160,16 +160,72 @@ define(`SSP_SAMPLE_BITS', `}' )
+dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b, +dnl clk_egde, skew) +define(`PDM_TUPLES', +` tuples."short.pdm$1" {' +` SOF_TKN_INTEL_DMIC_PDM_CTRL_ID' STR($1) +` SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable' STR($2) +` SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable' STR($3) +` SOF_TKN_INTEL_DMIC_PDM_POLARITY_A' STR($4) +` SOF_TKN_INTEL_DMIC_PDM_POLARITY_B' STR($5) +` SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE' STR($6) +` SOF_TKN_INTEL_DMIC_PDM_SKEW' STR($7) +` }' +) + +dnl PDM_CONFIG(type, idx, pdm tuples list) +define(`PDM_CONFIG', +`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_pdm_tuples" {' +` tokens "sof_dmic_pdm_tokens"' +$3 +`}' +) + +dnl DMIC currently only supports 16 bit or 32-bit word length +dnl DMIC_WORD_LENGTH(frame format) +define(`DMIC_WORD_LENGTH', +`ifelse($1, `s16le', 16, $1, `s32le', 32, `')') + +dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max, +dnl req pdm count, sample_rate, +dnl fifo word length, type, idx, pdm controller config) +define(`DMIC_CONFIG', +`SectionVendorTuples."'N_DAI_CONFIG($9$10)`_dmic_tuples" {' +` tokens "sof_dmic_tokens"' +` tuples."word" {' +` SOF_TKN_INTEL_DMIC_DRIVER_VERSION' STR($1) +` SOF_TKN_INTEL_DMIC_CLK_MIN' STR($2) +` SOF_TKN_INTEL_DMIC_CLK_MAX' STR($3) +` SOF_TKN_INTEL_DMIC_DUTY_MIN' STR($4) +` SOF_TKN_INTEL_DMIC_DUTY_MAX' STR($5) +` SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE' STR($6) +` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($7) +` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($8) +` }' +`}' +dnl PDM config for the number of active PDM controllers +$11 +`SectionData."'N_DAI_CONFIG($9$10)`_pdm_data" {' +` tuples "'N_DAI_CONFIG($9$10)`_pdm_tuples"' +`}' +`SectionData."'N_DAI_CONFIG($9$10)`_data" {' +` tuples "'N_DAI_CONFIG($9$10)`_dmic_tuples"' + +`}' +) + dnl DAI Config) define(`N_DAI_CONFIG', `DAICONFIG.'$1)
-dnl DAI_CONFIG(type, idx, link_id, name, ssp_config) +dnl DAI_CONFIG(type, idx, link_id, name, ssp_config/dmic_config) define(`DAI_CONFIG', `SectionHWConfig."'$1$2`" {' `' ` id "'$2`"' `' ` ifelse($1, `SSP', $5, `}')' +`ifelse($1, `DMIC', $5, `')' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' ` tokens "sof_dai_tokens"' ` tuples."string" {' @@ -191,6 +247,7 @@ define(`DAI_CONFIG', ` data [' ` "'N_DAI_CONFIG($1$2)`_data"' ` "'N_DAI_CONFIG($1$2)`_data_str"' +`ifelse($1, `DMIC',` "'N_DAI_CONFIG($1$2)`_pdm_data"', `')' ` ]' `}')
Add support for adding DMIC config for DMIC DAI type.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/test/test-capture.m4 | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/topology/test/test-capture.m4 b/topology/test/test-capture.m4 index 65a3bcd..bed59c4 100644 --- a/topology/test/test-capture.m4 +++ b/topology/test/test-capture.m4 @@ -69,10 +69,20 @@ PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2) # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_DAI_PORT # DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, - SSP_CONFIG(TEST_SSP_MODE, - DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), - DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), - DAI_CLOCK(fsync, 48000, codec_slave), - DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), - SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, - TEST_SSP_DATA_BITS))) + ifelse(TEST_DAI_TYPE, `SSP', + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS)), + TEST_DAI_TYPE, `DMIC', + DMIC_CONFIG(TEST_DMIC_DRIVER_VERSION,TEST_DMIC_CLK_MIN, + TEST_DMIC_CLK_MAX, TEST_DMIC_DUTY_MIN, + TEST_DMIC_DUTY_MAX, TEST_PDM_ACTIVE, + TEST_DMIC_SAMPLE_RATE, DMIC_WORD_LENGTH(TEST_DAI_FORMAT), + TEST_DAI_TYPE, TEST_DAI_PORT, + PDM_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, + LIST(`', PDM_TUPLES(0, 1, 1, 0, 0, 0, 0)))), + `'))
On Thu, 2018-05-31 at 10:34 -0700, Ranjani Sridharan wrote:
This patchset adds the changes required for multiple DAI types in topology. The main changes are as follows:
- The tplg build script was hardwired for SSP DAI type. Make changes to
accomodate other types. 2. Changes to DAI_CONFIG to accomodate more than just SSP type DAI. 3. The test m4 files similarly were hardwired for SSP. This patchset makes them DAI type agnostic 4. Add DMIC DAI type config definition 5. Add DMIC specific tokens. This is the preliminary version. More tokens will be added as needed. 6. Add DMIC test topology
v3 changes:
- Added an extra token for fifo word length
v4 changes:
- Added PDM controller tokens and the number of active PDM controllers are configurable in topology
v5 changes:
- rebased on top of latest master
Tested with:
APL based Up squared board:
SOF Kernel: https://github.com/ranj063/sound branch: topic/dmic SOF: https://github.com/ranj063/sof branch: ranjani/topic/dmic SOFT: master
All applied.
Thanks
Liam
participants (2)
-
Liam Girdwood
-
Ranjani Sridharan