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

Commit 308cf3d

Browse files
authored
Merge pull request #4 from ranj063/dai_changes
DAI updates - topology changes
2 parents 7b96948 + f73aa73 commit 308cf3d

34 files changed

+267
-227
lines changed

configure.ac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ AC_OUTPUT([
2020
rmbox/Makefile
2121
topology/Makefile
2222
topology/common/Makefile
23-
topology/dsps/Makefile
23+
topology/platform/Makefile
24+
topology/platform/intel/Makefile
25+
topology/platform/common/Makefile
2426
topology/m4/Makefile
2527
topology/sof/Makefile
2628
topology/test/Makefile

topology/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
# Dependencies
44
#
55

6-
SUBDIRS = test m4 sof common dsps
6+
SUBDIRS = test m4 sof common platform
77

88
DEPS = \
9-
dsps/*.m4 \
9+
platform/intel/*.m4 \
10+
platform/common/*.m4 \
1011
common/*.m4 \
1112
m4/*.m4 \
1213
sof/*.m4
@@ -34,7 +35,7 @@ MACHINES = \
3435
.PRECIOUS: %.conf
3536

3637
%.conf : %.m4 ${DEPS}
37-
m4 -I m4 -I common $< > $@
38+
m4 -I m4 -I common -I platform/common $< > $@
3839

3940
%.tplg : %.conf
4041
alsatplg -v 1 -c $< -o $@

topology/m4/dai.m4

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -121,98 +121,6 @@ define(`D_DAI', `SectionDAI."'N_DAI`" {'
121121
` capture "'$3`"'
122122
`}')
123123

124-
dnl DAI_CLOCK(clock, freq, codec_master)
125-
define(`DAI_CLOCK',
126-
$1 STR($3)
127-
$1_freq STR($2))
128-
129-
130-
dnl DAI_TDM(slots, width, tx_mask, rx_mask)
131-
define(`DAI_TDM',
132-
`tdm_slots 'STR($1)
133-
` tdm_slot_width 'STR($2)
134-
` tx_slots 'STR($3)
135-
` rx_slots 'STR($4)
136-
)
137-
dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp sample bits)
138-
define(`SSP_CONFIG',
139-
` format "'$1`"'
140-
` '$2
141-
` '$3
142-
` '$4
143-
` '$5
144-
`}'
145-
$6
146-
)
147-
148-
dnl SSP_SAMPLE_BITS(type, idx, valid bits)
149-
define(`SSP_SAMPLE_BITS',
150-
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {'
151-
` tokens "sof_dai_tokens"'
152-
` tuples."word" {'
153-
` SOF_TKN_DAI_SAMPLE_BITS' STR($3)
154-
` }'
155-
`}'
156-
`SectionData."'N_DAI_CONFIG($1$2)`_data" {'
157-
` tuples "'N_DAI_CONFIG($1$2)`_tuples"'
158-
`}'
159-
)
160-
161-
dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b,
162-
dnl clk_egde, skew)
163-
define(`PDM_TUPLES',
164-
` tuples."short.pdm$1" {'
165-
` SOF_TKN_INTEL_DMIC_PDM_CTRL_ID' STR($1)
166-
` SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable' STR($2)
167-
` SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable' STR($3)
168-
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_A' STR($4)
169-
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_B' STR($5)
170-
` SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE' STR($6)
171-
` SOF_TKN_INTEL_DMIC_PDM_SKEW' STR($7)
172-
` }'
173-
)
174-
175-
dnl PDM_CONFIG(type, idx, pdm tuples list)
176-
define(`PDM_CONFIG',
177-
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_pdm_tuples" {'
178-
` tokens "sof_dmic_pdm_tokens"'
179-
$3
180-
`}'
181-
)
182-
183-
dnl DMIC currently only supports 16 bit or 32-bit word length
184-
dnl DMIC_WORD_LENGTH(frame format)
185-
define(`DMIC_WORD_LENGTH',
186-
`ifelse($1, `s16le', 16, $1, `s32le', 32, `')')
187-
188-
dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max,
189-
dnl req pdm count, sample_rate,
190-
dnl fifo word length, type, idx, pdm controller config)
191-
define(`DMIC_CONFIG',
192-
`SectionVendorTuples."'N_DAI_CONFIG($9$10)`_dmic_tuples" {'
193-
` tokens "sof_dmic_tokens"'
194-
` tuples."word" {'
195-
` SOF_TKN_INTEL_DMIC_DRIVER_VERSION' STR($1)
196-
` SOF_TKN_INTEL_DMIC_CLK_MIN' STR($2)
197-
` SOF_TKN_INTEL_DMIC_CLK_MAX' STR($3)
198-
` SOF_TKN_INTEL_DMIC_DUTY_MIN' STR($4)
199-
` SOF_TKN_INTEL_DMIC_DUTY_MAX' STR($5)
200-
` SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE' STR($6)
201-
` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($7)
202-
` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($8)
203-
` }'
204-
`}'
205-
dnl PDM config for the number of active PDM controllers
206-
$11
207-
`SectionData."'N_DAI_CONFIG($9$10)`_pdm_data" {'
208-
` tuples "'N_DAI_CONFIG($9$10)`_pdm_tuples"'
209-
`}'
210-
`SectionData."'N_DAI_CONFIG($9$10)`_data" {'
211-
` tuples "'N_DAI_CONFIG($9$10)`_dmic_tuples"'
212-
213-
`}'
214-
)
215-
216124
dnl DAI Config)
217125
define(`N_DAI_CONFIG', `DAICONFIG.'$1)
218126

topology/platform/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SUBDIRS = intel common

topology/platform/common/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
EXTRA_DIST = \
2+
ssp.m4

topology/platform/common/ssp.m4

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
divert(-1)
2+
3+
dnl SSP related macros
4+
5+
dnl SSP_CLOCK(clock, freq, codec_master)
6+
define(`SSP_CLOCK',
7+
$1 STR($3)
8+
$1_freq STR($2))
9+
10+
11+
dnl SSP_TDM(slots, width, tx_mask, rx_mask)
12+
define(`SSP_TDM',
13+
`tdm_slots 'STR($1)
14+
` tdm_slot_width 'STR($2)
15+
` tx_slots 'STR($3)
16+
` rx_slots 'STR($4)
17+
)
18+
dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data)
19+
define(`SSP_CONFIG',
20+
` format "'$1`"'
21+
` '$2
22+
` '$3
23+
` '$4
24+
` '$5
25+
`}'
26+
$6
27+
)
28+
29+
dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id)
30+
dnl mclk_id is optional
31+
define(`SSP_CONFIG_DATA',
32+
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {'
33+
` tokens "sof_ssp_tokens"'
34+
` tuples."word" {'
35+
` SOF_TKN_INTEL_SSP_SAMPLE_BITS' STR($3)
36+
` }'
37+
` tuples."short" {'
38+
` SOF_TKN_INTEL_SSP_MCLK_ID' ifelse($4, `', "0", STR($4))
39+
` }'
40+
`}'
41+
`SectionData."'N_DAI_CONFIG($1$2)`_data" {'
42+
` tuples "'N_DAI_CONFIG($1$2)`_tuples"'
43+
`}'
44+
)
45+
46+
divert(0)dnl

topology/dsps/Makefile.am renamed to topology/platform/intel/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ EXTRA_DIST = \
44
byt.m4 \
55
cht.m4 \
66
hsw.m4 \
7-
cnl.m4
7+
cnl.m4 \
8+
dmic.m4
89

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

topology/platform/intel/dmic.m4

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
divert(-1)
2+
3+
dnl DMIC related macros
4+
5+
dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b,
6+
dnl clk_egde, skew)
7+
define(`PDM_TUPLES',
8+
` tuples."short.pdm$1" {'
9+
` SOF_TKN_INTEL_DMIC_PDM_CTRL_ID' STR($1)
10+
` SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable' STR($2)
11+
` SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable' STR($3)
12+
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_A' STR($4)
13+
` SOF_TKN_INTEL_DMIC_PDM_POLARITY_B' STR($5)
14+
` SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE' STR($6)
15+
` SOF_TKN_INTEL_DMIC_PDM_SKEW' STR($7)
16+
` }'
17+
)
18+
19+
dnl PDM_CONFIG(type, idx, pdm tuples list)
20+
define(`PDM_CONFIG',
21+
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_pdm_tuples" {'
22+
` tokens "sof_dmic_pdm_tokens"'
23+
$3
24+
`}'
25+
)
26+
27+
dnl DMIC currently only supports 16 bit or 32-bit word length
28+
dnl DMIC_WORD_LENGTH(frame format)
29+
define(`DMIC_WORD_LENGTH',
30+
`ifelse($1, `s16le', 16, $1, `s32le', 32, `')')
31+
32+
dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max,
33+
dnl req pdm count, sample_rate,
34+
dnl fifo word length, type, idx, pdm controller config)
35+
define(`DMIC_CONFIG',
36+
`SectionVendorTuples."'N_DAI_CONFIG($9$10)`_dmic_tuples" {'
37+
` tokens "sof_dmic_tokens"'
38+
` tuples."word" {'
39+
` SOF_TKN_INTEL_DMIC_DRIVER_VERSION' STR($1)
40+
` SOF_TKN_INTEL_DMIC_CLK_MIN' STR($2)
41+
` SOF_TKN_INTEL_DMIC_CLK_MAX' STR($3)
42+
` SOF_TKN_INTEL_DMIC_DUTY_MIN' STR($4)
43+
` SOF_TKN_INTEL_DMIC_DUTY_MAX' STR($5)
44+
` SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE' STR($6)
45+
` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($7)
46+
` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($8)
47+
` }'
48+
`}'
49+
dnl PDM config for the number of active PDM controllers
50+
$11
51+
`SectionData."'N_DAI_CONFIG($9$10)`_pdm_data" {'
52+
` tuples "'N_DAI_CONFIG($9$10)`_pdm_tuples"'
53+
`}'
54+
`SectionData."'N_DAI_CONFIG($9$10)`_data" {'
55+
` tuples "'N_DAI_CONFIG($9$10)`_dmic_tuples"'
56+
57+
`}'
58+
)
59+
60+
divert(0)dnl
File renamed without changes.

topology/sof-apl-nocodec.m4

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
include(`pipeline.m4')
77
include(`utils.m4')
88
include(`dai.m4')
9+
include(`ssp.m4')
910

1011
# Include TLV library
1112
include(`common/tlv.m4')
@@ -14,7 +15,7 @@ include(`common/tlv.m4')
1415
include(`sof/tokens.m4')
1516

1617
# Include Apollolake DSP configuration
17-
include(`dsps/bxt.m4')
18+
include(`platform/intel/bxt.m4')
1819

1920
#
2021
# Define the pipelines
@@ -91,8 +92,8 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
9192
# BE configurations - overrides config in ACPI if present
9293
#
9394
DAI_CONFIG(SSP, 2, 0, NoCodec,
94-
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 19200000, codec_mclk_in),
95-
DAI_CLOCK(bclk, 2400000, codec_slave),
96-
DAI_CLOCK(fsync, 48000, codec_slave),
97-
DAI_TDM(2, 25, 3, 3),
98-
SSP_SAMPLE_BITS(SSP, 2, 24)))
95+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in),
96+
SSP_CLOCK(bclk, 2400000, codec_slave),
97+
SSP_CLOCK(fsync, 48000, codec_slave),
98+
SSP_TDM(2, 25, 3, 3),
99+
SSP_CONFIG_DATA(SSP, 2, 24)))

topology/sof-apl-tdf8532.m4

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
include(`utils.m4')
77
include(`dai.m4')
88
include(`pipeline.m4')
9+
include(`ssp.m4')
910

1011
# Include TLV library
1112
include(`common/tlv.m4')
@@ -14,7 +15,7 @@ include(`common/tlv.m4')
1415
include(`sof/tokens.m4')
1516

1617
# Include Apollolake DSP configuration
17-
include(`dsps/bxt.m4')
18+
include(`platform/intel/bxt.m4')
1819

1920
#
2021
# Define the pipelines
@@ -179,46 +180,46 @@ PCM_DUPLEX_ADD(Port5, 5, 5, 5, PIPELINE_PCM_9, PIPELINE_PCM_10)
179180
#
180181

181182
DAI_CONFIG(SSP, 4, 4, SSP4-Codec,
182-
SSP_CONFIG(DSP_B, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
183-
DAI_CLOCK(bclk, 12288000, codec_slave),
184-
DAI_CLOCK(fsync, 48000, codec_slave),
185-
DAI_TDM(8, 32, 15, 15),
186-
SSP_SAMPLE_BITS(SSP, 4, 32)))
183+
SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
184+
SSP_CLOCK(bclk, 12288000, codec_slave),
185+
SSP_CLOCK(fsync, 48000, codec_slave),
186+
SSP_TDM(8, 32, 15, 15),
187+
SSP_CONFIG_DATA(SSP, 4, 32)))
187188

188189
DAI_CONFIG(SSP, 2, 2, SSP2-Codec,
189-
SSP_CONFIG(DSP_B, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
190-
DAI_CLOCK(bclk, 12288000, codec_slave),
191-
DAI_CLOCK(fsync, 48000, codec_slave),
192-
DAI_TDM(2, 32, 255, 255),
193-
SSP_SAMPLE_BITS(SSP, 2, 32)))
190+
SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
191+
SSP_CLOCK(bclk, 12288000, codec_slave),
192+
SSP_CLOCK(fsync, 48000, codec_slave),
193+
SSP_TDM(2, 32, 255, 255),
194+
SSP_CONFIG_DATA(SSP, 2, 32)))
194195

195196
DAI_CONFIG(SSP, 0, 0, SSP0-Codec,
196-
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
197-
DAI_CLOCK(bclk, 1536000, codec_slave),
198-
DAI_CLOCK(fsync, 48000, codec_slave),
199-
DAI_TDM(2, 16, 3, 3),
200-
SSP_SAMPLE_BITS(SSP, 0, 16)))
197+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
198+
SSP_CLOCK(bclk, 1536000, codec_slave),
199+
SSP_CLOCK(fsync, 48000, codec_slave),
200+
SSP_TDM(2, 16, 3, 3),
201+
SSP_CONFIG_DATA(SSP, 0, 16)))
201202

202203
DAI_CONFIG(SSP, 1, 1, SSP1-Codec,
203-
SSP_CONFIG(I2S, 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-
SSP_SAMPLE_BITS(SSP, 1, 16)))
204+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
205+
SSP_CLOCK(bclk, 1536000, codec_slave),
206+
SSP_CLOCK(fsync, 48000, codec_slave),
207+
SSP_TDM(2, 16, 3, 3),
208+
SSP_CONFIG_DATA(SSP, 1, 16)))
208209

209210
DAI_CONFIG(SSP, 3, 3, SSP3-Codec,
210-
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
211-
DAI_CLOCK(bclk, 1536000, codec_slave),
212-
DAI_CLOCK(fsync, 48000, codec_slave),
213-
DAI_TDM(2, 16, 3, 3),
214-
SSP_SAMPLE_BITS(SSP, 3, 16)))
211+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
212+
SSP_CLOCK(bclk, 1536000, codec_slave),
213+
SSP_CLOCK(fsync, 48000, codec_slave),
214+
SSP_TDM(2, 16, 3, 3),
215+
SSP_CONFIG_DATA(SSP, 3, 16)))
215216

216217
DAI_CONFIG(SSP, 5, 5, SSP5-Codec,
217-
SSP_CONFIG(I2S, DAI_CLOCK(mclk, 24576000, codec_mclk_in),
218-
DAI_CLOCK(bclk, 1536000, codec_slave),
219-
DAI_CLOCK(fsync, 48000, codec_slave),
220-
DAI_TDM(2, 16, 3, 3),
221-
SSP_SAMPLE_BITS(SSP, 5, 16)))
218+
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
219+
SSP_CLOCK(bclk, 1536000, codec_slave),
220+
SSP_CLOCK(fsync, 48000, codec_slave),
221+
SSP_TDM(2, 16, 3, 3),
222+
SSP_CONFIG_DATA(SSP, 5, 16)))
222223

223224

224225
VIRTUAL_DAPM_ROUTE_IN(BtHfp_ssp0_in, SSP, 0, IN, 0)

0 commit comments

Comments
 (0)