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 --- topology/m4/dai.m4 | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index e635caf..13fee68 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -160,16 +160,46 @@ define(`SSP_SAMPLE_BITS', `}' )
+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, pdm 0 enable, pdm 1 enable, sample_rate, +dnl fifo word length, type, idx) +define(`DMIC_CONFIG', +`SectionVendorTuples."'N_DAI_CONFIG($11$12)`_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_REQUESTED_PDM_COUNT' STR($6) +` SOF_TKN_INTEL_DMIC_PDM_0_ENABLE' STR($7) +` SOF_TKN_INTEL_DMIC_PDM_1_ENABLE' STR($8) +` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($9) +` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($10) +` }' +`}' +`SectionData."'N_DAI_CONFIG($11$12)`_data" {' +` tuples "'N_DAI_CONFIG($11$12)`_tuples"' +`}' +) + dnl DAI Config) define(`N_DAI_CONFIG', `DAICONFIG.'$1)
-dnl DAI_CONFIG(type, idx, name, ssp_config) +dnl DAI_CONFIG(type, idx, name, ssp_config/dmic_config) define(`DAI_CONFIG', `SectionHWConfig."'$1$2`" {' `' ` id "'$2`"' `' ` ifelse($1, `SSP', $4, `}')' +`ifelse($1, `DMIC', $4, `')' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {' ` tokens "sof_dai_tokens"' ` tuples."string" {'