[Sound-open-firmware] [PATCH v2 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
Ranjani Sridharan (7): [RFC]topology: separate ssp params from dai common params [RFC]topology: scripts: changes to accomodate different DAI types [RFC]topology: add DMIC tokens [RFC]topology: make m4 filenames dai type agnostic [RFC]topology: scripts: add dmic test topology [RFC]topology: add DMIC config definition to DAI config [RFC]topology: add DMIC dai support in test capture m4
topology/m4/dai.m4 | 66 +++++-- topology/sof-apl-nocodec.m4 | 11 +- topology/sof-apl-tdf8532.m4 | 22 ++- 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 | 11 +- 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 | 14 ++ topology/test/{test-ssp.m4 => test-all.m4} | 39 ++-- .../{test-capture-ssp.m4 => test-capture.m4} | 39 ++-- ...{test-playback-ssp.m4 => test-playback.m4} | 31 +-- ...-playback-ssp.m4 => test-tone-playback.m4} | 25 +-- topology/test/tplg-build.sh | 182 +++++++++++------- 20 files changed, 339 insertions(+), 211 deletions(-) rename topology/test/{test-ssp.m4 => test-all.m4} (65%) rename topology/test/{test-capture-ssp.m4 => test-capture.m4} (55%) rename topology/test/{test-playback-ssp.m4 => test-playback.m4} (65%) rename topology/test/{test-tone-playback-ssp.m4 => test-tone-playback.m4} (65%)
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 | 44 +++++++++++++++---------- topology/sof-apl-nocodec.m4 | 11 ++++--- topology/sof-apl-tdf8532.m4 | 22 +++++++------ 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 | 11 ++++--- 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, 142 insertions(+), 108 deletions(-)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index 0b030af..e635caf 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, name, format, valid bits, mclk, bclk, fsync, tdm) +dnl DAI_CONFIG(type, idx, name, ssp_config) define(`DAI_CONFIG', `SectionHWConfig."'$1$2`" {' `' ` id "'$2`"' -` format "'$4`"' `' -` '$6 -` '$7 -` '$8 -` '$9 -`}' +` ifelse($1, `SSP', $4, `}')' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' ` tokens "sof_dai_tokens"' ` tuples."string" {' @@ -161,16 +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($5) -` }' -`}' -`SectionData."'N_DAI_CONFIG($1$2)`_data" {' -` tuples "'N_DAI_CONFIG($1$2)`_tuples"' -`}' -`' `SectionBE."'$3`" {' ` index "0"' ` default_hw_conf_id "'$2`"' diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4 index 9c4286b..bc72332 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, 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, 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 1ff0a0d..74309a2 100644 --- a/topology/sof-apl-tdf8532.m4 +++ b/topology/sof-apl-tdf8532.m4 @@ -76,14 +76,16 @@ PCM_DUPLEX_ADD(Port2, 4, 1, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 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, 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, 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, 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))) diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4 index a13a49c..1111556 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, 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, 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 007944a..95b5c96 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, 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, 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 ecf90c6..a741663 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, 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, 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 efa321b..e8bc380 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, 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, 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 ae54969..73deaca 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, 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, 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 364121f..0c28ab6 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, 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, 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 be3d994..3872b2f 100644 --- a/topology/sof-byt-rt5651.m4 +++ b/topology/sof-byt-rt5651.m4 @@ -93,9 +93,10 @@ 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, 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, 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 7ba4df7..85ba0cd 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, 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, 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 a0eb9cd..a76c59f 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, 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, 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 36cd91f..1a5ffae 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, 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, 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 85b8209..3c3a6d2 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, 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, 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 6d666dc..af486ab 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_SSP_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 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, 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 5ee1b53..a2068fe 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_SSP_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 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, 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 1bdce2f..b121e9a 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_SSP_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 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, 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 069ad64..6dba1fd 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_SSP_PORT # -DAI_CONFIG(SSP, TEST_SSP_PORT, 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, 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 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 af486ab..a1f283f 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(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, SSP_CONFIG(TEST_SSP_MODE, diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4 index a2068fe..a5a2406 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(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, SSP_CONFIG(TEST_SSP_MODE, diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index b121e9a..6b975c2 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(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, SSP_CONFIG(TEST_SSP_MODE, diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback-ssp.m4 index 6dba1fd..276ab2f 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(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, SSP_CONFIG(TEST_SSP_MODE, diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 26c70ad..b4bf364 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 introduces the DMIC specific config parameter tokens in topology.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/sof/tokens.m4 | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index e9aa302..ab3b812 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -60,3 +60,17 @@ 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_REQUESTED_PDM_COUNT "605" + SOF_TKN_INTEL_DMIC_PDM_0_ENABLE "606" + SOF_TKN_INTEL_DMIC_PDM_1_ENABLE "607" + SOF_TKN_INTEL_DMIC_SAMPLE_RATE "608" +} + +
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 b4bf364..8c31213 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 | 107 +++++++++++++++++++++++------------- 1 file changed, 69 insertions(+), 38 deletions(-)
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 8c31213..004e8b1 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -37,51 +37,79 @@ function simple_test { if [ $5 == "SSP" ] then TESTS=("${!13}") + elif [ $5 == "DMIC" ] + then + TESTS=("${!17}") 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_DMIC_REQUESTED_PDM_COUNT=${13} \ + -DTEST_DMIC_PDM_0_ENABLE=${14} \ + -DTEST_DMIC_PDM_1_ENABLE=${15} \ + -DTEST_DMIC_SAMPLE_RATE=${16} \ + $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 +201,9 @@ 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 2 1 0 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 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index e635caf..f9a9c34 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -160,16 +160,38 @@ define(`SSP_SAMPLE_BITS', `}' )
+dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max, req_pdm_count, pdm 0 enable, pdm 1 enable, smaple_rate, type, idx) +define(`DMIC_CONFIG', +`SectionVendorTuples."'N_DAI_CONFIG($10$11)`_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_REQUESTED_PDM_COUNT' STR($6) +` SOF_TKN_INTEL_DMIC_PDM_0_ENABLE' STR($7) +` SOF_TKN_INTEL_DMIC_PDM_1_ENABLE' STR($8) +` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($9) +` }' +`}' +`SectionData."'N_DAI_CONFIG($10$11)`_data" {' +` tuples "'N_DAI_CONFIG($10$11)`_tuples"' +`}' +) + dnl DAI Config) define(`N_DAI_CONFIG', `DAICONFIG.'$1)
-dnl DAI_CONFIG(type, idx, name, ssp_config) +dnl DAI_CONFIG(type, idx, name, ssp_config/dmic_config) define(`DAI_CONFIG', `SectionHWConfig."'$1$2`" {' `' ` id "'$2`"' `' ` ifelse($1, `SSP', $4, `}')' +`ifelse($1, `DMIC', $4, `')' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' ` tokens "sof_dai_tokens"' ` tuples."string" {'
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 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/topology/test/test-capture.m4 b/topology/test/test-capture.m4 index a1f283f..33e6517 100644 --- a/topology/test/test-capture.m4 +++ b/topology/test/test-capture.m4 @@ -69,10 +69,18 @@ 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, 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_DMIC_REQUESTED_PDM_COUNT, + TEST_DMIC_PDM_0_ENABLE, TEST_DMIC_PDM_1_ENABLE, + TEST_DMIC_SAMPLE_RATE, TEST_DAI_TYPE, TEST_DAI_PORT), + `'))
participants (1)
-
Ranjani Sridharan