[Sound-open-firmware] [PATCH 2/3] topology: modify ssp config definition to add the tuple for mclk id

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Thu Jun 21 06:39:06 CEST 2018


Rename the SSP_SAMPLE_BITS() macro to a more generic SSP_CONFIG_DATA()
so as to be able to pass both the sample valid bits and the mclk
id. And also add the tuple of clk id to the SSP DAI config.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
 topology/m4/dai.m4 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4
index bd67413..88e96c0 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,8 +145,23 @@ define(`SSP_CONFIG',
 $6
 )
 
-dnl SSP_SAMPLE_BITS(type, idx, valid bits)
-define(`SSP_SAMPLE_BITS',
+dnl SSP_MCLK_ID(type, idx, mclk_id)
+dnl default value for mclk_id is 0
+define(`SSP_MCLK_ID',
+`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_ssp_tuples" {'
+`	tokens "sof_ssp_tokens"'
+`	tuples."short" {'
+`		SOF_TKN_INTEL_SSP_MCLK_ID'	ifelse($3, `', "0", STR($3))
+`	}'
+`}'
+`SectionData."'N_DAI_CONFIG($1$2)`_ssp_data" {'
+`	tuples "'N_DAI_CONFIG($1$2)`_ssp_tuples"'
+`}'
+)
+
+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"'
 `	tuples."word" {'
@@ -156,6 +171,7 @@ define(`SSP_SAMPLE_BITS',
 `SectionData."'N_DAI_CONFIG($1$2)`_data" {'
 `	tuples "'N_DAI_CONFIG($1$2)`_tuples"'
 `}'
+`SSP_MCLK_ID($1, $2, $4)'
 )
 
 dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b,
@@ -246,6 +262,7 @@ define(`DAI_CONFIG',
 `		"'N_DAI_CONFIG($1$2)`_data"'
 `		"'N_DAI_CONFIG($1$2)`_data_str"'
 `ifelse($1, `DMIC',`		"'N_DAI_CONFIG($1$2)`_pdm_data"', `')'
+`ifelse($1, `SSP',`		"'N_DAI_CONFIG($1$2)`_ssp_data"', `')'
 `	]'
 `}')
 
-- 
2.17.1



More information about the Sound-open-firmware mailing list