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

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Jun 21 13:18:20 CEST 2018


On Wed, 2018-06-20 at 21:39 -0700, Ranjani Sridharan wrote:
> 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>

This is all fine, but we should move all the ssp specific macros to ssp.m4 and
dmic to dmic.m4

looking closer at the directory structure we should probably align with the
firmware and then 

1) rename dsps -> platform
2) create platform/intel subdir and copy hsw.m4, cnl.m4, byt.m4 etc to this
subdir.
3) create platform/intel/commom and create ssp.m4 here
4) create platform/intel/cavs and create dmic.m4 here.

Liam

> ---
>  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"', `')'
>  `	]'
>  `}')
>  


More information about the Sound-open-firmware mailing list