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

Commit 56b8316

Browse files
ranj063lrgirdwo
authored andcommitted
topology: separate ssp params from dai common params
This patch makes changes to DAI config in topology to separate out SSP specific params from common params in preparation for other DAI types coming soon. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent e77a8ef commit 56b8316

18 files changed

Lines changed: 173 additions & 134 deletions

topology/m4/dai.m4

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,27 +131,45 @@ define(`DAI_CLOCK',
131131

132132
dnl DAI_TDM(slots, width, tx_mask, rx_mask)
133133
define(`DAI_TDM',
134-
` tdm_slots 'STR($1)
134+
`tdm_slots 'STR($1)
135135
` tdm_slot_width 'STR($2)
136136
` tx_slots 'STR($3)
137137
` rx_slots 'STR($4)
138138
)
139+
dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp sample bits)
140+
define(`SSP_CONFIG',
141+
` format "'$1`"'
142+
` '$2
143+
` '$3
144+
` '$4
145+
` '$5
146+
`}'
147+
$6
148+
)
149+
150+
dnl SSP_SAMPLE_BITS(type, idx, valid bits)
151+
define(`SSP_SAMPLE_BITS',
152+
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {'
153+
` tokens "sof_dai_tokens"'
154+
` tuples."word" {'
155+
` SOF_TKN_DAI_SAMPLE_BITS' STR($3)
156+
` }'
157+
`}'
158+
`SectionData."'N_DAI_CONFIG($1$2)`_data" {'
159+
` tuples "'N_DAI_CONFIG($1$2)`_tuples"'
160+
`}'
161+
)
139162

140163
dnl DAI Config)
141164
define(`N_DAI_CONFIG', `DAICONFIG.'$1)
142165

143-
dnl DAI_CONFIG(type, idx, link_id, name, format, valid bits, mclk, bclk, fsync, tdm)
166+
dnl DAI_CONFIG(type, idx, link_id, name, ssp_config)
144167
define(`DAI_CONFIG',
145168
`SectionHWConfig."'$1$2`" {'
146169
`'
147170
` id "'$2`"'
148-
` format "'$5`"'
149171
`'
150-
` '$7
151-
` '$8
152-
` '$9
153-
` '$10
154-
`}'
172+
` ifelse($1, `SSP', $5, `}')'
155173
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_str" {'
156174
` tokens "sof_dai_tokens"'
157175
` tuples."string" {'
@@ -161,15 +179,6 @@ define(`DAI_CONFIG',
161179
`SectionData."'N_DAI_CONFIG($1$2)`_data_str" {'
162180
` tuples "'N_DAI_CONFIG($1$2)`_tuples_str"'
163181
`}'
164-
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {'
165-
` tokens "sof_dai_tokens"'
166-
` tuples."word" {'
167-
` SOF_TKN_DAI_SAMPLE_BITS' STR($6)
168-
` }'
169-
`}'
170-
`SectionData."'N_DAI_CONFIG($1$2)`_data" {'
171-
` tuples "'N_DAI_CONFIG($1$2)`_tuples"'
172-
`}'
173182
`'
174183
`SectionBE."'$4`" {'
175184
` id "'$3`"'

topology/sof-apl-nocodec.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 2, 0, NoCodec, I2S, 24,
97-
DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 2, 0, NoCodec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 2, 24)))

topology/sof-apl-tdf8532.m4

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -187,41 +187,49 @@ PCM_DUPLEX_ADD(Port5, 5, 5, 5, PIPELINE_PCM_9, PIPELINE_PCM_10)
187187
#
188188
# BE configurations - overrides config in ACPI if present
189189
#
190-
DAI_CONFIG(SSP, 4, 4, SSP4-Codec, DSP_B, 32,
191-
DAI_CLOCK(mclk, 24576000, codec_mclk_in),
192-
DAI_CLOCK(bclk, 12288000, codec_slave),
193-
DAI_CLOCK(fsync, 48000, codec_slave),
194-
DAI_TDM(8, 32, 15, 15))
195-
196-
DAI_CONFIG(SSP, 2, 2, SSP2-Codec, I2S, 16,
197-
DAI_CLOCK(mclk, 24576000, codec_mclk_in),
198-
DAI_CLOCK(bclk, 1536000, codec_slave),
199-
DAI_CLOCK(fsync, 48000, codec_slave),
200-
DAI_TDM(2, 16, 3, 3))
201-
202-
DAI_CONFIG(SSP, 0, 0, SSP0-Codec, I2S, 16,
203-
DAI_CLOCK(mclk, 24576000, codec_mclk_in),
204-
DAI_CLOCK(bclk, 1536000, codec_slave),
205-
DAI_CLOCK(fsync, 48000, codec_slave),
206-
DAI_TDM(2, 16, 3, 3))
207-
208-
DAI_CONFIG(SSP, 1, 1, SSP1-Codec, I2S, 16,
209-
DAI_CLOCK(mclk, 24576000, codec_mclk_in),
210-
DAI_CLOCK(bclk, 1536000, codec_slave),
211-
DAI_CLOCK(fsync, 48000, codec_slave),
212-
DAI_TDM(2, 16, 3, 3))
213-
214-
DAI_CONFIG(SSP, 3, 3, SSP3-Codec, I2S, 16,
215-
DAI_CLOCK(mclk, 24576000, codec_mclk_in),
216-
DAI_CLOCK(bclk, 1536000, codec_slave),
217-
DAI_CLOCK(fsync, 48000, codec_slave),
218-
DAI_TDM(2, 16, 3, 3))
219-
220-
DAI_CONFIG(SSP, 5, 5, SSP5-Codec, I2S, 16,
221-
DAI_CLOCK(mclk, 24576000, codec_mclk_in),
222-
DAI_CLOCK(bclk, 1536000, codec_slave),
223-
DAI_CLOCK(fsync, 48000, codec_slave),
224-
DAI_TDM(2, 16, 3, 3))
190+
191+
DAI_CONFIG(SSP, 4, 4, SSP4-Codec,
192+
SSP_CONFIG(DSP_B, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
193+
DAI_CLOCK(bclk, 12288000, codec_slave),
194+
DAI_CLOCK(fsync, 48000, codec_slave),
195+
DAI_TDM(8, 32, 15, 15),
196+
SSP_SAMPLE_BITS(SSP, 4, 32)))
197+
198+
DAI_CONFIG(SSP, 2, 2, SSP2-Codec,
199+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
200+
DAI_CLOCK(bclk, 1536000, codec_slave),
201+
DAI_CLOCK(fsync, 48000, codec_slave),
202+
DAI_TDM(2, 16, 3, 3),
203+
SSP_SAMPLE_BITS(SSP, 2, 16)))
204+
205+
DAI_CONFIG(SSP, 0, 0, SSP0-Codec,
206+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
207+
DAI_CLOCK(bclk, 1536000, codec_slave),
208+
DAI_CLOCK(fsync, 48000, codec_slave),
209+
DAI_TDM(2, 16, 3, 3),
210+
SSP_SAMPLE_BITS(SSP, 0, 16)))
211+
212+
DAI_CONFIG(SSP, 1, 1, SSP1-Codec,
213+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
214+
DAI_CLOCK(bclk, 1536000, codec_slave),
215+
DAI_CLOCK(fsync, 48000, codec_slave),
216+
DAI_TDM(2, 16, 3, 3),
217+
SSP_SAMPLE_BITS(SSP, 1, 16)))
218+
219+
DAI_CONFIG(SSP, 3, 3, SSP3-Codec,
220+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
221+
DAI_CLOCK(bclk, 1536000, codec_slave),
222+
DAI_CLOCK(fsync, 48000, codec_slave),
223+
DAI_TDM(2, 16, 3, 3),
224+
SSP_SAMPLE_BITS(SSP, 3, 16)))
225+
226+
DAI_CONFIG(SSP, 5, 5, SSP5-Codec,
227+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
228+
DAI_CLOCK(bclk, 1536000, codec_slave),
229+
DAI_CLOCK(fsync, 48000, codec_slave),
230+
DAI_TDM(2, 16, 3, 3),
231+
SSP_SAMPLE_BITS(SSP, 5, 16)))
232+
225233

