Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Commit 082f971

Browse files
ranj063lrgirdwo
authored andcommitted
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>
1 parent d6e201c commit 082f971

1 file changed

Lines changed: 58 additions & 1 deletion

File tree

topology/m4/dai.m4

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,72 @@ define(`SSP_SAMPLE_BITS',
160160
`}'
161161
)
162162

163+
dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b,
164+
dnl clk_egde, skew)
165+
define(`PDM_TUPLES',
166+
` tuples."short.pdm$1" {'
167+
` SOF_TKN_INTEL_DMIC_PDM_CTRL_ID' STR($1)
168+
` SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable' STR($2)
169+
` SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable' STR($3)
170+
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_A' STR($4)
171+
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_B' STR($5)
172+
` SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE' STR($6)
173+
` SOF_TKN_INTEL_DMIC_PDM_SKEW' STR($7)
174+
` }'
175+
)
176+
177+
dnl PDM_CONFIG(type, idx, pdm tuples list)
178+
define(`PDM_CONFIG',
179+
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_pdm_tuples" {'
180+
` tokens "sof_dmic_pdm_tokens"'
181+
$3
182+
`}'
183+
)
184+
185+
dnl DMIC currently only supports 16 bit or 32-bit word length
186+
dnl DMIC_WORD_LENGTH(frame format)
187+
define(`DMIC_WORD_LENGTH',
188+
`ifelse($1, `s16le', 16, $1, `s32le', 32, `')')
189+
190+
dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max,
191+
dnl req pdm count, sample_rate,
192+
dnl fifo word length, type, idx, pdm controller config)
193+
define(`DMIC_CONFIG',
194+
`SectionVendorTuples."'N_DAI_CONFIG($9$10)`_dmic_tuples" {'
195+
` tokens "sof_dmic_tokens"'
196+
` tuples."word" {'
197+
` SOF_TKN_INTEL_DMIC_DRIVER_VERSION' STR($1)
198+
` SOF_TKN_INTEL_DMIC_CLK_MIN' STR($2)
199+
` SOF_TKN_INTEL_DMIC_CLK_MAX' STR($3)
200+
` SOF_TKN_INTEL_DMIC_DUTY_MIN' STR($4)
201+
` SOF_TKN_INTEL_DMIC_DUTY_MAX' STR($5)
202+
` SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE' STR($6)
203+
` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($7)
204+
` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($8)
205+
` }'
206+
`}'
207+
dnl PDM config for the number of active PDM controllers
208+
$11
209+
`SectionData."'N_DAI_CONFIG($9$10)`_pdm_data" {'
210+
` tuples "'N_DAI_CONFIG($9$10)`_pdm_tuples"'
211+
`}'
212+
`SectionData."'N_DAI_CONFIG($9$10)`_data" {'
213+
` tuples "'N_DAI_CONFIG($9$10)`_dmic_tuples"'
214+
215+
`}'
216+
)
217+
163218
dnl DAI Config)
164219
define(`N_DAI_CONFIG', `DAICONFIG.'$1)
165220

166-
dnl DAI_CONFIG(type, idx, link_id, name, ssp_config)
221+
dnl DAI_CONFIG(type, idx, link_id, name, ssp_config/dmic_config)
167222
define(`DAI_CONFIG',
168223
`SectionHWConfig."'$1$2`" {'
169224
`'
170225
` id "'$2`"'
171226
`'
172227
` ifelse($1, `SSP', $5, `}')'
228+
`ifelse($1, `DMIC', $5, `')'
173229
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {'
174230
` tokens "sof_dai_tokens"'
175231
` tuples."string" {'
@@ -191,6 +247,7 @@ define(`DAI_CONFIG',
191247
` data ['
192248
` "'N_DAI_CONFIG($1$2)`_data"'
193249
` "'N_DAI_CONFIG($1$2)`_data_str"'
250+
`ifelse($1, `DMIC',` "'N_DAI_CONFIG($1$2)`_pdm_data"', `')'
194251
` ]'
195252
`}')
196253

0 commit comments

Comments
 (0)