topology: add DMIC config definition to DAI config

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>
This commit is contained in:
Ranjani Sridharan 2018-05-31 10:34:47 -07:00 committed by Liam Girdwood
parent d6e201c961
commit 082f9714a9
1 changed files with 58 additions and 1 deletions

View File

@ -160,16 +160,72 @@ define(`SSP_SAMPLE_BITS',
`}' `}'
) )
dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b,
dnl clk_egde, skew)
define(`PDM_TUPLES',
` tuples."short.pdm$1" {'
` SOF_TKN_INTEL_DMIC_PDM_CTRL_ID' STR($1)
` SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable' STR($2)
` SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable' STR($3)
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_A' STR($4)
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_B' STR($5)
` SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE' STR($6)
` SOF_TKN_INTEL_DMIC_PDM_SKEW' STR($7)
` }'
)
dnl PDM_CONFIG(type, idx, pdm tuples list)
define(`PDM_CONFIG',
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_pdm_tuples" {'
` tokens "sof_dmic_pdm_tokens"'
$3
`}'
)
dnl DMIC currently only supports 16 bit or 32-bit word length
dnl DMIC_WORD_LENGTH(frame format)
define(`DMIC_WORD_LENGTH',
`ifelse($1, `s16le', 16, $1, `s32le', 32, `')')
dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max,
dnl req pdm count, sample_rate,
dnl fifo word length, type, idx, pdm controller config)
define(`DMIC_CONFIG',
`SectionVendorTuples."'N_DAI_CONFIG($9$10)`_dmic_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_NUM_PDM_ACTIVE' STR($6)
` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($7)
` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($8)
` }'
`}'
dnl PDM config for the number of active PDM controllers
$11
`SectionData."'N_DAI_CONFIG($9$10)`_pdm_data" {'
` tuples "'N_DAI_CONFIG($9$10)`_pdm_tuples"'
`}'
`SectionData."'N_DAI_CONFIG($9$10)`_data" {'
` tuples "'N_DAI_CONFIG($9$10)`_dmic_tuples"'
`}'
)
dnl DAI Config) dnl DAI Config)
define(`N_DAI_CONFIG', `DAICONFIG.'$1) define(`N_DAI_CONFIG', `DAICONFIG.'$1)
dnl DAI_CONFIG(type, idx, link_id, name, ssp_config) dnl DAI_CONFIG(type, idx, link_id, name, ssp_config/dmic_config)
define(`DAI_CONFIG', define(`DAI_CONFIG',
`SectionHWConfig."'$1$2`" {' `SectionHWConfig."'$1$2`" {'
`' `'
` id "'$2`"' ` id "'$2`"'
`' `'
` ifelse($1, `SSP', $5, `}')' ` ifelse($1, `SSP', $5, `}')'
`ifelse($1, `DMIC', $5, `')'
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {'
` tokens "sof_dai_tokens"' ` tokens "sof_dai_tokens"'
` tuples."string" {' ` tuples."string" {'
@ -191,6 +247,7 @@ define(`DAI_CONFIG',
` data [' ` data ['
` "'N_DAI_CONFIG($1$2)`_data"' ` "'N_DAI_CONFIG($1$2)`_data"'
` "'N_DAI_CONFIG($1$2)`_data_str"' ` "'N_DAI_CONFIG($1$2)`_data_str"'
`ifelse($1, `DMIC',` "'N_DAI_CONFIG($1$2)`_pdm_data"', `')'
` ]' ` ]'
`}') `}')