226234
VIRTUAL_DAPM_ROUTE_IN(BtHfp_ssp0_in, SSP, 0, IN, 0)
227235
VIRTUAL_DAPM_ROUTE_OUT(BtHfp_ssp0_out, SSP, 0, OUT, 1)
@@ -245,4 +253,3 @@ VIRTUAL_WIDGET(ssp3 Rx, 18)
245253
VIRTUAL_WIDGET(ssp4 Tx, 19)
246254
VIRTUAL_WIDGET(ssp5 Tx, 20)
247255
VIRTUAL_WIDGET(ssp5 Rx, 21)
248-

topology/sof-bdw-rt286.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 0, 0, Codec, I2S, 24,
97-
DAI_CLOCK(mclk, 24000000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 0, 0, Codec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24000000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 0, 24)))

topology/sof-bdw-rt5640.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 0, 0, Codec, I2S, 24,
97-
DAI_CLOCK(mclk, 24000000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 0, 0, Codec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24000000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 0, 24)))

topology/sof-byt-da7213.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24,
97-
DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 2, 0, SSP2-Codec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 2, 24)))

topology/sof-byt-nocodec.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 2, 0, NoCodec, I2S, 24,
97-
DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 2, 0, NoCodec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 2, 24)))

topology/sof-byt-rt5640.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24,
97-
DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 2, 0, SSP2-Codec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 2, 24)))

topology/sof-byt-rt5645.m4

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24,
97-
DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
96+
DAI_CONFIG(SSP, 2, 0, SSP2-Codec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 2, 24)))

topology/sof-byt-rt5651.m4

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ PCM_DUPLEX_ADD(Low Latency, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9393
#
9494
# BE configurations - overrides config in ACPI if present
9595
#
96-
DAI_CONFIG(SSP, 2, 0, SSP2-Codec, I2S, 24,
97-
DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98-
DAI_CLOCK(bclk, 2400000, codec_slave),
99-
DAI_CLOCK(fsync, 48000, codec_slave),
100-
DAI_TDM(2, 25, 3, 3))
101-
96+
DAI_CONFIG(SSP, 2, 0, SSP2-Codec,
97+
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
98+
DAI_CLOCK(bclk, 2400000, codec_slave),
99+
DAI_CLOCK(fsync, 48000, codec_slave),
100+
DAI_TDM(2, 25, 3, 3),
101+
SSP_SAMPLE_BITS(SSP, 2, 24)))

0 commit comments

Comments
 (0)