[Sound-open-firmware] [PATCH] topology: separate ssp params from dai common params
Ranjani Sridharan
ranjani.sridharan at linux.intel.com
Mon May 21 19:38:46 CEST 2018
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 at linux.intel.com>
---
topology/m4/dai.m4 | 17 ++++++++++-------
topology/sof-apl-nocodec.m4 | 8 ++++----
topology/sof-apl-tdf8532.m4 | 16 ++++++++--------
topology/sof-bdw-rt286.m4 | 8 ++++----
topology/sof-bdw-rt5640.m4 | 8 ++++----
topology/sof-byt-da7213.m4 | 8 ++++----
topology/sof-byt-nocodec.m4 | 8 ++++----
topology/sof-byt-rt5640.m4 | 8 ++++----
topology/sof-byt-rt5645.m4 | 8 ++++----
topology/sof-byt-rt5651.m4 | 8 ++++----
topology/sof-cht-max98090.m4 | 8 ++++----
topology/sof-cht-nocodec.m4 | 8 ++++----
topology/sof-cnl-rt274.m4 | 8 ++++----
topology/sof-hsw-rt5640.m4 | 8 ++++----
topology/test/test-capture-ssp.m4 | 8 ++++----
topology/test/test-playback-ssp.m4 | 8 ++++----
topology/test/test-ssp.m4 | 8 ++++----
topology/test/test-tone-playback-ssp.m4 | 8 ++++----
18 files changed, 82 insertions(+), 79 deletions(-)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4
index 0b030af..781c762 100644
--- a/topology/m4/dai.m4
+++ b/topology/m4/dai.m4
@@ -131,27 +131,30 @@ 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(mclk, bclk, fsync, tdm)
+define(`SSP_CONFIG',
+` '$1
+` '$2
+` '$3
+` '$4
+`}')
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, format, valid bits, ssp_config)
define(`DAI_CONFIG',
`SectionHWConfig."'$1$2`" {'
`'
` id "'$2`"'
` format "'$4`"'
`'
-` '$6
-` '$7
-` '$8
-` '$9
-`}'
+` ifelse($1, `SSP', $6, `}')'
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {'
` tokens "sof_dai_tokens"'
` tuples."string" {'
diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4
index 9c4286b..1ae703c 100644
--- a/topology/sof-apl-nocodec.m4
+++ b/topology/sof-apl-nocodec.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-apl-tdf8532.m4 b/topology/sof-apl-tdf8532.m4
index 1ff0a0d..c8a5fa4 100644
--- a/topology/sof-apl-tdf8532.m4
+++ b/topology/sof-apl-tdf8532.m4
@@ -77,13 +77,13 @@ 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))
+ SSP_CONFIG(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, 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4
index a13a49c..25f0b04 100644
--- a/topology/sof-bdw-rt286.m4
+++ b/topology/sof-bdw-rt286.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-bdw-rt5640.m4 b/topology/sof-bdw-rt5640.m4
index 007944a..6e09617 100644
--- a/topology/sof-bdw-rt5640.m4
+++ b/topology/sof-bdw-rt5640.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-byt-da7213.m4 b/topology/sof-byt-da7213.m4
index ecf90c6..47034e4 100644
--- a/topology/sof-byt-da7213.m4
+++ b/topology/sof-byt-da7213.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-byt-nocodec.m4 b/topology/sof-byt-nocodec.m4
index efa321b..fa5b308 100644
--- a/topology/sof-byt-nocodec.m4
+++ b/topology/sof-byt-nocodec.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-byt-rt5640.m4 b/topology/sof-byt-rt5640.m4
index ae54969..997aee5 100644
--- a/topology/sof-byt-rt5640.m4
+++ b/topology/sof-byt-rt5640.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-byt-rt5645.m4 b/topology/sof-byt-rt5645.m4
index 364121f..73df875 100644
--- a/topology/sof-byt-rt5645.m4
+++ b/topology/sof-byt-rt5645.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-byt-rt5651.m4 b/topology/sof-byt-rt5651.m4
index be3d994..b28bcd2 100644
--- a/topology/sof-byt-rt5651.m4
+++ b/topology/sof-byt-rt5651.m4
@@ -94,8 +94,8 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-cht-max98090.m4 b/topology/sof-cht-max98090.m4
index 7ba4df7..eeb81b4 100644
--- a/topology/sof-cht-max98090.m4
+++ b/topology/sof-cht-max98090.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-cht-nocodec.m4 b/topology/sof-cht-nocodec.m4
index a0eb9cd..4774602 100644
--- a/topology/sof-cht-nocodec.m4
+++ b/topology/sof-cht-nocodec.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4
index 89d5a25..54dd8b8 100644
--- a/topology/sof-cnl-rt274.m4
+++ b/topology/sof-cnl-rt274.m4
@@ -65,7 +65,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/sof-hsw-rt5640.m4 b/topology/sof-hsw-rt5640.m4
index 85b8209..d11eb8d 100644
--- a/topology/sof-hsw-rt5640.m4
+++ b/topology/sof-hsw-rt5640.m4
@@ -94,7 +94,7 @@ 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))
+ SSP_CONFIG(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)))
diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4
index 6d666dc..3dc0c0e 100644
--- a/topology/test/test-capture-ssp.m4
+++ b/topology/test/test-capture-ssp.m4
@@ -69,7 +69,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, 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))
+ SSP_CONFIG(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)))
diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4
index 5ee1b53..cc10cfa 100644
--- a/topology/test/test-playback-ssp.m4
+++ b/topology/test/test-playback-ssp.m4
@@ -69,7 +69,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, 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))
+ SSP_CONFIG(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)))
diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4
index 1bdce2f..2e712c0 100644
--- a/topology/test/test-ssp.m4
+++ b/topology/test/test-ssp.m4
@@ -87,7 +87,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, 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))
+ SSP_CONFIG(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)))
diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback-ssp.m4
index 069ad64..ec43c93 100644
--- a/topology/test/test-tone-playback-ssp.m4
+++ b/topology/test/test-tone-playback-ssp.m4
@@ -57,7 +57,7 @@ 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))
+ SSP_CONFIG(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)))
--
2.17.0
More information about the Sound-open-firmware
mailing list