[Sound-open-firmware] [PATCH] topology: ssp: add TEST_SSP_MODE for ssp to support more modes
Keqiao.Zhang
keqiao.zhang at linux.intel.com
Fri Mar 30 08:57:37 CEST 2018
Signed-off-by: Keqiao.Zhang <keqiao.zhang at linux.intel.com>
---
topology/test/test-capture-ssp.m4 | 3 +-
topology/test/test-playback-ssp.m4 | 3 +-
topology/test/test-ssp.m4 | 3 +-
topology/test/tplg-build.sh | 69 ++++++++++++++++++++------------------
4 files changed, 42 insertions(+), 36 deletions(-)
diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4
index 3d10d7a..78b6479 100644
--- a/topology/test/test-capture-ssp.m4
+++ b/topology/test/test-capture-ssp.m4
@@ -28,6 +28,7 @@ include(`dsps/byt.m4')
# TEST_SSP_BCLK - SSP BCLK in Hz
# TEST_SSP_PHY_BITS - SSP physical slot size
# TEST_SSP_DATA_BITS - SSP data slot size
+# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B
#
#
@@ -67,7 +68,7 @@ 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_SSP_PORT
#
-DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS,
+DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
DAI_CLOCK(fsync, 48000, slave),
diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4
index ab775a4..e4b09ec 100644
--- a/topology/test/test-playback-ssp.m4
+++ b/topology/test/test-playback-ssp.m4
@@ -28,6 +28,7 @@ include(`dsps/byt.m4')
# TEST_SSP_BCLK - SSP BCLK in Hz
# TEST_SSP_PHY_BITS - SSP physical slot size
# TEST_SSP_DATA_BITS - SSP data slot size
+# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B
#
#
@@ -67,7 +68,7 @@ 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_SSP_PORT
#
-DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS,
+DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
DAI_CLOCK(fsync, 48000, slave),
diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4
index fa5fd29..676e19b 100644
--- a/topology/test/test-ssp.m4
+++ b/topology/test/test-ssp.m4
@@ -28,6 +28,7 @@ include(`dsps/byt.m4')
# TEST_SSP_BCLK - SSP BCLK in Hz
# TEST_SSP_PHY_BITS - SSP physical slot size
# TEST_SSP_DATA_BITS - SSP data slot size
+# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B
#
#
@@ -85,7 +86,7 @@ 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_SSP_PORT
#
-DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS,
+DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
DAI_CLOCK(fsync, 48000, slave),
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh
index 5a6a8f5..96f3f9f 100755
--- a/topology/test/tplg-build.sh
+++ b/topology/test/tplg-build.sh
@@ -28,11 +28,13 @@ TONE_TEST=test-tone-playback-ssp
# 8) dai_data_bits - SSP number of valid data bits per slot/channel
# 9) dai_bclk - SSP BCLK in HZ
# 10) dai_mclk - SSP MCLK in HZ
+# 11) SSP mode - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B
#
+
function simple_test {
for i in ${SIMPLE_TESTS[@]}
do
- TFILE="$i$5-$2-$4-$6-48k-$1"
+ TFILE="$i$5-${11}-$2-$4-$6-48k-$1"
echo "M4 pre-processing test $i -> ${TFILE}"
m4 ${M4_FLAGS} \
-DTEST_PIPE_NAME="$2" \
@@ -44,6 +46,7 @@ function simple_test {
-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
@@ -82,43 +85,43 @@ function tone_test {
}
# Pre-process the simple tests
-simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 19200000
-simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 19200000
-simple_test nocodec volume "NoCodec" s16le 2 s16le 20 16 1920000 19200000
-simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 19200000
-simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 19200000
-simple_test nocodec src "NoCodec" s24le 2 s24le 25 24 2400000 19200000
+simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 19200000 I2S
+simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 19200000 I2S
+simple_test nocodec volume "NoCodec" s16le 2 s16le 20 16 1920000 19200000 I2S
+simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 19200000 I2S
+simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 19200000 I2S
+simple_test nocodec src "NoCodec" s24le 2 s24le 25 24 2400000 19200000 I2S
-simple_test codec passthrough "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000
-simple_test codec passthrough "SSP2-Codec" s24le 2 s16le 20 16 1920000 19200000
-simple_test codec passthrough "SSP2-Codec" s16le 2 s24le 25 24 2400000 19200000
-simple_test codec passthrough "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000
-simple_test codec volume "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000
-simple_test codec volume "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000
-simple_test codec volume "SSP2-Codec" s24le 2 s16le 20 16 1920000 19200000
-simple_test codec volume "SSP2-Codec" s16le 2 s24le 25 24 2400000 19200000
-simple_test codec src "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000
+simple_test codec passthrough "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000 I2S
+simple_test codec passthrough "SSP2-Codec" s24le 2 s16le 20 16 1920000 19200000 I2S
+simple_test codec passthrough "SSP2-Codec" s16le 2 s24le 25 24 2400000 19200000 I2S
+simple_test codec passthrough "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 I2S
+simple_test codec volume "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000 I2S
+simple_test codec volume "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 I2S
+simple_test codec volume "SSP2-Codec" s24le 2 s16le 20 16 1920000 19200000 I2S
+simple_test codec volume "SSP2-Codec" s16le 2 s24le 25 24 2400000 19200000 I2S
+simple_test codec src "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 I2S
# for APL
-simple_test nocodec volume "NoCodec" s16le 4 s16le 16 16 1536000 24576000
-simple_test nocodec volume "NoCodec" s24le 4 s16le 16 16 1536000 24576000
-simple_test nocodec volume "NoCodec" s32le 4 s16le 16 16 1536000 24576000
-simple_test nocodec volume "NoCodec" s16le 4 s24le 32 24 3072000 24576000
-simple_test nocodec volume "NoCodec" s24le 4 s24le 32 24 3072000 24576000
-simple_test nocodec volume "NoCodec" s32le 4 s24le 32 24 3072000 24576000
-simple_test nocodec volume "NoCodec" s16le 4 s32le 32 32 3072000 24576000
-simple_test nocodec volume "NoCodec" s24le 4 s32le 32 32 3072000 24576000
-simple_test nocodec volume "NoCodec" s32le 4 s32le 32 32 3072000 24576000
-simple_test codec volume "SSP4-Codec" s16le 4 s16le 16 16 1536000 24576000
-simple_test nocodec volume "NoCodec" s16le 5 s16le 16 16 1536000 24576000
-simple_test nocodec src "NoCodec" s24le 4 s24le 32 24 3072000 24576000
+simple_test nocodec volume "NoCodec" s16le 4 s16le 16 16 1536000 24576000 I2S
+simple_test nocodec volume "NoCodec" s24le 4 s16le 16 16 1536000 24576000 I2S
+simple_test nocodec volume "NoCodec" s32le 4 s16le 16 16 1536000 24576000 I2S
+simple_test nocodec volume "NoCodec" s16le 4 s24le 32 24 3072000 24576000 I2S
+simple_test nocodec volume "NoCodec" s24le 4 s24le 32 24 3072000 24576000 I2S
+simple_test nocodec volume "NoCodec" s32le 4 s24le 32 24 3072000 24576000 I2S
+simple_test nocodec volume "NoCodec" s16le 4 s32le 32 32 3072000 24576000 I2S
+simple_test nocodec volume "NoCodec" s24le 4 s32le 32 32 3072000 24576000 I2S
+simple_test nocodec volume "NoCodec" s32le 4 s32le 32 32 3072000 24576000 I2S
+simple_test codec volume "SSP4-Codec" s16le 4 s16le 16 16 1536000 24576000 I2S
+simple_test nocodec volume "NoCodec" s16le 5 s16le 16 16 1536000 24576000 I2S
+simple_test nocodec src "NoCodec" s24le 4 s24le 32 24 3072000 24576000 I2S
# for CNL
-simple_test nocodec volume "NoCodec" s16le 2 s16le 25 16 2400000 24000000
-simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 24000000
-simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 24000000
-simple_test nocodec volume "NoCodec" s24le 2 s16le 25 16 2400000 24000000
-simple_test nocodec src "NoCodec" s24le 4 s24le 25 24 2400000 24000000
+simple_test nocodec volume "NoCodec" s16le 2 s16le 25 16 2400000 24000000 I2S
+simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 24000000 I2S
+simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 24000000 I2S
+simple_test nocodec volume "NoCodec" s24le 2 s16le 25 16 2400000 24000000 I2S
+simple_test nocodec src "NoCodec" s24le 4 s24le 25 24 2400000 24000000 I2S
# Tone test: Tone component only supports s32le currently
tone_test codec tone "SSP2-Codec" s32le 2 s16le 20 16 1920000 19200000
--
2.11.0
More information about the Sound-open-firmware
mailing list