From 1adb92ab2e39969d6e8e7f43e7d4e71e37ffcfb1 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Sun, 24 Jun 2018 22:03:16 -0700 Subject: [PATCH] topology: dai: rename sample_bits macro to config_data Rename SAMPLE_BITS macro to a more generic CONFIG_DATA macro for SSP to also include the mclk id. Also modify users of the macro with the new name. Signed-off-by: Ranjani Sridharan --- topology/m4/dai.m4 | 14 +++++++++----- topology/sof-apl-nocodec.m4 | 2 +- topology/sof-apl-tdf8532.m4 | 12 ++++++------ topology/sof-bdw-rt286.m4 | 2 +- topology/sof-bdw-rt5640.m4 | 2 +- topology/sof-byt-da7213.m4 | 2 +- topology/sof-byt-nocodec.m4 | 2 +- topology/sof-byt-rt5640.m4 | 2 +- topology/sof-byt-rt5645.m4 | 2 +- topology/sof-byt-rt5651.m4 | 2 +- topology/sof-cht-max98090.m4 | 2 +- topology/sof-cht-nocodec.m4 | 2 +- topology/sof-cnl-rt274.m4 | 2 +- topology/sof-hsw-rt5640.m4 | 2 +- topology/test/test-all.m4 | 2 +- topology/test/test-capture.m4 | 2 +- topology/test/test-playback.m4 | 2 +- topology/test/test-tone-playback.m4 | 2 +- 18 files changed, 31 insertions(+), 27 deletions(-) diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index bd67413..882d958 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -134,7 +134,7 @@ define(`DAI_TDM', ` tx_slots 'STR($3) ` rx_slots 'STR($4) ) -dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp sample bits) +dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data) define(`SSP_CONFIG', ` format "'$1`"' ` '$2 @@ -145,12 +145,16 @@ define(`SSP_CONFIG', $6 ) -dnl SSP_SAMPLE_BITS(type, idx, valid bits) -define(`SSP_SAMPLE_BITS', +dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id) +dnl mclk_id is optional +define(`SSP_CONFIG_DATA', `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {' -` tokens "sof_dai_tokens"' +` tokens "sof_ssp_tokens"' ` tuples."word" {' -` SOF_TKN_DAI_SAMPLE_BITS' STR($3) +` SOF_TKN_INTEL_SSP_SAMPLE_BITS' STR($3) +` }' +` tuples."short" {' +` SOF_TKN_INTEL_SSP_MCLK_ID' ifelse($4, `', "0", STR($4)) ` }' `}' `SectionData."'N_DAI_CONFIG($1$2)`_data" {' diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4 index 32a3b86..0698b42 100644 --- a/topology/sof-apl-nocodec.m4 +++ b/topology/sof-apl-nocodec.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, NoCodec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-apl-tdf8532.m4 b/topology/sof-apl-tdf8532.m4 index a0b44e2..b913d42 100644 --- a/topology/sof-apl-tdf8532.m4 +++ b/topology/sof-apl-tdf8532.m4 @@ -183,42 +183,42 @@ DAI_CONFIG(SSP, 4, 4, SSP4-Codec, DAI_CLOCK(bclk, 12288000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(8, 32, 15, 15), - SSP_SAMPLE_BITS(SSP, 4, 32))) + SSP_CONFIG_DATA(SSP, 4, 32))) DAI_CONFIG(SSP, 2, 2, SSP2-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(2, 32, 255, 255), - SSP_SAMPLE_BITS(SSP, 2, 32))) + SSP_CONFIG_DATA(SSP, 2, 32))) 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))) + SSP_CONFIG_DATA(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))) + SSP_CONFIG_DATA(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))) + SSP_CONFIG_DATA(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))) + SSP_CONFIG_DATA(SSP, 5, 16))) VIRTUAL_DAPM_ROUTE_IN(BtHfp_ssp0_in, SSP, 0, IN, 0) diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4 index d1ef535..e1f5bfb 100644 --- a/topology/sof-bdw-rt286.m4 +++ b/topology/sof-bdw-rt286.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 0, 0, Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 0, 24))) + SSP_CONFIG_DATA(SSP, 0, 24))) diff --git a/topology/sof-bdw-rt5640.m4 b/topology/sof-bdw-rt5640.m4 index 258ecc4..cd95550 100644 --- a/topology/sof-bdw-rt5640.m4 +++ b/topology/sof-bdw-rt5640.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 0, 0, Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 0, 24))) + SSP_CONFIG_DATA(SSP, 0, 24))) diff --git a/topology/sof-byt-da7213.m4 b/topology/sof-byt-da7213.m4 index a89e51b..a8c5c01 100644 --- a/topology/sof-byt-da7213.m4 +++ b/topology/sof-byt-da7213.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, SSP2-Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-byt-nocodec.m4 b/topology/sof-byt-nocodec.m4 index b305d27..ac4af79 100644 --- a/topology/sof-byt-nocodec.m4 +++ b/topology/sof-byt-nocodec.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, NoCodec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-byt-rt5640.m4 b/topology/sof-byt-rt5640.m4 index aafa10f..19eca6d 100644 --- a/topology/sof-byt-rt5640.m4 +++ b/topology/sof-byt-rt5640.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, SSP2-Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-byt-rt5645.m4 b/topology/sof-byt-rt5645.m4 index 415bc0a..2c0eac5 100644 --- a/topology/sof-byt-rt5645.m4 +++ b/topology/sof-byt-rt5645.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, SSP2-Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-byt-rt5651.m4 b/topology/sof-byt-rt5651.m4 index 14e45c0..4397b3b 100644 --- a/topology/sof-byt-rt5651.m4 +++ b/topology/sof-byt-rt5651.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, SSP2-Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-cht-max98090.m4 b/topology/sof-cht-max98090.m4 index e02056c..5a3a895 100644 --- a/topology/sof-cht-max98090.m4 +++ b/topology/sof-cht-max98090.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, SSP2-Codec, DAI_CLOCK(bclk, 1920000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 20, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 16))) + SSP_CONFIG_DATA(SSP, 2, 16))) diff --git a/topology/sof-cht-nocodec.m4 b/topology/sof-cht-nocodec.m4 index f56a7a5..cfb2453 100644 --- a/topology/sof-cht-nocodec.m4 +++ b/topology/sof-cht-nocodec.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 2, 0, NoCodec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 2, 24))) + SSP_CONFIG_DATA(SSP, 2, 24))) diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4 index a805f9e..66bd3a0 100644 --- a/topology/sof-cnl-rt274.m4 +++ b/topology/sof-cnl-rt274.m4 @@ -67,7 +67,7 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, DAI_CLOCK(bclk, 4800000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(4, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 0, 24))) + SSP_CONFIG_DATA(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 c99f39b..f839fc3 100644 --- a/topology/sof-hsw-rt5640.m4 +++ b/topology/sof-hsw-rt5640.m4 @@ -95,4 +95,4 @@ DAI_CONFIG(SSP, 0, 0, Codec, DAI_CLOCK(bclk, 2400000, codec_slave), DAI_CLOCK(fsync, 48000, codec_slave), DAI_TDM(2, 25, 3, 3), - SSP_SAMPLE_BITS(SSP, 0, 24))) + SSP_CONFIG_DATA(SSP, 0, 24))) diff --git a/topology/test/test-all.m4 b/topology/test/test-all.m4 index 2a4dae4..00318b0 100644 --- a/topology/test/test-all.m4 +++ b/topology/test/test-all.m4 @@ -90,5 +90,5 @@ DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, 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, + SSP_CONFIG_DATA(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_SSP_DATA_BITS))) diff --git a/topology/test/test-capture.m4 b/topology/test/test-capture.m4 index 7e5ca86..9d85009 100644 --- a/topology/test/test-capture.m4 +++ b/topology/test/test-capture.m4 @@ -74,7 +74,7 @@ DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, 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, + SSP_CONFIG_DATA(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_SSP_DATA_BITS)), TEST_DAI_TYPE, `DMIC', DMIC_CONFIG(TEST_DMIC_DRIVER_VERSION,TEST_DMIC_CLK_MIN, diff --git a/topology/test/test-playback.m4 b/topology/test/test-playback.m4 index ade8a8e..d607d3a 100644 --- a/topology/test/test-playback.m4 +++ b/topology/test/test-playback.m4 @@ -73,5 +73,5 @@ DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, 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, + SSP_CONFIG_DATA(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_SSP_DATA_BITS))) diff --git a/topology/test/test-tone-playback.m4 b/topology/test/test-tone-playback.m4 index 1c38c09..5248427 100644 --- a/topology/test/test-tone-playback.m4 +++ b/topology/test/test-tone-playback.m4 @@ -62,5 +62,5 @@ DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, 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, + SSP_CONFIG_DATA(TEST_DAI_TYPE, TEST_DAI_PORT, TEST_SSP_DATA_BITS)))